How to install Let’s Encrypt SSL on Ubuntu 18.04 with Apache

Step 1 – Installing the Certbot

Add certbot repository

$ sudo add-apt-repository ppa:certbot/certbot

Install all of the required packages

$ sudo apt install python-certbot-apache

Step 2 – Obtaining a Certificate

Obtain a certificate that covers only a single domain

$ sudo certbot --apache -d domain.com

Obtain a single certificate that covers multiple domains or subdomains

$ sudo certbot --apache -d domain.com -d domain2.com

$ sudo certbot --apache -d domain.com -d www.domain.com

Step 3 – Setting Up Auto Renewal

Edit the crontab to create a new job that will run the renewal twice per day. To edit the crontab for the root user

$ sudo crontab -e

Enter insert mode by pressing i and add in the following line:

* */12 * * * /usr/bin/certbot renew >/dev/null 2>&1

Now, press Esc to leave insert mode, then :wq and ENTER to save and exit the file.

Leave a Reply 0

Your email address will not be published. Required fields are marked *