margherita pizza
margherita pizza

Reputation: 7185

Let's encrypt certbot on AWS Linux

I am new to AWS and Let's encrypt both. I follow and article and simpley run these commands

wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
sudo cp certbot-auto /usr/bin/

Then I run this command.

sudo /usr/bin/certbot-auto --nginx -d example.com -d www.example.com --debug

This gives me the error

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.

What does this really means?

How do I setup certbot on AWS linux?

Upvotes: 0

Views: 3734

Answers (3)

Erisan Olasheni
Erisan Olasheni

Reputation: 2905

  • Navigate to your home directory (/home/ec2-user).
  • Download EPEL using the following command. sudo wget -r --no-parent -A 'epel-release-*.rpm' https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/
  • Install the repository packages as shown in the following command. sudo rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-*.rpm
  • Enable EPEL as shown in the following command. sudo yum-config-manager --enable epel*
  • Confirm that EPEL is enabled with the following command. sudo yum repolist all

Install and run Certbot

This procedure is based on the EFF documentation for installing Certbot on Fedora and on RHEL 7. It describes the default use of Certbot, resulting in a certificate based on a 2048-bit RSA key.

sudo yum install -y certbot python2-certbot-apache or sudo yum install -y certbot python2-certbot-nginx For nginx.

Source here

Upvotes: 0

Arun Kamalanathan
Arun Kamalanathan

Reputation: 8603

I have created a fresh amazon linux 2 ec2 instance and tested the following for you.

The following steps are working for me.

Edit the file /usr/bin/certbot-auto to recognize your version of Linux:
$ sudo vim /usr/bin/certbot-auto
find this line in the file (likely near line nearr 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)

Reference: Deploying Let’s Encrypt on an Amazon Linux AMI EC2 Instance

Upvotes: 8

Yogeshwar Singh
Yogeshwar Singh

Reputation: 1425

Make sure that system requirements are met, you can find the system requirement here.

Also here are the best practices for certbot-auto deploment.

Upvotes: 0

Related Questions