I have an Amazon EC2 box. I have installed Apache, MariaDb and PHP on it.

Among other things, I want to host a couple of WordPress websites on the EC2.

How do I go about installing Certbot on Amazon Linux so that I may issue SSL certificates for the various websites hosted on Apache?

I cannot find Amazon Linux listed on Certbot's website, and I read somewhere that Amazon Linux is close to CentOS/RHEL 7 so I picked that and tried to follow the instructions, but I got to

sudo yum install certbot-apache

and it didn't work, I get:

Loaded plugins: langpacks, priorities, update-motd
No package certbot-apache available.
Error: Nothing to do

Any help would be greatly appreciated.

  • Based on what you wrote you might have missed the step to add the extra repositore Qoute from the link you posted: Certbot is packaged in EPEL (Extra Packages for Enterprise Linux). To use Certbot, you must first enable the EPEL repository. On RHEL or Oracle Linux, you must also enable the optional channel. the link itself : fedoraproject.org/wiki/… – Dennis Nolte Mar 21 '18 at 12:20
  • How can I check if the EPEL repository is enabled? Also, I think to add and enable another repo I do sudo yum-config-manager --enable name, is that right? – J86 Mar 21 '18 at 12:25

For EC2 running Amazon Linux 2 AMI:

Enable EPEL Repo:

sudo amazon-linux-extras install epel

Install Certbot:

sudo yum install certbot-apache

Follow the steps

  1. Adding the Epel Repostory sudo yum install epel-release

  2. Installing SSL module and the Certbot for Apache

sudo yum install mod_ssl python-certbot-apache

  1. Generating and issuing the certificate using the Certbot

sudo certbot --apache -d example.com -d www.example.com


Doing sudo yum install epel-release did not work for me. In fact, the whole epel.repo file was missing for me. According to Amazon's own documentation, it ought to be present in /etc/yum.repos.d/.

I Googled,and found this on GitHub. Following the steps outlined there, I got the epel.repo file, and then my original command to install Certbot worked.

sudo yum install certbot-apache
  • 1
    Warning: EPEL is not guaranteed to be compatible with Amazon Linux. This may eventually break, as it has for others, and probably at the most inopportune time. If you actually needed something from EPEL, consider not using Amazon Linux. – Michael Hampton Mar 21 '18 at 14:56
  • Thanks @MichaelHampton, how do folks on Amazon Linux get their SSL certificates for x number of sites running on Apache. Certbot makes this very easy! – J86 Mar 21 '18 at 16:28
  • There are almost no use cases where Amazon Linux is your best choice of distribution. There might actually not be any at all. I certainly wouldn't run a web site on it. – Michael Hampton Mar 21 '18 at 18:39
  • @MichaelHampton elaborate please :) Why wouldn't you? And what would be your choice? – J86 Mar 21 '18 at 22:34

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.