Cronjob for SSL Renewal on a Lightsail Instance

By January 29, 2020March 19th, 2020articles

1-Move Certbot-Auto Package

cd tmp
sudo mv certbot-auto /etc/letsencrypt/

3-Verify is certbot-auto was moved correctly

ls /etc/letsencrypt/

4-Edit Crontab File

sudo crontab -e

5-Choose nano and add this as the last line

45 2 * * 6 cd /etc/letsencrypt/ && ./certbot-auto renew && /opt/bitnami/ restart

6-Basic Auto-Renew Testing

sudo -1
cd /etc/letsencrypt/ && ./certbot-auto renew --dry-run && /opt/bitnami/ restart