episyche logo

Episyche

Nginx/SSL/

How to install free SSL certificate on Nginx web server

Published on

How to install free SSL certificate on Nginx web server
When a secure data is transmitted on a unencrypted method it is easily vulnerable to hackers. So we need a secure way to transmit data between client browser and server. Using the HTTPS protocol along with the SSL  certificate we can transmit data in a encrypted way.

Introduction:

When you’re sending data through a web application/website if the transaction is not encrypted anyone with enough technical knowledge can interpret the transaction and steal any confidential information in it.

To address this problem with web technologies a new version of the HTTP protocol was introduced. It was called HTTPS ( Hypertext Transfer Protocol Secure). Any service using this protocol can encrypt its data end to end.

But to encrypt the data we need to buy an SSL certificate from a private organisation. There are a few open-source organisations that provide free SSL certificates one of them is Lets Encrypt. In this tutorial, we are going to use the Let’s encrypt service to install a free SSL certificate.

Flow Diagram:

 

flow-diagram

Prerequisites:

  • Ubuntu server with Nginx setup

  • Domain configure with Nginx as the default site or virtual host

  • Map ubuntu server public IP to domain name DNS

Steps:

Step 1: Install snapd

  • Update ubuntu apt repository list

1sudo apt update
  • Install snapd

1sudo apt install snapd -y 2sudo snap install core; 3sudo snap refresh core

 

Step 2: Install Certbot

  • install certbot using snap

1sudo snap install --classic certbot
  • Prepare the Certbot command

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

 

Step 3: Install SSL Certificate for Nginx

<email_id> = your email which associate with the SSL Certificate

<domain_name> = Respective domain name to install SSL Certificate ( eg: episyche.com )

1sudo certbot --nginx --non-interactive --keep-until-expiring --renew-with-new-domains --agree-tos --email <email_id> --no-eff-email --domains "<domain_name>"

 

Result:

Visit your domain with a browser, now you see an additional lock symbol at the address bar and HTTPS protocol added to your domain name.

An example output screenshot is given below:


no-image

Comments