Installing Let's Encrypt on Ubuntu 16.04

SSL certificates are used within web servers to encrypt the traffic between the server and client, providing extra security for users accessing your application. Let’s Encrypt provides an easy way to obtain and install trusted certificates for free.

sudo apt update
sudo apt install python-letsencrypt-apache

Install Let's Encrypt

sudo letsencrypt --apache

Start the interactive installation script which will ask a couple of questions to setup the certificate correctly.

sudo letsencrypt --apache -d example.org  

To a certificate for another domain and configures apache

 

Renewal

SSL certificates are only valid for a limited time. It's recommended that you run check to see if it needs to be renewed daily by creating a job in cron or systemd.

sudo letsencrypt renew --dry-run
You can test the renewal process like this

Troubleshooting

Try creating the certificate without installing it. If this doesn't work then there may be something wrong with your apache config or firewall.

letsencrypt certonly --authenticator webroot \
--webroot-path /var/www/html/ --expand -d example.org \ --email your-email-address
Create the certificate for you domain
letsencrypt install \
--key-path /etc/letsencrypt/live/example.org/privkey.pem \
--fullchain-path /etc/letsencrypt/live/example.org/fullchain.pem \
--cert-path /etc/letsencrypt/live/example.org/cert.pem \
-d example.org
Then you can install the certificate and configure apache using the automatic installer like this.