Install FREE SSL using Let’s Encrypt with Apache on Ubuntu 20.04. Learn how to install and configure Let’s Encrypt SSL using Certbot on Ubuntu.
This guide is tested on Google Cloud Platform and it will work fine on AWS, Azure or any VPS or Dedicated servers.
- Compute Engine setup, Setting up Compute Engine Instance with Ubuntu 20.04.
- Setup Google Cloud DNS for your Domain name.
- Configure Apache Virtual host for your domain name.
Make sure you have your
A record pointed to your VM instance’s external IP address and a
CNAME created for your domain name.
Install Certbot for Apache
In Ubuntu 20.04 LTS Certbot is already added in the Ubuntus default repository. So you can install it directly using the following command.
sudo apt install python3-certbot-apache -y
This command installs Certbot command line tool to deploy Let’s Encrypt Certificate automatically.
Install Let’s Encrypt SSL and configure HTTPS redirects
Once you have installed Certbot you can use the certbot command to install your certificate.
We will also pass some optional arguments to install SSL using a single command without any prompts.
sudo certbot --apache --agree-tos --no-eff-email --redirect -m EMAIL -d DOMAIN_NAME -d www.DOMAIN_NAME
The details of the options we use.
- –apache: This option chooses the Apache plugin to install and configure SSL.
- –agree-tos: This option automatically agrees to the Let’s Encrypt terms and conditions.
- –no-eff-email: This option set up not to share your e-mail address with EFF.
- –redirect: This option tells to configure redirect to HTTPS in your Apache virtual host.
- -m: Email to be used for registration and recovery contact.
- -d: Comma-separated list of domains to obtain a certificate
Configure Auto Renewal
Now it’s time to configure auto-renewal of SSL certificate. This will setup a cronjob to automatically renew your SSL before it gets rexpired.
Execute the following command to renew SSL automatically.
sudo certbot renew --dry-run
That’s all. Now you have your SSL installed successfully.
Get your Professional Google Cloud Architect certificate with this easy to learn course now.
Now you have learned how to install and configure free Let’s Encrypt SSL with Apache on Ubuntu 20.04.
Thanks for your time. If you face any problem or any feedback, please leave a comment below.