This guide helps you set up a wildcard certificate (*.example.com) in NGINX Proxy Manager (NPM) using Cloudflare DNS-01 challenge with a proper API token.
✅ Prerequisites¶
- You are using NGINX Proxy Manager (installed on TrueNAS SCALE 24.10 via App Store or Docker).
- Your domain is managed in Cloudflare.
- You want to issue a wildcard cert like
*.something.com.
1. 🌐 Create a Cloudflare API Token¶
⚠️ Do not use Global API Key — this is a common mistake. Use a scoped API Token instead.
Steps:¶
-
Click on "Create Token"
-
Under "API Token Templates", select "Edit zone DNS"
-
On the next screen:
-
Permissions:
- Zone → DNS → Edit
-
Zone Resources:
-
Include → All Zones (or specify the zone you want)
-
Click Continue to summary → Click Create Token
-
Copy the token and store it somewhere safe.
2. 🔐 Configure NGINX Proxy Manager with Cloudflare¶
-
Go to NPM Dashboard → SSL Certificates → Add SSL Certificate
-
Choose Let's Encrypt
-
Fill in the form:
-
Domain Names:
*.something.com(replace with your actual domain) - Email Address: your email
-
DNS Challenge Provider: Cloudflare (dns-cloudflare)
-
Under Advanced:
-
Tick Use a DNS Challenge
-
Fill in:
- CF_API_EMAIL: (Not needed if you’re using token-based auth)
- CF_API_KEY: Paste your newly created API Token
If NPM is using the certbot DNS plugin for Cloudflare, it will read from a config file. See next step.
3. ⚙️ Optional: Store Token in Configuration File (If Required)¶
If NGINX Proxy Manager (your app instance) uses a config file for DNS credentials:
- Create a file named
cloudflare.ini:
dns_cloudflare_api_token = YOUR_API_TOKEN
- Secure it:
chmod 600 cloudflare.ini
- Update your NGINX Proxy Manager’s Docker or app config to reference this file if needed.
In some NPM configurations, simply entering the API token into the UI is sufficient.
4. ✅ Issue the Certificate¶
- Save the configuration.
- Click on "Save" and NPM will attempt to issue the certificate via DNS-01 challenge.
- You should see success logs like:
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/...
5. 📌 Apply the Certificate¶
Now that the wildcard certificate is issued:
- Go to Hosts → Proxy Hosts
- Edit or add a new proxy host
-
Under the SSL tab:
-
Enable SSL
- Select your newly created wildcard cert from the dropdown
- Enable Force SSL and HTTP/2 support as needed
🚫 Common Mistakes to Avoid¶
- ❌ Using Global API Key instead of creating a scoped API token
- ❌ Forgetting to include wildcard domain (
*.something.com) in the cert - ❌ Not ticking the “DNS Challenge” box in NPM when using Cloudflare
🔄 Renewals¶
Wildcard certs issued by Let's Encrypt are valid for 90 days. NGINX Proxy Manager handles auto-renewal as long as your API token remains valid and permissions don’t change.
Let me know if you'd like a version of this saved to your internal wiki format or exported as a Markdown file.
Perfect — here's the updated full documentation, now including your NGINX Proxy Manager instructions for completing the Let's Encrypt wildcard cert setup via Cloudflare DNS challenge:
🛡️ Wildcard SSL Certificate with Cloudflare for NGINX Proxy Manager (TrueNAS 24.10)¶
This guide shows how to issue a wildcard SSL certificate (*.yourdomain.com) via Let's Encrypt using Cloudflare DNS challenge, and configure it in NGINX Proxy Manager (NPM) — perfect for hosting multiple subdomains with one cert on your TrueNAS server.
✅ Prerequisites¶
- TrueNAS SCALE 24.10 running NGINX Proxy Manager
- Your domain is managed by Cloudflare
- You want wildcard SSL:
*.something.com
1️⃣ Create a Scoped API Token in Cloudflare¶
⚠️ Do NOT use the "Global API Key" — instead, create a token.
Steps:¶
-
Click Create Token
-
Use the Edit zone DNS template
-
On the next screen:
-
Permissions:
- Zone → DNS → Edit
-
Zone Resources:
-
Include → All Zones (or select just your domain)
-
Click Continue to Summary, then Create Token
-
Copy the token — you’ll use this in NGINX Proxy Manager.
2️⃣ Configure Wildcard Certificate in NGINX Proxy Manager¶
Steps:¶
-
Open your NGINX Proxy Manager UI
-
Go to SSL Certificates → Add SSL Certificate
-
Select Let's Encrypt
-
Fill out the form:
-
Domain Name(s):
*.something.com(replace with your actual domain) (You can addsomething.comas a second line if you want it to cover both root and subdomains) -
Email Address: Your email address
-
Use a DNS Challenge: ✅ Check this box
-
DNS Provider: From the dropdown, choose Cloudflare
-
Scroll down to Credentials File Content — you will see:
# Cloudflare API token
dns_cloudflare_api_token =
→ Paste the token you copied from Cloudflare after the = sign.
-
Agree to the Terms of Service
-
Click Save
3️⃣ Certificate Issuance & Use¶
If successful, NPM will:
- Call the Cloudflare DNS API to add a
_acme-challengeTXT record - Wait for DNS propagation
- Issue the wildcard cert from Let's Encrypt
Once saved, the certificate will appear in your list of SSL certs.
4️⃣ Apply the Wildcard Certificate to Your Proxy Hosts¶
-
Go to Proxy Hosts
-
Edit an existing host or create a new one (e.g.,
app.something.com) -
Under the SSL tab:
-
Check Block Common Exploits
- Enable SSL
- Select your wildcard cert from the dropdown
-
Optionally enable Force SSL and HTTP/2 Support
-
Click Save
🧠 Tips & Notes¶
-
Your wildcard cert (
*.something.com) will cover any subdomain:app.something.com,media.something.com, etc. -
For root domain
something.com, either: -
Add it as a separate domain in the same cert request
-
Or create a second cert just for the root domain
-
NPM will auto-renew the cert before expiry if the API token remains valid.