How to Set Up Let's Encrypt SSL on Ubuntu 20.04 (Apache)

Let’s Encrypt is a free, automated, and open Certificate Authority (CA) that provides SSL certificates to enable HTTPS on websites. This guide explains how to install and configure Let’s Encrypt SSL on an Apache web server running on Ubuntu 20.04.

Prerequisites

  • A server running Ubuntu 20.04
  • A domain name pointed to your server (e.g., cms.domainhere.info)
  • Apache installed and running
  • Root or sudo access

Update the System

Update package lists and upgrade existing packages.

sudo apt update -y && sudo apt upgrade -y

Install Apache Web Server

If Apache is not already installed, run:

sudo apt install apache2 -y

Start and enable Apache:

sudo systemctl start apache2
sudo systemctl enable apache2

Allow HTTPS Through Firewall (UFW)

If you're using UFW (Uncomplicated Firewall), allow HTTPS traffic:

sudo ufw allow 'Apache Full'
sudo ufw delete allow 'Apache'

Install Certbot and Apache Plugin

Install Certbot and the Apache plugin:

sudo apt install certbot python3-certbot-apache -y

Obtain an SSL Certificate from Let’s Encrypt

Replace cms.domainhere.info with your actual domain name.

sudo certbot --apache -d cms.domainhere.info

To include both root and www subdomain:

sudo certbot --apache -d cms.domainhere.info -d www.cms.domainhere.info

Certbot will:

  • Obtain and install the certificate
  • Automatically edit Apache config
  • Optionally redirect HTTP to HTTPS

Follow the on-screen prompts to complete setup.

Test Automatic Renewal

Let’s Encrypt certificates are valid for 90 days. Certbot sets up a cron job or systemd timer for auto-renewal.

Test renewal process:

sudo certbot renew --dry-run

Verify SSL

Open your browser and visit:

https://cms.domainhere.info

Make sure the browser shows a secure connection with a padlock icon.

Check Certificate Details

View installed certificates:

sudo certbot certificates

Manually Renew Certificates

While auto-renewal is enabled, you can manually renew if needed:

sudo certbot renew

Let’s Encrypt SSL is now installed and active on your Apache web server running Ubuntu 20.04. Your website is now accessible via HTTPS with a valid SSL certificate.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS