Lego Cloudflare Certificate Generator: github.com/ljgonzalez1/lego-cloudflare-ssl-certgen
10K+

GitHub repository and documentationโ
Issue Let's Encrypt certificates with lego and Cloudflare DNS-01. Each group in domains.yaml produces one certificate for ordinary names and wildcards. Names with A, AAAA, or CNAME records use the same challenge. The container prints a certificate summary and exits.
โ ๏ธ Start in staging. Repeated production runs can hit Let's Encrypt's rate limit for the same set of names. Select Staging and confirm to try a live staging order. Let's Encrypt rate limitsโ
Run these commands in a new working directory.
mkdir lego-certgen
cd lego-certgen
wget -O domains.yaml https://raw.githubusercontent.com/ljgonzalez1/lego-cloudflare-ssl-certgen/master/template.domains.yaml
wget -O .env https://raw.githubusercontent.com/ljgonzalez1/lego-cloudflare-ssl-certgen/master/template.env
chmod 600 .env
mkdir -p ssl-certs
Create a Cloudflare token with Zone DNS Edit and Zone Read for the zones you use. Fill in EMAIL and CLOUDFLARE_API_TOKEN in .env. Set ACCEPT_LEGO_TOS=true after reviewing the Let's Encrypt Terms of Serviceโ .
Replace the contents of domains.yaml with your own names. Keep wildcards quoted.
website:
- example.com
- www.example.com
- "*.example.com"
docker run --rm -it --env-file .env \
-v "$PWD/domains.yaml:/app/domains.yaml:ro" \
-v "$PWD/ssl-certs:/ssl-certs" \
ljgonzalez/lego-cloudflare-certgen:latest
Add --dry-run to preview the request. When staging works, choose Production and confirm it for trusted certificates. The files are saved under ssl-certs/. For a pinned deployment, replace latest with a version tag from the table below.
โ The live view reports definitive errors such as an invalid token, missing zone access or a rate limit. The failed group ends early and the other groups still run. Each certificate allows up to 100 names and has its own deadline of at most two hours. The run ends with the issued and failed counts.
The current image supports ARMv6, ARMv7, ARM64, i386, and AMD64. Docker selects the platform when it pulls the image.
Content type
Image
Digest
sha256:681048678โฆ
Size
21.8 MB
Last updated
about 4 hours ago
docker pull ljgonzalez/lego-cloudflare-certgen