CyberPanel SSL auto-renew

So, I have OpenLightSpeed server with CyberPanel installed. My issue is that once I issue the SSL with a standard CyberPanel tool, it works for 90 days only, regular Lets Encrypt cert. There is a CRON job add possibility in the CP, but I`m not sure it will work properly to auto-renew. Esspecialy the restart part. Here it is:

/root/.acme.sh/acme.sh --issue -d yourdomainname.com -d www.yourdomainname.com --cert-file /etc/letsencrypt/live/yourdomainname.com/cert.pem --key-file /etc/letsencrypt/live/yourdomainname.com/privkey.pem --fullchain-file /etc/letsencrypt/live/yourdomainname.com/fullchain.pem -w /home/yourdomainname.com/public_html –-force && systemctl restart lsws

Could someone advise, please? Thanks in advance.

What you want:

  • Auto-renew your SSL cert before it expires (every ~60-80 days)
  • Replace cert files CyberPanel uses
  • Restart OpenLiteSpeed after renewal so new cert is loaded

Step 1: Fix your renewal command

Your command has a small issue — the -w path and the double dashes --force look suspicious (copy-paste issue maybe). Also, the restart should happen only if renewal is successful.

Use this fixed command:

/root/.acme.sh/acme.sh --renew -d yourdomainname.com -d www.yourdomainname.com \
  --cert-file /etc/letsencrypt/live/yourdomainname.com/cert.pem \
  --key-file /etc/letsencrypt/live/yourdomainname.com/privkey.pem \
  --fullchain-file /etc/letsencrypt/live/yourdomainname.com/fullchain.pem \
  -w /home/yourdomainname.com/public_html --reloadcmd "systemctl restart lsws"

Notes:

  • --renew tries to renew only if needed
  • --reloadcmd runs restart only after successful renewal
  • Use normal double dashes --force or --renew (no weird characters)
  • -w points to your web root

Step 2: Set up the cron job for auto-renewal

Run:

crontab -e

Add this line (runs daily at 2:30 AM):

30 2 * * * /root/.acme.sh/acme.sh --renew -d yourdomainname.com -d www.yourdomainname.com \
  --cert-file /etc/letsencrypt/live/yourdomainname.com/cert.pem \
  --key-file /etc/letsencrypt/live/yourdomainname.com/privkey.pem \
  --fullchain-file /etc/letsencrypt/live/yourdomainname.com/fullchain.pem \
  -w /home/yourdomainname.com/public_html --reloadcmd "systemctl restart lsws" >> /var/log/acme-renew.log 2>&1

Step 3: Verify it works

  • You can manually run the command above to test
  • Check the log /var/log/acme-renew.log after cron runs
  • Make sure OpenLiteSpeed restarts without errors

Summary:

  • Use acme.sh --renew with --reloadcmd to restart OpenLiteSpeed only on successful renewal
  • Add that command as a daily cron job
  • Monitor logs to confirm it works smoothly