Skip to content

Instantly share code, notes, and snippets.

@etowett
Last active July 3, 2017 14:29
Show Gist options
  • Save etowett/6f47dfae56f47192ed3cc01b0a593f61 to your computer and use it in GitHub Desktop.
Save etowett/6f47dfae56f47192ed3cc01b0a593f61 to your computer and use it in GitHub Desktop.
Commands to create letsencrypt certs and autorenew when they expire
# Clone letsenrypt to /opt
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
# To Create Certs
sudo -H /opt/letsencrypt/letsencrypt-auto certonly --standalone -d site.com -d www.site.com
# To Renew
sudo -H /opt/letsencrypt/letsencrypt-auto certonly --standalone --renew-by-default -d site.com -d www.site.com
# To Autorenew
echo '@monthly root /opt/letsencrypt/letsencrypt-auto certonly --quiet --standalone --renew-by-default -d site.com -d www.site.com >> /var/log/letsencrypt/letsencrypt-auto-update.log' | sudo tee --append /etc/crontab
# Update Letsencrypt
cd /opt/letsencrypt && sudo git pull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment