Linux Automatically Renew a Let’s Encrypt SSL Certificate
Hi! This Tip shows you How to Automatically Renew a Let’s Encrypt SSL Certificate on GNU/Linux Systems.
Because Let’s Encrypt SSL Certificates are valid for 90 days. Therefore it’abosolutelly recommended Automatically Renewing your Certificates every 60 days.
So here included you’ll find detailed Instructions on How to Automatically Renew your Free SSL Certificate.
-
1. Checking Certificate Duration
First, see How to Check Certificate Validity
Install the required Tool:sudo apt install ssl-cert-check
Then you can easily check your Certificate Duration with:
ssl-cert-check -c /etc/letsencrypt/live/[MYDOMAIN]/cert.pem
E.g.:
ssl-cert-check -c /etc/letsencrypt/live/example.com/cert.pem
-
2. Testing Renewal
After to Check if Any Issue in Renewal.
sudo apt certbot renew
This should simply confirm that your Certificate has Not yet to be Renewed.
-
3. Setting Up Automatic Renewal
After to Check if Any Issue in Renewal.
sudo crontab -e
With this we make a Cron Job that Renew our Cert Every Month…
Append:0 0 1 * * sudo certbot renew
So with this simple Setup then your Certificate will be Renewed Monthly Automatically! :)
So Now I’m truly Happy if My Guide could Help you to Renewing the Let’s Encrypt SSL Certificate!