Last active 6 months ago

.env Raw
1ACME_EMAIL="alais@example.org"
2PORKBUN_API_KEY="pk1_000000000000000000000000000000000000000000000000000000"
3PORKBUN_API_SECRET="sk1_000000000000000000000000000000000000000000000000000000"
4DOMAIN="example.org"
5
_README.md Raw

On your server, create a folder and add the two files below that are attached to this Gist:

mkdir ~/certbot-porkbun-dns
cd ~/certbot-porkbun-dns

Pull image:

docker compose pull

Set a domain in .env that you'll want to generate a certificate for, then run:

docker compose up

Wait a minute and it should generate.

Use the provided fullchain.pem and privkey.pem files that are generated.

docker-compose.yml Raw
1services:
2 certbot_dns_porkbun:
3 image: infinityofspace/certbot_dns_porkbun:latest
4 command: certonly --non-interactive --agree-tos --email ${ACME_EMAIL}
5 --preferred-challenges dns --authenticator dns-porkbun
6 --dns-porkbun-key ${PORKBUN_API_KEY} --dns-porkbun-secret
7 ${PORKBUN_API_SECRET} --dns-porkbun-propagation-seconds 60 -d
8 "${DOMAIN}"
9 volumes:
10 - /etc/letsencrypt:/etc/letsencrypt
11 - /var/log/letsencrypt:/var/log/letsencrypt