How To

Let’s Encrypt SSL: Secure Nginx on Ubuntu Fast

Let’s Encrypt SSL has become the preferred solution for website owners who want to protect user data without paying for commercial certificates. By enabling HTTPS on your Nginx server, you can encrypt traffic, improve trust, and meet modern web security standards.

In this guide, you’ll learn how to install Let’s Encrypt SSL on Ubuntu 20.04, configure Nginx for secure connections, and automate certificate renewals to keep your website protected.

Why Use Let’s Encrypt SSL?

Web browsers now expect websites to use HTTPS. Without encryption, sensitive information such as login credentials, contact forms, and payment details can be intercepted during transmission.

Let’s Encrypt offers free, trusted SSL/TLS certificates recognized by all major browsers. In addition to improving security, HTTPS can enhance search engine rankings and increase visitor confidence.

Before proceeding, ensure that:

  • Your domain points to the server’s public IP address.
  • Nginx is already installed and running.
  • Ports 80 (HTTP) and 443 (HTTPS) are open in your firewall.

Install Let’s Encrypt SSL Tools

The easiest way to manage certificates on Ubuntu is with Certbot, an automated utility designed to obtain and renew SSL certificates.

Update your package list and install Certbot:

sudo apt updatesudo apt install certbot

Once installed, Certbot can handle certificate issuance and future renewals with minimal manual intervention.

Strengthen Security with DH Parameters

For enhanced encryption, it’s recommended to generate Diffie-Hellman parameters. These improve the security of key exchanges during SSL/TLS connections.

Run the following command:

sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048

Although larger key sizes are available, 2048-bit parameters provide a strong balance between security and performance.

Configure Let’s Encrypt SSL for Nginx

Before requesting certificates, create a validation directory that allows Let’s Encrypt servers to verify domain ownership.

Configure Nginx to serve verification files from a dedicated location. This setup simplifies certificate management and keeps configurations organized.

Next, request certificates using Certbot’s webroot method:

sudo certbot certonly \--agree-tos \--email admin@example.com \--webroot \-w /var/lib/letsencrypt/ \-d example.com \-d www.example.com

After successful validation, Certbot stores the certificate files in the /etc/letsencrypt/ directory.

Enable HTTPS and HTTP/2

Once certificates are available, update your Nginx virtual host configuration to use them.

A secure setup should include:

  • HTTPS redirection from HTTP
  • SSL certificate and private key paths
  • HTTP/2 support
  • Modern TLS protocols
  • Security headers such as HSTS

After editing the configuration, reload Nginx:

sudo systemctl reload nginx

Your website should now load securely through HTTPS, displaying the familiar padlock icon in web browsers.

Automate Let’s Encrypt SSL Renewal

Certificates issued by Let’s Encrypt remain valid for 90 days. Fortunately, Certbot can renew them automatically.

To verify automatic renewal functionality, perform a dry run:

sudo certbot renew --dry-run

If no errors appear, your renewal process is configured correctly.

You can also configure a deployment hook to automatically reload Nginx whenever certificates are renewed, ensuring updates take effect immediately.

Benefits of Using HTTPS on Nginx

Implementing SSL certificates offers several advantages:

  • Encrypts website traffic
  • Protects user credentials
  • Improves SEO performance
  • Increases visitor trust
  • Supports modern browser requirements
  • Enables secure HTTP/2 communication

These benefits make SSL an essential component of any production website.

Conclusion

Deploying Let’s Encrypt SSL on Ubuntu with Nginx is one of the most effective ways to improve website security. With free certificates, automated renewals, and strong encryption, Let’s Encrypt SSL helps protect visitors while ensuring your site meets modern web standards. Once configured, your Nginx server will deliver secure HTTPS connections with minimal ongoing maintenance.

Cyber Defence

Recent Posts

Install PHP on Ubuntu 26.04: Apache, Nginx, and Multiple Versions

PHP 8.5 is included in Ubuntu 26.04's default repositories and is the recommended version for…

12 hours ago

Upgrade to Ubuntu 26.04 from 25.10 and 24.04 LTS: Complete Guide

Ubuntu 26.04 LTS "Resolute Raccoon" arrived on April 23, 2026 with Linux kernel 7.0, GNOME 50,…

12 hours ago

Install Kubernetes on Ubuntu 26.04 with kubeadm and containerd

Kubernetes is the standard platform for running containerized workloads across multiple servers with self-healing, rolling…

13 hours ago

Install Ubuntu 26.04: Bootable USB, Partitioning, and First Steps

Ubuntu 26.04 LTS "Resolute Raccoon" was released on April 23, 2026 with Linux kernel 7.0, GNOME desktop, and standard security support until April 2031. A clean install gives you a known-good starting point on new hardware, when replacing another operating system, or when an upgrade path is not practical. This guide walks through how to install Ubuntu 26.04: downloading and verifying the ISO, writing a bootable USB drive, completing the installer, and doing the initial setup after the first boot. Before you start: You need a USB drive with at least 12 GB of free space. Back up any existing data on the target machine — the installer can erase the entire disk. Install Ubuntu 26.04: Download the ISO…

13 hours ago

Change Timezone on Ubuntu: timedatectl and Desktop GUI Guide

The correct timezone affects more than the clock on your screen. It drives cron job scheduling, systemd timer execution, log file timestamps, database record timing, and SSL certificate validity checks. A mismatched timezone can cause scheduled jobs to fire at the wrong hour and make log timestamps impossible to match with real-world events. This guide shows how to change timezone on Ubuntu using the timedatectl command (the recommended approach for servers and remote machines) and through the graphical Date & Time settings on desktop systems. The steps apply to all current Ubuntu releases including 24.04 and 26.04. <strong>Prerequisite:</strong>&nbsp;Only&nbsp;the&nbsp;root&nbsp;user&nbsp;or&nbsp;a&nbsp;user&nbsp;with&nbsp;sudo&nbsp;access&nbsp;can&nbsp;change&nbsp;the&nbsp;system&nbsp;timezone. Check the Current Timezone Before You Change It Run timedatectl with no arguments to see the active timezone and clock status: bashtimedatectl Sample output: Local…

13 hours ago

Install Atom on Ubuntu 18.04: GitHub’s Code Editor APT Setup

Atom is a free, open-source, cross-platform code editor developed by GitHub. Built on Electron, it uses…

1 day ago