How to add SSL certificate to AWS EC2 with the help of new AWS Certificate Manager service
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
The AWS Certificate Manager (ACM) makes it straightforward to provision, manage, and deploy Secure Sockets Layer/Transport Layer Security (SSL/TLS) certificates on AWS services. This service facilitates the task by automating some of the more complex aspects of manual certificate SSL certificate management. In this article, we'll go through the steps needed to add an SSL certificate to an AWS EC2 instance leveraging the AWS Certificate Manager.
Step 1: Prerequisites
Before delving into the process of adding an SSL certificate using AWS Certificate Manager, ensure you meet the following prerequisites:
- AWS Account: You need an active AWS account with the authorization to interact with AWS Certificate Manager and other AWS services.
- Domain Name: The domain for which you want to issue the SSL certificate must be registered.
- AWS CLI: Having the AWS Command Line Interface installed and configured can be incredibly beneficial for managing services.
Step 2: Request an SSL Certificate
AWS ACM supports both public and private certificates. To request a certificate via AWS ACM, follow these steps:
Requesting a Public Certificate
- Navigate to ACM Console:
- Visit the AWS Management Console.
- Access the AWS Certificate Manager through the console search bar or via services.
- Request Certificate:
- Select Request a Certificate.
- Choose Request a public certificate and click "Next".
- Add Domain Names:
- Enter the fully qualified domain name (FQDN), for example,
www.example.com. You can add multiple domain names to the certificate if needed.
- Validation Method:
- Choose from either DNS validation or Email validation. DNS validation is typically quicker and more reliable for automatic renewals.
- Add Tags:
- Optionally, add tags for better resource management and tracking.
- Review:
- Review the entries and, if everything looks good, click Confirm and request.
Validation
- If you chose DNS validation, you'll need to add a CNAME record to your DNS configuration as instructed.
- If you opted for Email validation, ACM will send an email to the domain owner that has to be confirmed.
Step 3: Install the Certificate on your EC2 Instance
With the certificate issued and validated, it's time to install it on your EC2 instance. Follow these steps:
- Load Balancer (recommended):
- Using an AWS Elastic Load Balancer (ELB) allows the SSL certificate to be more easily managed.
- Navigate to AWS EC2 Console: Go to EC2 Dashboard and choose Load Balancers.
- Create/Select a Load Balancer: If you have an existing one, skip this step. Otherwise, create a new load balancer.
- Configure Listener: Specify HTTPS as a protocol and associate the created SSL certificate from ACM.
- Direct Installation to EC2 (if not using ELB):
- SSH into your EC2 instance.
- Install necessary packages: Generally, tools like
certbotfor Let's Encrypt, or install an application likeApacheorNginxif not already installed. - Configure your webserver to use the certificate:
- Locate the certificate and private key files stored by ACM.
- Assign these in your webserver's configuration file (for example:
/etc/httpd/conf.d/ssl.conffor Apache or/etc/nginx/nginx.conffor Nginx).
- Verify SSL on the Website:
- Use well-known tools like SSL Labs' SSL Test or command-line utilities like
curlto verify correct SSL setup. - Check for valid certificate installation and encryption standards.
Step 4: Automate the Renewal Process
One of the significant advantages of using ACM is automation in certificate renewal. AWS ACM automatically renews certificates that are associated with services like AWS Elastic Load Balancing, Amazon CloudFront, and more.
To ensure seamless renewal, verify that:
- The DNS validation record remains unchanged.
- The domain ownership is properly maintained.
Additional Considerations
- Cost: AWS does not charge you for public SSL certificates managed with AWS ACM.
- Security: Regularly update and patch your EC2 instance and security groups to bolster security against threats.
- Cross-Region Certificate Use: ACM certificates are regional. They need to be issued specifically in the region of your service deployment.
Summary Table
| Step | Task | Important Points |
| 1 | Prerequisites | AWS Account required Domain Name ready |
| 2 | Request Certificate | Choose DNS validation for easier management Review details before submission |
| 3 | Install on EC2 | Use Load Balancer for easy management Configure SSL on webserver directly if required |
| 4 | Automate Renewal | ACM handles automatic renewals Maintain domain ownership for DNS validation |
By following these steps and keeping in mind the best practices shared, you can securely manage SSL certificates on AWS with minimal overhead, ensuring a secure connection for your users.
Related reading
- How to allow a Kubernetes Job access to a file on host
- How to allow my user to reset their password on Cognito User Pools?
- How to append a value to list attribute on AWS DynamoDB?
- How to append a value to list attribute on AWS DynamoDB?
- How to add users to Docker container?
- How to allow a User only access their own data in Spring Boot / Spring Security?
- How to assign a public IP to container running in AWS ECS cluster in EC2 mode
- How to assign AWS IAM Role to Service Account with Terraform?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.