Install Let’s Encrypt on Ubuntu 20.04
In this tutorial, we will learn how to Setup SSL Certificate for Apache on Ubuntu 20.04.
Let’s Encrypt is a Certificate Authority (CA), it provides a free valid SSL certificate. To get a free SSL certificate we have to use Certbot Client which fetches and deploys the SSL certificate on our Server.
Before we begin
Always remember that the Let’s Encrypt certificate can only be requested from the server on which the Domain is pointing. Let’s Encrypt checks the Domain is pointing on the same server or not, if the Domain is successfully pointing to the same server then it will install the certificate on the server.
- Access of Root User or the access of Another User with sudo privileges.
- Make sure the Domain is pointing on the same server.
- Ubuntu 20.04 must be installed on the server.
Install the Certbot Client
To install the SSL certificate on the server follow the below steps.
- Add the PPA repository on the server to download and install the Certbot Client. If your Linux system already have this repository then it shows some error.
sudo add-apt-repository ppa:certbot/certbot
- Update the server.
sudo apt update
- Install the Cerbot Client
sudo apt install certbot
- Confirm the installation.
Setting up Let’s Encrypt SSL on Apache
- To set up the Let’s Encrypt SSL on Apache, we need to install the Certbot Plugin for Apache to make the process very easier.
sudo apt install python3-certbot-apache
- Before installing the SSL certificate Let’s Encrypt check the Ownership of the Domain that the Domain is hosting on the same server. After successful verification, Let’s Encrypt install the SSL certificate on the server.
In the below command replace the Linuxpanda with your Domain. Through the below command you can install the SSL certificate on both Domain and Domain with WWW.
Read Also: How to install Docker on Ubuntu 20.04?
sudo certbot --apache -d Linuxpanda.com -d www.Linuxpanda.com
Ato accept all the terms and condition.
N, if you did not want to share your Email address with any Organization.
- If you have multiple
vhostthen select the vhost file as per your Domain configuration. It means you have to select that file which have the Apache configuration for that particular Domain.
- If you want to redirect all the request on secure HTTPS then select the
2option, if you did not want to redirect then you can go with the
- Now you have successfully installed the Let’s Encrypt SSL certificate for the Domain.
- Restart apache2 service
systemctl restart apache2
In this tutorial, we have learned what is Let’s Encrypt SSL certificate is and how to install the SSL certificate on the server. SSL provides a secure connection for the client(browser) to send the request and receive the answer to the request from the server.
With the help of these steps, you can easily install the SSL certificate for the Domain.
If you guys have any queries related to this Setup Free SSL Certificate for Apache tutorial, Let me know in the comments.