Posted By Shahid Malla

Install Free SSL on AWS Server - Shahid Malla - WHMCS Expert Freelancer

Installing a free SSL certificate from Let’s Encrypt on an AWS EC2 instance involves a series of steps. Below is a guide to help you through the process:


  1. Domain Name: Ensure you have a registered domain name pointing to your AWS EC2 instance.
  2. Access to EC2 Instance: Make sure you can SSH into your EC2 instance.

Step 1: Connect to Your EC2 Instance

Using the terminal or an SSH client, connect to your EC2 instance:

ssh -i your-key.pem ec2-user@your-instance-ip

Step 2: Install Certbot

  1. Update your package manager: sudo yum update
  2. Install Certbot: sudo yum install certbot

Step 3: Obtain SSL Certificate

Run Certbot to obtain and install the SSL certificate. Replace with your actual domain.

For Apache:

sudo certbot --apache -d

For Nginx:

sudo certbot --nginx -d

Certbot will prompt you for some information, including your email address and agreeing to the terms of service.

Step 4: Configure SSL Certificate Renewal

Let’s Encrypt certificates expire after 90 days, so it’s crucial to set up automatic renewal.

  1. Open the crontab editor: sudo crontab -e
  2. Add the following line to run Certbot twice daily: 0 */12 * * * certbot renew Save and exit the editor.

Step 5: Test SSL Configuration

Test your SSL configuration to ensure everything is set up correctly.

For Apache:

sudo apachectl configtest
sudo systemctl restart apache2

For Nginx:

sudo nginx -t
sudo systemctl restart nginx

Step 6: Configure Security Groups (AWS Firewall)

Ensure that your AWS Security Groups allow traffic on ports 80 (HTTP) and 443 (HTTPS).

Step 7: Update Website Configuration

If you haven’t already, update your website configuration to use HTTPS. For Apache, modify your VirtualHost configuration; for Nginx, update the server block.


Congratulations! You’ve successfully installed a Let’s Encrypt SSL certificate on your AWS EC2 instance. Your website should now be accessible over HTTPS, providing a secure connection for your users.

Remember to regularly check the certificate status and renew it before expiration. You can also automate this process further by configuring Certbot with a web server plugin and setting up a renewal script.

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x