Secure Web Server with SSL by Certbot: Step-by-Step Guide

Let's Encrypt

Getting Started

In my GCP VM Create blog, I created an instance and pointed a subdomain to it with CloudFlare DNS. But after pointing DNS to the VM, After that stared facing issues due to insecure communication between the CloudFlare and the VM. 

The VM is not having any certificate installed on it, and DNS is throwing error in handshake because of the SSL missing.


Above image references, the host machine have issue or DNS is not able to communicate with the Server.

So I decided to install a SSL on my newly created VM. Before installing I ensured my dns is pointing to that vm and dns is properly propagated. 

It's very important to check with some tool like whatsmydns or dnschecker, that dns is propagated properly or not. These tools gives a wide rang of options to check like A record, CNAME, MX, PTR, etc to check.

Finally I started my SSL install journey to fix the ssl handsheck issue.

Below are the listed steps I followed during the install of SSL

1. SSH the instance where you want to make such install:

2. You will need to add the Certbot PPA to your list of repositories. 

And then execute the below commands:

sudo apt-get update

sudo apt-get install software-properties-common

sudo add-apt-repository universe

sudo add-apt-repository ppa:certbot/certbot

sudo apt-get update



Run this command on the command line on the machine to install Certbot.

sudo apt-get install certbot python3-certbot-nginx

This command will install the certboat and NGINX plugin which manages the update and renewal of certificates when expiring. 
 

Choose how you like to run Certbot

Either get and install your certificates, with your web server like

sudo certbot --nginx

It will ask for some information about the email and domain name and will install automatically



Now you have installed the Certificate and see it.



Or, just get a certificate



sudo certbot certonly --nginx


Here only certificate will be generated and you need to manually configure the certificates in the web server...


:)

Secure Web Server with SSL by Certbot: Step-by-Step Guide
Ram Krishna July 12, 2022
Share this post
Our blogs
Sign in to leave a comment
Creating an Instance in Google Cloud Compute Engine: Step-by-Step Guide
GCP