Let’s Encrypt is a free, automated, and open certificate authority (CA), run for the public’s benefit. So far it works well and makes it easy to obtain a free certificate. Now the created certificates will expire withing 90 days. This post will show you how you can auto renew these certificates before they expire.
- Ubuntu server
- Nginx minimal website
- Nginx SSL website
- Install Let’s Encrypt and create a free SSL certificate
Create a new bash script and it to the monthly cron folder for sheduling.
cd /etc/cron.monthly/ sudo vi letsencrypt-renew sudo chmod +x letsencrypt-renew
Add the following code to the
cd /usr/local/src/letsencrypt sudo service nginx stop sudo -H ./letsencrypt-auto renew sudo service nginx start
Now run the script and check if it succeeds.