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]

Example

sudo -H bench setup lets-encrypt lab.serverok.in

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

Add

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

Create file

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

Add

#!/bin/bash

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

Make it executable

chmod 755 /usr/serverok/ssl-renew

Comments

2 responses to “Install LetsEncrypt SSL on ERPnext”

  1. Alex Avatar
    Alex

    How do I get around the message: You cannot setup SSL without DNS Multitenancy …
    Thanks,
    Alex

    1. ServerOk Avatar
      ServerOk

      You can run the command “bench config dns_multitenant on”

Leave a Reply

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