How To Install Let’s Encrypt SSL On Ubuntu 20.04

In this post, I will guide you on How To Install Let’s Encrypt SSL On Ubuntu 20.04. Get an SSL certificate for your domain with the Apache Web Server.

Most websites now support SSL (Secure Socket Layer). It encrypts the data transmitted between the web server and the browser and increases the security of the website.

In addition, the use of an SSL certificate is necessary because currently Google has prioritized ranking websites based on https protocol (HTTP + SSL), websites that only use http protocol will be considered as “unsafe” (not safe).

In this tutorial, I will use Certbot to get a free SSL certificate, make sure it is set up to renew automatically.

Introduction

Let’s Encrypt is a non-profit certificate authority run by the Internet Security Research Group (ISRG). It is the world’s largest certificate authority, used by more than 265 million websites, with the goal of all websites being secure and using HTTPS.

Certbot is a free, open-source software tool for automatically using Let’s Encrypt certificates on manually-administrated websites to enable HTTPS.

Steps To Install Let’s Encrypt SSL On Ubuntu 20.04 with Certbot

1. Connect to your server

First, you need to connect to your server via SSH as the root user by command:

ssh root@<your-ip-address> -p <your-port-number>

2. Install snapd

You need to install snapd and it can be installed from the command line:

sudo apt update
sudo apt install snapd

Test your system:

sudo snap install hello-world
Output:
hello-world 6.4 from Canonical✓ installed
hello-world
Output:
Hello World!

Snap is now installed and ready to go!

3. Install lastes version of snapd

Execute the following command to ensure that you have the latest version of snapd.

sudo snap install core; sudo snap refresh core

4. Remove certbot-auto and packages.

Remove Certbot packages by running the command of your OS package manager.

sudo apt-get remove certbot

If you previously used Certbot through the certbot-auto script, you should also remove its installation by following the command:

sudo sed -i '/certbot-auto/d' /etc/crontab
sudo rm /usr/local/bin/certbot-auto
sudo rm -rf /opt/eff.org

5. Install Certbot

To install classic Certbot, run the command:

sudo snap install --classic certbot

6. Prepare the Certbot command

Execute the following command line to ensure that the certbot command can be run.

sudo ln -s /snap/bin/certbot /usr/bin/certbot

7. Obtain an SSL Certificate

Get a certificate and have Certbot edit your Apache configuration automatically to serve it.

sudo certbot --apache

Or, just get a certificate.

sudo certbot certonly --apache

8. Test Certbot Auto-Renewal

You can test automatic renewal for your certificates by running this command:

sudo certbot renew --dry-run

The command to renew certbot is installed in one of the following locations:

/etc/crontab/
/etc/cron.*/*
systemctl list-timers

9. Confirm that Certbot worked

To confirm that your site is set up properly, visit your site with link: https://yourwebsite.com/ in your browser and look for the lock icon in the URL bar.

Confirm that Certbot worked

This is the end of the post.

Follow us for the more helpful posts!

We hope this is a useful post for you How To Configure Credit Memo Comments In Magento 2.

Thank you for reading!

5 2 votes
Article Rating

Aaron LX

Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.

Leave a Reply or put your Question here

1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Zekaria mohammed
Zekaria mohammed
April 6, 2022 10:01 am

I have this error “The apache plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError(‘Cannot find Apache executable apache2ctl’)”
when i run this command
sudo certbot –apache

1
0
Would love your thoughts, please comment.x
()
x