Skip to main content
Switch to Dark
📝 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...

2 min

Read time

298

Words

Mar 23, 2025

Published

Engr Mejba Ahmed

Written by

Engr Mejba Ahmed

Share Article

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.

Related Topics

Engr Mejba Ahmed

About the Author

Engr Mejba Ahmed

Engr. Mejba Ahmed builds AI-powered applications and secure cloud systems for businesses worldwide. With 10+ years shipping production software in Laravel, Python, and AWS, he's helped companies automate workflows, reduce infrastructure costs, and scale without security headaches. He writes about practical AI integration, cloud architecture, and developer productivity.

Continue Learning

Related Articles

Browse All