In this tutorial, I’ll show you how to setup a Let’s Encrypt SSL certificate on Ubuntu 16.04 and Apache web server.

Install Certbot

Firstly, we will install Certbot, which is an easy-to-use automatic client that fetches and deploys Let’s Encrypt SSL/TLS certificates for your webserver.

sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache

That’s it, you can now go to the next step, which is installing your Let’s Encrypt SSL certificate!

Install Let’s Encrypt SSL Certificates

sudo certbot --apache -d

Replace with the domain name you’d like the Let’s Encrypt SSL certificate for.

You can install multiple Let’s Encrypt SSL certificates by using -d, i.e.:

sudo certbot --apache -d -d

The Let’s Encrypt SSL certificate(s) is now installed and you can check using SSL Labs’s SSL test.

SSL Renewals

Let’s Encrypt SSL certificates only last three months, so it’s a good idea to create a cron job to check the expiration of SSL certifications, and renew them when necessary.

sudo crontab -e

In the text editor add:

0 0 1 * * /usr/bin/certbot renew --quiet

Certbot will check and renew SSL certificates every first of the month. You can modify it as needed. Cron job structure is:

minute hour day-of-month month day-of-week command

Have fun!