Step 1 — Install the Server Dependencies
sudo apt-get update
We will need git
in order to download the Let’s Encrypt client. To install git
, run:
sudo apt-get install git
Step 2 — Download the Let’s Encrypt Client
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
Step 3 — Set Up the SSL Certificate
Access the letsencrypt directory:
cd /opt/letsencrypt
To execute the interactive installation and obtain a certificate that covers only a single domain, run theletsencrypt-auto
command with:
./letsencrypt-auto --apache -d example.com
./letsencrypt-auto --apache -d example.com -d www.example.com
When the installation is finished, you should be able to find the generated certificate files at/etc/letsencrypt/live
. You can verify the status of your SSL certificate with the following link (don’t forget to replace example.com with your base domain):
https://www.ssllabs.com/ssltest/analyze.html?d=linuxbg.eu&latest
Step 4 — Set Up Auto Renewal
./letsencrypt-auto renew
Let’s edit the crontab to create a new job that will run the renewal command every week. To edit the crontab for the root user, run:
sudo crontab -e 30 2 * * 1 /opt/letsencrypt/letsencrypt-auto renew >> /var/log/le-renew.log