Andre Nakkurt
Apr 25, 2018 · 1 min read

If anyone’s running Amazon Linux 2 on their EC2, then you can successfully follow above guide with the following edits:
After downloading Let’s Encrypt, and trying to run

$ /opt/letsencrypt/letsencrypt-auto --debug

you might get this output:
Sorry, I don't know how to bootstrap Certbot on your operating system!

It’ll work if you:
Step 1. Edit the file /opt/letsencrypt/certbot-auto to recognize your version of Linux:

  • $ sudo vim /opt/letsencrypt/certbot-auto
  • find this line in the file (likely near line nr 780):
    elif [ -f /etc/redhat-release ]; then
    and replace whole line with this:
elif [ -f /etc/redhat-release ] || grep 'cpe:.*:amazon_linux:2' /etc/os-release > /dev/null 2>&1; then
  • Save and exit vim (type :wq to do that)

Step 2. Run below to obtain your certificates:

$ sudo /opt/letsencrypt/certbot-auto certonly --webroot -w /var/www/html -d -d

/var/www/html is your webroot (default for Apache used here; modify if yours is different or you’re using a different server such as nginx) is your domain that lives in above webroot (you can also request a certificate for multiple domains if your EC2 runs subdomains or multiple domains)

Now continue Gifford’s guide from Certificate Renewal part onwards 👍 🎉

Source and credit: certbot GitHub issue #5455

Great guide, thanks for putting this together Gifford Nowland!
Let’s Encrypt and Certbot FTW!

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade