This tutorial will help you to renew Let’s Encrypt certificates automatically. You don’t need to renew SSL certificates manually each time. The certbot script will take care of this and renew certificates before expiration.
Auto Renew Let’s Encrypt SSL
Certbot comes with a script to renew existing certificates. You can test the renewal script with a single dry run like below.
sudo /usr/sbin/certbot-auto renew --dry-run
If the above test succeeded, then create a cron job that will run the SSL renewal program for configured intervals. Configuring this script once a day is good enough.
Make sure the certbot binary script location as per below command. Let’s edit crontab with the following command.
crontab -e
Add the below command at end of fine and save it.
0 * * * * /usr/sbin/certbot-auto renew
Some of the sysadmin’s keep script name certbot, So change the script name as per your setup.
Hi Rahul, can this also be used in a kubernetes environment? If yes, where should this cronjob be running? Regards, J