Skip to content

Instantly share code, notes, and snippets.

@HarshadRanganathan
Last active March 18, 2021 06:28
Show Gist options
  • Save HarshadRanganathan/9e6cf316239ccc9d8386999780c03ae4 to your computer and use it in GitHub Desktop.
Save HarshadRanganathan/9e6cf316239ccc9d8386999780c03ae4 to your computer and use it in GitHub Desktop.
Let's Encrypt SSL for Nginx in Amazon Linux AMI instance
# Install wget
yum install wget -y
# Install certbot-auto
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
# Obtain SSL certificate with Nginx plugin for the domain
sudo ./certbot-auto --nginx -d app.com --debug
# Test SSL configuration
https://www.ssllabs.com/ssltest/analyze.html?d=app.com
# Configure cron job for SSL auto-renewal
sudo crontab -e
# Add below lines in crontab to check for certificate renewals periodically
PATH = /home/ec2-user/:/usr/local/sbin:/usr/local/bin:/bin:/usr/sbin:/usr/bin
0 6 * * * certbot-auto renew --text >> /home/ec2-user/certbot-cron.log
@noodlebreak
Copy link

Getting this:

Sorry, I don't know how to bootstrap Certbot on your operating system!

You will need to install OS dependencies, configure virtualenv, and run pip install manually.
Please see https://letsencrypt.readthedocs.org/en/latest/contributing.html#prerequisites
for more info.

@RadoslawB
Copy link

Thanks! Works well.

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