Skip to main content
Cloud & DevOps (AWS)

How to Install SSL Certificate on Amazon Linux 2023 with Apache | Step-by-Step Guide

Securing your website with SSL (Secure Sockets Layer) is critical for protecting user data, boosting SEO rankings, and improving user trust. This guid...

Engr Mejba Ahmed
Author
Engr Mejba Ahmed
Published
Mar 23, 2025
Reading time
2 min · 298 words
How to Install SSL Certificate on Amazon Linux 2023 with Apache | Step-by-Step Guide
Featured image for How to Install SSL Certificate on Amazon Linux 2023 with Apache | Step-by-Step Guide

Securing your website with SSL (Secure Sockets Layer) is critical for protecting user data, boosting SEO rankings, and improving user trust. This guide will walk you through the complete setup process of installing an SSL certificate on an Amazon Linux 2023 instance running Apache.

What You'll Need:

  • Amazon Linux 2023 EC2 instance
  • Domain name pointed to your EC2 instance
  • AWS CLI installed on your local machine
  • SSH access to your EC2 instance

Step 1: Connect to Your EC2 Instance

Log into your EC2 instance via SSH:

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

Step 2: Update Your Server and Install Apache

sudo dnf update -y
sudo dnf install httpd -y
sudo systemctl start httpd
sudo systemctl enable httpd

Verify Apache is running by accessing your EC2 instance IP in your browser:

http://your-ec2-instance-public-ip

Step 3: Install Certbot for SSL

Certbot simplifies SSL certificate installation and renewal:

sudo dnf install epel-release -y
sudo dnf install certbot python3-certbot-apache -y

Step 4: Obtain and Install SSL Certificate

Replace example.com with your actual domain:

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

Follow the interactive prompts to complete the installation.


Step 5: Verify Your SSL Certificate Installation

Visit your website using HTTPS:

https://example.com

A padlock icon should appear, indicating the SSL certificate is successfully installed.


Step 6: Automate SSL Certificate Renewal

Certbot can renew certificates automatically:

Test auto-renewal:

sudo certbot renew --dry-run

If successful, Certbot will automatically renew your certificates before they expire.


If you are using firewalld, allow HTTP and HTTPS traffic:

sudo firewall-cmd --add-service=http --permanent
sudo firewall-cmd --add-service=https --permanent
sudo firewall-cmd --reload

Conclusion

Congratulations! You've successfully installed an SSL certificate on your Amazon Linux 2023 server running Apache. Your website is now secure, trusted by browsers, and better positioned for search engine optimization.

Engr Mejba Ahmed

About the author

Engr Mejba Ahmed

I'm Engr. Mejba Ahmed, a Software Engineer, Cybersecurity Engineer, and Cloud DevOps Engineer specializing in Laravel, Python, WordPress, cybersecurity, and cloud infrastructure. Passionate about innovation, AI, and automation.

Tags

Keep reading

Browse the blog →