How To Secure Apache with Let's Encrypt (Certbot) on Ubuntu 20.04

Louis SanchezAugust 15th 2021, 6:33

To access your instance using HTTPS through Apache, you need to follow these steps:

Step 1 : Install the Let's Encrypt client, certbot

sudo apt-get update
sudo apt install certbot python3-certbot-apache

Step 2 : Request a certificate from Let's Encrypt

sudo certbot --apache -d -d

Step 3 : Enter an email address

Step 4 : Press A and ENTER to agree to the Terms of Service

Step 5 : Press N and ENTER

Step 6 : Select your choice then ENTER. (Press 2 and ENTER to redirect all traffic to HTTPS)

Step 7 : You’re done!

Step 8 : You can now go to

Step 9 : Let's Encrypt's certificates are only valid for ninety days. Certbot will run twice a day and automatically renew any certificate that’s within thirty days of expiration. To test the renewal process, you can run:

sudo systemctl status certbot.timer
sudo certbot renew --dry-run