Let’s encrypt provide valid and free ssl certificates. Let’s Encrypt has the capability to automate the SSL based virtual host deployment on an Nginx web server, and it also validates the domain name of the http based virtual host on the server if the http based virtual host is found. So then, Let’s encrypt the same HTTP virtual host and deploy a new SSL-based virtual host with the same configuration on an Nginx web server and later on we use this ssl certificate with reverse proxy, nodeJS application, HA-Proxy Load balancer etc.
In this post, We will optain and configure the Let’s Encrypt SSL certificate for any public domain with few commands.
Step 1: Do Nslookup
You must validate whether your domain points to your public IP address or not, as well as whether you are the owner of the domain, Execute the given command for the same.
If you have a sub-domain, you must also use nslookup to look up the sub-domain, like www.example.com or blog.example.com.
If you can see your public IP address, we can proceed with the next steps.
Step 2: Install Certbot
We need to update the current repository and install the certbot and python3-certbot by following the given command.
sudo apt-get update && sudo apt-get install certbot python3-certbot-nginx -y
Step 3: Obtaining an SSL Certificate
We are good to obtain the Let’s encrypt valid SSL certificate by execueting given command, You need to execute the command with your domain and sub-domain named that Public IP is pointing your server.
sudo certbot --nginx -d example.com -d www.example.com
You need to accept the agreement and do the following things, step by step:
- Email Address
- Terms and conditions
- News letter subscription
- Activate HTTPS – like https://example.com or https://www.example.com
You should receive a success message, and you should also see the certification path on your machine.
We have successfully installed Let’s encrypt SSL certificate with nginx web server on ubuntu 22.04 LTS, If you still have questions, please post them in the comments section below.