Using the AWS amazon linux 2
template for your EC2 instance is always a preferred way as an AWS-optimized and proprietary template. So if your web application requires an SSL certificate you can use the AWS certificate manager or the easiest and the quickest method is to ssh into the instance and install certbot. Today I’m going to cover the installation of certbot on amazon linux 2.
Prerequisites
- AWS access
- Amazon Linux 2 EC2 instance
Install Certbot on Amazon Linux 2
Step 1. Update the system packages as a good practice.
sudo yum update
Step 2. Install the epel
repository.
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Step 3. Enable the epel
repo.
sudo yum-config-manager --enable epel
Step 4. Install Certbot and its dependencies which are related to the web server that you are using atm.
- For
Apache
, run:sudo yum install certbot python3-certbot-apache mod_ssl
- For
Nginx
, run:sudo yum install certbot python3-certbot-nginx
Step 5. To check the version and the installation as well, run:
certbot --version
Example output:
certbot 1.11.0
Conclusion
Feel free to leave a comment regarding some concerns about the certbot installation on amazon linux 2 and if you find this tutorial useful, follow our official channel on Telegram.