How to Setup Nginx with Let's Encrypt on Ubuntu 20.04

How to Setup Nginx with Let's Encrypt on Ubuntu 20.04


  • Ubuntu 20.04 Server Installed with Nginx and Hosted Website

Install Certbot on Ubuntu

Certbot is an open-source tool that simplifies and automates the process of obtaining and renewing certificates from Let’s Encrypt. We are going to install Certbot by using the Snap deployment system. Snap is pre-installed on Ubuntu 20.04.

Update snapd

Run the following commands to update snapd.

$ sudo snap install core
$ sudo snap refresh core

Install certbot snap

Note: If you have previously installed Certbot by using the standard apt command, then run the following command first to remove it. This will ensure that the Certbot snap works correctly.

$ sudo apt-get remove certbot

$ sudo snap install --classic certbot
certbot 1.11.0 from Certbot Project (certbot-eff✓) installed

Enable certbot command

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

Obtain your Certificate

When you run the command below, certbot will guide you through the process. Certbot also updates your NGINX configuration automatically to activate HTTPS.

$ sudo certbot --nginx

Obtain a Certificate for a specific domain or subdomain

$ sudo certbot --nginx -d

Certificate Renewal Process

Certificates issued by Let’s Encrypt are valid for 90 days. During installation, certbot creates a scheduled task to automatically renew your certificates before they expire. As long as you do not change your web server configuration, you would not have to run certbot again.

Run the following command to test the automatic renewal process.

$ sudo certbot renew --dry-run



Related Posts

Tools for Analyzing Your Competition

Before knowing where your business stands, you should look at the market and your competition. You need to know what marketing tactics and strategies are working for your audience, what traffic the competition has, and how they position.

Free Online Photo Editor with Cool Effects | Edit Images Easily

Transform your images with our free online photo editor with cool effects. Add filters, adjust colors, and apply creative enhancements. Edit your photos easily and make them stand out.

How to find the size of a table in SQL?

Learn how to determine the size of a SQL table with this informative guide. Discover efficient methods for measuring table size.

MongoDB Query date by _id field

Query date by _id in mongodb. Straighforward guide to solve your issue right away.

Unleashing the Power of Free API for Scrape Reverse Geocoding

Learn how to harness the potential of reverse geocoding with our beginner's guide to scraping APIs for free. Unlock the power today.

Discover the Power of Whatsapp-web.js for Safe and Easy Automation

Automate WhatsApp with ease using Whatsapp-web.js, a NodeJS client library that connects through the official WhatsApp Web app, reducing ban risks. Perfect for user or business accounts.

Website tours js tools

Tools to create live tours for your web project using js libraries.

Unlocking SaaS Marketing Success: Essential Resources to Learn and Grow

Discover a comprehensive collection of valuable resources to master the art of SaaS marketing.

Where to launch your startup

Do you wanna launch grandiosely your startup? Get a list of platforms where people can discover your project and can push your project directly to the sky.

Email campaign improving my SaaS convertion - Manager Flota

Users subscribe to your SaaS, but don't let the money on your table. Here's how I do it!