Last active
January 25, 2018 17:06
-
-
Save matinrco/64e015ca6c314c192366b9d7c102105b to your computer and use it in GitHub Desktop.
Let’s Encrypt - issue certificates with certbot-auto and renew how to
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#this file is not ready for execution | |
#go to /opt to download certbot-auto | |
cd /opt | |
wget https://dl.eff.org/certbot-auto | |
#correct permissions | |
chmod a+x certbot-auto | |
#stop nginx or other webserver temporary to free 443 port | |
service nginx stop | |
#issue a certificate from CA | |
/opt/certbot-auto certonly -n --standalone -d test.example.com -m me@example.com --agree-tos | |
#to renew all certificates (optional --force-renewal) | |
/opt/certbot-auto renew --quiet --no-self-upgrade --force-renewal --pre-hook 'service nginx stop' --post-hook 'service nginx start && service postfix reload && service dovecot reload' | |
#to manually renew | |
/opt/certbot-auto renew | |
#to list all certificates | |
/opt/certbot-auto certificates | |
#add it as cron job in /etc/cron.d/letsencrypt with following content | |
0 */12 * * * root /opt/certbot-auto renew --quiet --no-self-upgrade --force-renewal --pre-hook 'service nginx stop' --post-hook 'service nginx start && service postfix reload && service dovecot reload' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment