ERPNext Domain Change

ERPNext Domain Change / SSL Handling — ERPnext v12 VPS

Key Rule (Must Remember)

Any time you run bench setup nginx, SSL is removed from Nginx.
You MUST re-run Certbot immediately after.


Correct Steps to Change / Add / Remove a Domain

  1. Update DNS

    • Point domain to the correct server IP

    • Confirm with:

      ping yourdomain.com
      
      
  2. Update domain in ERPNext

    bench setup add-domain yourdomain.com --site yoursite
    # or
    bench setup remove-domain olddomain.com --site yoursite
    
    
  3. Regenerate Nginx (required)

    bench setup nginx
    sudo nginx -t
    sudo systemctl reload nginx
    
    
  4. Re-enable SSL (always required after step 3)

    sudo certbot --nginx -d yourdomain.com \
    -m your@email.com --agree-tos --redirect -n
    
    
  5. Verify

    curl -I https://yourdomain.com
    
    

Important Notes

  • SSL did not expire if HTTPS suddenly stops

  • bench setup nginx overwrites Certbot SSL config

  • Certificates remain valid, but Nginx stops listening on port 443

  • Solution is always: run Certbot again

@hilalhabeeb Is that a typo or are you posting an article about ERPNext version 12 :upside_down_face: