Install LetsEncrypt SSL on ERPnext
To install LetsEncrypt free SSL on ERPnext site, run
1 |
sudo -H bench setup lets-encrypt [site-name] --custom-domain [custom-domain] |
Example
1 |
sudo -H bench setup lets-encrypt lab.serverok.in |
To renew SSL, you can run
1 |
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
1 |
crontab -e |
Add
1 |
30 2 * * 1 /usr/serverok/ssl-renew >> /var/log/le-renew.log |
Create file
1 2 |
mkdir /usr/serverok/ vi /usr/serverok/ssl-renew |
Add
1 2 3 4 5 |
#!/bin/bash systemctl stop nginx /opt/certbot-auto renew systemctl start nginx |
Make it executable
1 |
chmod 755 /usr/serverok/ssl-renew |
How do I get around the message: You cannot setup SSL without DNS Multitenancy …
Thanks,
Alex
You can run the command “bench config dns_multitenant on”