Error on install SSL in EC2 with Let's Encrypt

1k views Asked by At

I'm pretty new on aws ec2, I'm trying to get a free ssl with Let's Encrypt. I've watched a video in youtube to learn it, but I have a problem, my terminal says sudo: add-apt-repository: command not found, always when I type the command add-apt-repository ppa:certbot/certbot I'm using Amazon Linux AMI 2018.03.0 (HVM), is it the problem? If it is the problem, how can I fix it? Which command I need to use to install?

1

There are 1 answers

1
Sergey Kovalev On BEST ANSWER

apt is the package manager for Debian-based Linux distros. Amazon Linux is CentOS/RHEL-based distro, it uses yum as package manager.

To install Let's Encrypt SSL certificate on Amazon Linux you can follow the step-by-step tutorial by AWS: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SSL-on-amazon-linux-2.html#letsencrypt

You will have to import EPEL repository from Fedora (instead of PPA), then install Certbot from Let's Encrypt and issue an SSL certificate using Certbot.

Minimal command set for Amazon Linux:

sudo wget -r --no-parent -A 'epel-release-*.rpm' http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/
sudo rpm -Uvh dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-*.rpm
sudo yum-config-manager --enable epel*
sudo yum install -y certbot python2-certbot-apache
sudo certbot