Skip to content

Instantly share code, notes, and snippets.

Last active March 1, 2018 17:42
What would you like to do?
Issue and automate renewal of SSL certificates with Let's Encrypt using Certbot

Install Certbot and register Let's Encrypt account:

add-apt-repository ppa:certbot/certbot
apt update
apt install certbot
certbot register

Issue new SSL certificates for each host:

certbot certonly --webroot -w /var/www/ -d -d

Add a new Cron entry for renewals:

@daily certbot renew --post-hook "nginx -s reload" 2>> /var/log/certbot.log

certbot renew references all pre-obtained certificates and will skip any with more than 30 days remaining before expiry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment