As a sequel to the previous topic where we saw how to install Certbot on Amazon Linux 2, here I’m going to show you how to secure your domain with a free Let’s Encrypt SSL certificate and make your domain greeny. I will show you two scenarios depending on your web server.
Prerequisites
- AWS access
- Amazon Linux 2 EC2 instance
- Certbot installed
Obtain Nginx based Let’s Encrypt SSL Certificate
Step 1. Make sure that your domain is correctly pointed to your Amazon Linux 2 EC2 instance. To easily check it, you can use an online dns tool.
Step 2. To obtain Nginx based Let’s Encrypt SSL Certificate, run:
sudo certbot --nginx -d domain.com -d www.domain.com
Step 3. It will ask you several questions whether you want an HTTPS redirect or not, but at the end, you should see the following message:
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
...
Obtain Apache based Let’s Encrypt SSL Certificate
To obtain Apache based Let’s Encrypt SSL Certificate, run:
sudo certbot --apache -d domain.com -d www.domain.com
And you should get the same message as from step 3 above.
Conclusion
If you are not familiar with the DNS checking tool or how to generate the Let’s Encrypt certificate with Certbot don’t hesitate to put a comment below. Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.