Install SSL Certificate on NGINX Web Server on Ubuntu

Install SSL Certificate on NGINX Web Server on Ubuntu

In this article, we will learn How to install SSL certificate on the NGINX Web Server?
To install the SSL certificate we will use Let's Encrypt. Following is the step to install Let's Encrypt.

Install Let's Encrypt Certbot

To install Let's Encrypt first execute the following command in terminal.

Code

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx 

Issue SSL certificates

Let's encrypt certbot installation is completed successfully. Next, we need to issue SSL certificate hosted on our server. To issue an SSL certificate execute the following command in the terminal.

Code

sudo certbot --nginx

Next, the certificate bot prompt for some prompts. The first prompt is for your email id. Enter your email id on which you want the certification alerts. The next prompt is for terms and condition. To agree with the terms and condition press "A" and hit enter. The next prompt is for sharing your email id. If you want to share your email id type "y" else "n". On the next prompt, we need to select the domains for which we need to install the SSL certificates. For us, we selected 1 and 2 for the domain mayanksanghvi.ooo and www.mayanksanghvi.ooo. Finally, the last prompt is for redirecting HTTP traffic to HTTPS. We selected yes. If you select yes, then the certbot add required lines in the configuration file to redirect HTTP traffic to HTTPS.

After completing the above command our certification, installation is completed successfully. 

Automating renewal
The Let's Encrypt Certbot packages to come with a cron job. It will renew your certificates automatically before they expire. Since Let's Encrypt certificates last for 90 days, it's highly advisable to take advantage of this feature. You can test automatic renewal for your certificates by running this command:

Code

sudo certbot renew --dry-run

We are done with the SSL Certificate installation. 
You may also like the following articles.

0 Comments
Leave A Comment

Please login to post your valuable comments.

Join the newsletter

Get the latest vLemonn news first

share