Forums

Automating LetsEncrypt SSL Renewal

Hey awesome PA team,

So I've become a half decent Django developer but I know next to nothing about linux / bash / scripting and all that jazz.

I was wondering whether it's possible to automate the whole Let'sEncrypt SSL renewal process, as I will be launching a few more web apps in the future and it's going to become ever more chaotic keeping track of renewals every 3 months.

Would it be possible to write a script which runs via your Tasks feature every 3 months that executes the following commands:

cd ~/letsencrypt
~/dehydrated/dehydrated --cron --domain www.yourdomain.com --out . --challenge http-01
python manage.py my_custom_command

Where my_custom_command would just send out an automated email reminding you to renew the certs (I can do this part pretty easily).

Would you be able to give me a hand in writing that up in .sh format?

Thanks, much appreciated!

it is possible- some of our users do do that.

the responsibility would be on you to make sure your script works though (renews the cert correctly and sends out the email successfully etc)

i would probably have a daily script that checks if your cert has <30 days till expiry, and if so, run script to renew and send email.