A simple wrapper around certbot/dns-cloudflare to add a renewal interval.
50K+
SSL certificates that renew themselves. Built on the official Certbot image with an improved user experience, this image generates free Let's Encrypt certificates via Cloudflare DNS validation, renews them automatically, and saves them to a volume any container can read — so even applications without Let's Encrypt support get always-valid certificates. No config files, no exposed ports — just set a few environment variables and deploy.
| Docker Image | Size |
|---|---|
| serversideup/certbot-dns-cloudflare |
The image is based on certbot/dns-cloudflare:latest, providing a stable and up-to-date environment for running Certbot with Cloudflare DNS authentication.
REPLACE_SYMLINKS to true)We designed this image to work great in orchestrated deployments like Kubernetes, Docker Swarm, or even in Github Actions. Look how simple the syntax is:
certbot:
image: serversideup/certbot-dns-cloudflare
volumes:
- certbot_data:/etc/letsencrypt
environment:
CLOUDFLARE_API_TOKEN: "${CLOUDFLARE_API_TOKEN}"
CERTBOT_EMAIL: "${CERTBOT_EMAIL}"
CERTBOT_DOMAINS: "${CERTBOT_DOMAINS}"
CERTBOT_KEY_TYPE: "rsa"
volumes:
certbot_data:
The following environment variables can be used to customize the Certbot container:
| Variable | Description | Default Value |
|---|---|---|
CERTBOT_DOMAINS | Comma-separated list of domains for which to obtain the certificate (example: example.com,www.example.com) | - |
CERTBOT_CERT_NAME | Explicit certificate name to update/modify (See official docs →) | - |
CERTBOT_EXPAND | DEPRECATED: Expand existing certificate to add domains (use CERTBOT_CERT_NAME instead, see official docs →) | false |
CERTBOT_EMAIL | Email address for Let's Encrypt notifications | - |
CERTBOT_KEY_TYPE | Type of private key to generate | ecdsa |
CERTBOT_SERVER | The ACME server URL | https://acme-v02.api.letsencrypt.org/directory |
CERTBOT_DEPLOY_HOOK | A command to run after obtaining the certificate | - |
CLOUDFLARE_API_TOKEN | Cloudflare API token for DNS authentication (see below how to create one) | - |
CLOUDFLARE_CREDENTIALS_FILE | Path to the Cloudflare credentials file. | /cloudflare.ini |
CLOUDFLARE_PROPAGATION_SECONDS | Wait time (in seconds) after setting DNS TXT records before validation. Useful if DNS propagation is slow. | 10 |
DEBUG | Enable debug mode (prints more information to the console) | false |
PUID | The user ID to run certbot as | 0 |
PGID | The group ID to run certbot as | 0 |
RENEWAL_INTERVAL | Interval between certificate renewal checks. Set to 0 to disable renewals and only run once. | 43200 seconds (12 hours) |
REPLACE_SYMLINKS | Replaces symlinks with direct copies of the files they reference (required for Windows) | false |
Warning
Treat this token like a password. It will grant access to your Cloudflare account and can be used to modify DNS records.
Pull the Docker image:
docker pull serversideup/certbot-dns-cloudflare:latest
Run the container with the required environment variables:
Caution
Make sure to replace the `-v /path/to/your/certs:/etc/letsencrypt` with a valid path on your host machine.
docker run \
-e CERTBOT_DOMAINS="yourdomain.com" \
-e CERTBOT_EMAIL="[email protected]" \
-e CLOUDFLARE_API_TOKEN="your-cloudflare-api-token" \
-v /path/to/your/certs:/etc/letsencrypt \
serversideup/certbot-dns-cloudflare:latest
Tip
For Wildcard Certificates, use the following order for the Docker instance health check: `domain.name, *.domain.name`
As an open-source project, we strive for transparency and collaboration in our development process. We greatly appreciate any contributions members of our community can provide. Whether you're fixing bugs, proposing features, improving documentation, or spreading awareness - your involvement strengthens the project.
Need help getting started? Join our Discord community and we'll help you out!
All of our software is free and open to the world. None of this can be brought to you without the financial backing of our sponsors.
We're Dan and Jay - a two-person team with a passion for open source products. We created Server Side Up to help share what we learn.
If you appreciate this project, be sure to check out our other projects.
Content type
Image
Digest
sha256:e0a687715…
Size
90.3 MB
Last updated
3 days ago
docker pull serversideup/certbot-dns-cloudflarePulls:
4,622
Last week