Search This Blog

Labels

adobe (1) android (3) apache (3) aviation (1) bash (2) chrome (2) composer (1) cookery (3) dev (2) dodanperks (1) extensions (1) facebook (2) firefox (1) git (2) grafana (1) guzzle (1) headaches (12) htaccess (1) html5 (2) jquery (2) lamp (1) life hacks (10) linux (29) mysqli (2) native (1) opera (2) php (10) railfanning (1) reactjs (3) reactnative (1) servers (11) sinhala (1) smartphones (2) snap (1) sound (1) tech (22) troubleshoots (5) ubuntu (30) unicode (4) virtualbox (1) wamp (2) web (11) windows (4) wordpress (3) youtube (2) කෑම (3)

Monday, 8 November 2021

Create a Let's Encrypt SSL certificate for free using certbot on Ubuntu 20.04

When you don't have the luxury of having a vendor-provided SSL certificate on your server but the vendor somehow allows you to enter your own SSL certificate, this solution is for you.

If you are running a newer version of Ubuntu, you will have to use,

sudo apt-get install software-properties-common
If you are using an older version of Ubuntu, use
sudo apt-get install software-properties-common python-software-properties

Then add certbot PPA

sudo add-apt-repository ppa:certbot/certbot

Note: The PPA is deprecated. Instead, you can use Snap if you preffer.

Run update if not automatically performed.

sudo apt-get update

Then install certbot for apache, assuming you have Phython 3

sudo apt-get install python3-certbot-apache

If you have an earlier python version

sudo apt-get install python-certbot-apache

Then you can use certbot to issue an SSL certificate for your domain.

If you are running certbot on the server itself,

sudo certbot --apache -d example.com

If you are running certbot on your own computer rather than on a server, which is the main case we are discussing here. In this example we are using

http
verification method. You can use
dns
verification method instead of http as well.

sudo certbot certonly --manual --preferred-challenges http -d example.com -d www.example.com

Then you will have to follow the instructions on the CLI screen.

You will be instructed to create a file containing a string of characters on your server (usually in
.well-known/acme-challenge
folder)

Upon pressing the final
Enter
, it will verify the domain and show you the location (directory/folder) the keys were saved.

Now open your cPanel and find where to manage your SSL certificates and enter the keys one by one finding corresponding keys from the keys saved at the aforementioned location.

No comments:

Post a Comment