Install LetsEncrypt SSL on ERPnext

To install LetsEncrypt free SSL on ERPnext site, run

sudo -H bench setup lets-encrypt [site-name] --custom-domain [custom-domain]


sudo -H bench setup lets-encrypt

To renew SSL, you can run

sudo bench renew-lets-encrypt

This will ask for your confirmation to restart nginx. Running this on cronjob won’t work. But you can use “echo y” to get it work. But it is better just to certbot-auto to renew SSL.

Auto Renew ERPnext SSL

To auto renew create a cronjob

crontab -e


30 2 * * 1 /usr/serverok/ssl-renew >> /var/log/le-renew.log

Create file

mkdir /usr/serverok/
vi /usr/serverok/ssl-renew



systemctl stop nginx
/opt/certbot-auto renew
systemctl start nginx

Make it executable

chmod 755 /usr/serverok/ssl-renew
Need help with Linux Server or WordPress? We can help!


Leave a Reply

Your email address will not be published. Required fields are marked *