SSL Certificate Setup Guide
Prerequisites
SSL certificates in this system are automatically provisioned using Caddy's ACME integration with Cloudflare DNS challenges. This requires:
1. Cloudflare API Token (REQUIRED)
You MUST have a Cloudflare API token configured for SSL certificates to work. Without this, Caddy cannot provision SSL certificates.
Creating a Cloudflare API Token
- Log in to your Cloudflare account
- Go to "My Profile" → "API Tokens"
- Click "Create Token"
- Use the "Edit zone DNS" template or create a custom token with these permissions:
- Zone → DNS → Edit
- Zone → Zone → Read
- Select the specific zones (domains) you want to manage
- Copy the generated token
Configuring the Token in the System
- Navigate to Local → Caddy in the dashboard
- Click on the "Settings" tab
- Paste your Cloudflare API Token in the "Cloudflare API Token" field
- Set your ACME email address (for Let's Encrypt notifications)
- Save the settings
How SSL Certificates Work
-
When you add a new server/route, Caddy is configured with the domain
-
During the sync process, if a Cloudflare token is present:
- Caddy sets up ACME automation policies
- It uses Cloudflare DNS challenges to verify domain ownership
- Let's Encrypt issues the certificate
- The certificate is automatically renewed before expiration
-
If no Cloudflare token is configured:
- NO SSL certificates will be created
- Your sites will only be accessible via HTTP
- The SSL status will show "No SSL" or remain in "Checking" state
Troubleshooting
SSL Status Shows "Checking" Forever
- Verify that a Cloudflare API token is configured in Caddy settings
- Check that the domain is actually managed by Cloudflare
- Ensure the API token has the correct permissions
"No certificate found" Errors
- This is normal for new domains before the certificate is issued
- Certificate provisioning can take 1-5 minutes after adding a domain
- Check Caddy logs at
/logs/caddy.logfor ACME errors
Certificate Not Creating for New Domains
- Confirm Cloudflare API token is set in Caddy settings
- Verify the domain's DNS is managed by Cloudflare
- Check that the domain has been synced to Caddy (click "Sync" button)
- Wait 5 minutes for the ACME process to complete
- Check Caddy logs for any ACME challenges failures
Important Notes
- Local/Private domains (like
*.localor private IP addresses) cannot get public SSL certificates - Each certificate covers both the domain and its wildcard (e.g.,
example.devand*.example.dev) - Certificates are stored in Caddy's data directory and persist across restarts
- Certificate renewal is automatic and happens ~30 days before expiration
DNS Requirements
For SSL certificates to work:
- The domain must exist in Cloudflare DNS
- The Cloudflare API token must have access to that zone
- The DNS records don't need to point to your server (DNS challenge only verifies control)
Security Best Practices
- Store the Cloudflare API token securely
- Use a token with minimal permissions (only DNS edit for specific zones)
- Regularly rotate your API tokens
- Monitor certificate expiration dates (though auto-renewal should handle this)