Skip to content

Instantly share code, notes, and snippets.

@musale
Forked from etowett/letsencrpt.sh
Last active July 3, 2017 14:59
Show Gist options
  • Save musale/98a89839d05ab8e23f4ac4ecec894590 to your computer and use it in GitHub Desktop.
Save musale/98a89839d05ab8e23f4ac4ecec894590 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