Step 1 — Install the Server Dependencies
1 |
sudo apt-get update |
git
in order to download the Let’s Encrypt client. To install git
, run:
1 |
sudo apt-get install git |
Step 2 — Download the Let’s Encrypt Client
1 |
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt |
Step 3 — Set Up the SSL Certificate
Access the letsencrypt directory:
1 |
cd /opt/letsencrypt |
To execute the interactive installation and obtain a certificate that covers only a single domain, run theletsencrypt-auto
command with:
1 |
./letsencrypt-auto --apache -d example.com |
1 |
./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):
1 |
https://www.ssllabs.com/ssltest/analyze.html?d=linuxbg.eu&latest |
Step 4 — Set Up Auto Renewal
1 |
./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:
1 2 |
sudo crontab -e 30 2 * * 1 /opt/letsencrypt/letsencrypt-auto renew >> /var/log/le-renew.log |