,

How to Get Free Wildcard SSL Certificates with Let’s Encrypt (2026)

Free SSL Certificate from Lets Encrypt CA

Issuing individual SSL/TLS certificates for every single subdomain across a growing web server or Docker homelab quickly becomes unmanageable, and worse, every subdomain certificate you request via standard HTTP-01 validation gets published to public Certificate Transparency (CT) logs that automated reconnaissance scanners scrape daily.

By provisioning a single free Let’s Encrypt Wildcard SSL Certificate (*.yourdomain.com + yourdomain.com) using Certbot’s DNS-01 API validation, you encrypt unlimited public and internal subdomains without ever exposing port 80 to the internet or leaking internal homelab hostnames in CT logs. After completing our Ubuntu Server Security Hardening Checklist, follow this 2026 guide to set up automated Cloudflare DNS-01 wildcard renewals and modern TLS 1.3 Nginx hardening.

Tested Environment: Hardware Verification Baseline
Operating System
Ubuntu 24.04.2 LTS (Noble Numbat)
ACME Client
Certbot v2.11+ with python3-certbot-dns-cloudflare
Key Algorithm
ECDSA P-384 / P-256 (Elliptic Curve)
Web Server
Nginx v1.26.x (TLS 1.3 + HTTP/2 + HTTP/3)
Last Verified
November 2026

Key Takeaways

  • Wildcard Certificates Mandate DNS-01 Validation: Let’s Encrypt only issues wildcard certificates (*.yourdomain.com) via DNS TXT record challenges (DNS-01); standard webroot HTTP-01 validation cannot issue wildcards.
  • Works on Firewalled Internal Servers (Zero Port 80 Required): Because DNS-01 verifies domain ownership via your DNS provider’s API, you can generate genuine Let’s Encrypt TLS certificates for internal Docker services sitting behind our Self-Hosted Headscale Mesh VPN without opening port 80 or 443 on your router.
  • 2026 Let’s Encrypt Notice (Remove ssl_stapling): Let’s Encrypt permanently retired its OCSP responders in favor of CRLs; omit legacy ssl_stapling on; directives from your 2026 Nginx configs to prevent log errors.

Let’s Encrypt ACME Validation Compared: HTTP-01 vs DNS-01 Wildcard

Before running Certbot, understand why DNS-01 API validation is the architectural standard for wildcard certificates and multi-container environments in 2026 compared to legacy HTTP-01 port 80 challenges.

Capability / RequirementDNS-01 Challenge (Cloudflare API)HTTP-01 Challenge (--nginx / --webroot)Manual DNS Challenge (--manual)
Supports Wildcard (*.domain.com)?Yes (Unlimited Subdomains)No (Single Hostnames Only)Yes
Requires Port 80 Open to Public Internet?No (Works Behind Firewalls/VPNs)Yes (Mandatory Inbound TCP 80)No
Automated 60-Day Background Renewal?Yes (100% Automated via Systemd Timer)YesNo (Breaks Every 90 Days!)
Hides Internal Subdomains from CT Logs?Yes (Only *.domain.com Appears)No (Every Subdomain is Publicly Logged)Yes

Step 1: Install Certbot & the DNS-Cloudflare Plugin on Ubuntu 24.04

Install Certbot and the official Cloudflare DNS authenticator plugin directly from Ubuntu 24.04’s APT repository (or via Snap) so Certbot can automatically create and delete temporary _acme-challenge TXT records during issuance and renewal.

sudo apt update && sudo apt install certbot python3-certbot-dns-cloudflare -y

Step 2: Create a Least-Privilege Scoped Cloudflare DNS API Token

Never store your Global Cloudflare API Key on a web server. Instead, generate a scoped API Token restricted strictly to Zone : DNS : Edit permissions for your specific domain, and lock the credentials file to root-only 0600 permissions.

  1. In your Cloudflare Dashboard, navigate to My Profile → API Tokens → Create Token and select the Edit zone DNS template.
  2. Set Permissions to Zone, DNS, Edit and set Zone Resources to Include, Specific zone, yourdomain.com, then copy the generated token.
  3. On your Ubuntu server, create a restricted /root/.secrets/ directory and store the token:
sudo mkdir -p /root/.secrets
sudo nano /root/.secrets/cloudflare.ini

Paste the following single line into /root/.secrets/cloudflare.ini:

# Scoped Cloudflare API Token for Certbot DNS-01 validation
dns_cloudflare_api_token = YOUR_SCOPED_CLOUDFLARE_API_TOKEN

Lock down file ownership and permissions so Certbot does not emit a security warning:

sudo chmod 0700 /root/.secrets
sudo chmod 0600 /root/.secrets/cloudflare.ini

Step 3: Request Your Wildcard SSL Certificate & Configure Nginx Reload Hook

When requesting a wildcard certificate, always pass both -d yourdomain.com (the apex root domain) and -d "*.yourdomain.com" (all first-level subdomains) in the same command, and attach a --deploy-hook so Nginx reloads automatically whenever the certificate renews.

sudo certbot certonly \
  --dns-cloudflare \
  --dns-cloudflare-credentials /root/.secrets/cloudflare.ini \
  --dns-cloudflare-propagation-seconds 20 \
  --key-type ecdsa \
  -d yourdomain.com \
  -d "*.yourdomain.com" \
  --deploy-hook "systemctl reload nginx"

Certbot places your ECDSA certificate and private key inside /etc/letsencrypt/live/yourdomain.com/. You can now reference those two files across all of your Nginx virtual hosts (and combine them with our Nginx Gzip & Brotli Compression Guide):

# Modern 2026 Nginx TLS 1.3 / 1.2 SSL Block (No deprecated OCSP Stapling)
ssl_certificate     /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
ssl_protocols       TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_session_cache   shared:SSL:10m;
ssl_session_timeout 1d;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;

Finally, verify that the automated systemd renewal timer (certbot.timer) is active and passes a dry-run test:

sudo systemctl status certbot.timer
sudo certbot renew --dry-run

Frequently Asked Questions (FAQ)

Does a *.yourdomain.com wildcard certificate also cover the bare yourdomain.com root domain?

No, a wildcard string (*.yourdomain.com) only matches subdomains like app.yourdomain.com and does not match the bare apex domain by itself. Always include both -d yourdomain.com and -d "*.yourdomain.com" in your Certbot command so both are bundled into the same certificate.

How do you make a Let’s Encrypt wildcard certificate auto-renew without manual intervention?

Never use certbot --manual to create wildcard certificates, because manual TXT records cannot renew automatically. Instead, install a DNS API plugin such as python3-certbot-dns-cloudflare (or dns-route53 / dns-digitalocean) so the certbot.timer systemd unit updates the TXT record automatically every 60 days.

Why is Nginx showing an OCSP_basic_verify() failed warning on new Let’s Encrypt certificates?

Let’s Encrypt permanently retired its OCSP responders and removed OCSP URLs from newly issued certificates in favor of Certificate Revocation Lists (CRLs). Remove ssl_stapling on; and ssl_stapling_verify on; from your Nginx configuration to silence the warning.