Limited time offer! 25% off Lifetime Add-ons with code LMT25 at checkout. View plans →

< All Topics
Print

Upgrading CyberPanel

There are three ways to upgrade CyberPanel: from the panel, from the terminal, or automatically. All three install the latest release, which is the version named in cyberpanel.net/version.txt (for example {"version":"3.0","build":21} is CyberPanel 3.0.21).

Before you upgrade

  • Take a snapshot of the server at your provider, or a full backup, so you can go back if anything goes wrong.
  • Pick a quiet time. Web, mail and panel services restart during the upgrade, and the panel is unavailable for a short time near the end. Websites keep their files, databases and settings.
  • Keep at least 3 GB of disk space free (check with df -h /).
  • Always upgrade to the latest release. Going back to an older version is not supported: the panel refuses it, and it can break a working server. To undo an upgrade, restore your snapshot.

1. From the panel (CyberPanel 3.0.9 and later)

  1. Sign in to CyberPanel as admin and open Version Management (type it into the menu search box).
  2. Under CyberPanel Version Control the newest release is already selected. Press Upgrade CyberPanel to selected branch and confirm.
  3. Leave the page open. It shows the progress and tells you when the upgrade has finished; then reload the page. This usually takes 5 to 20 minutes.

If the upgrade fails, the panel puts the previous version back, restarts, and shows what went wrong.

Servers older than CyberPanel 3.0.9 (every 2.x version, and 3.0.0 to 3.0.8, including servers created from the CyberPanel 3.0.5 Cloud VPS image) still have an older version of this page. Do not use its Upgrade button: it runs the old upgrade code, which can stop half way without saying so, leaving the panel without its Python environment and mail stopped. Upgrade these servers once from the terminal (below); after that, the panel page works. If you already pressed the old button, run the terminal command: it completes the upgrade and repairs the server.


2. From the terminal

This is also the way to upgrade servers older than CyberPanel 3.0.9, including 2.x. Connect to the server with SSH as root and run:

sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)

If you sign in as a user with sudo rights instead of root:

sudo su - -c "sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)"

When it asks for a version, press Enter (or wait 10 seconds) to install the latest release. Keep the SSH window open until it finishes. Everything it does is also written to /var/log/cyberpanel_upgrade_debug.log.

After the line Verified Django … the upgrade downloads its own files from GitHub without printing anything for a while. If nothing changes for more than 15 minutes, press Ctrl+C and run the same command again: up to that point the upgrade has not changed your panel or websites.


3. Automatic updates (CyberPanel 3.0.10 and later)

Open Version Management and find the Automatic Updates card:

  • When a new release is published: Do nothing (default), Tell me by e-mail, or Install it automatically.
  • Install during this hour: the hour (server time) in which an automatic upgrade may run.
  • Send results to: the e-mail address that gets the result.

The server installs only releases signed by CyberPanel, and not on the day they are published: new releases reach servers gradually over the following days. If an automatic upgrade fails, the previous version is put back and you get one e-mail; the server does not try that release again by itself. Automatic upgrades are skipped while CSF is installed, while less than 3 GB of disk space is free, or while another upgrade is running.


Check which version you have

Version Management shows the installed version. From the terminal:

cat /usr/local/CyberCP/version.txt

If the upgrade stops

  • “Upgrade stopped: CSF files were detected”: your server still has CSF, which CyberPanel no longer uses. To upgrade and keep your CSF firewall as it is, run the upgrade script with --preserve-csf:
    curl -fsSL -o /root/cyberpanel_upgrade.sh https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/cyberpanel_upgrade.sh
    bash /root/cyberpanel_upgrade.sh --preserve-csf

    It checks your CSF set-up first and stops with the reason if it cannot keep it (for example when another firewall is also running); then send us that message.

  • “Upgrade stopped at the OpenLiteSpeed check” or “OpenLiteSpeed configuration failed validation”: run the upgrade again. Current releases repair the known causes by themselves. If it stops again, send us the message it shows.
  • “Upgrade stopped: the running Dovecot configuration cannot be reloaded”: run the upgrade again. Since CyberPanel 3.0.21 the upgrade repairs the known cause by itself: mail settings that versions before 3.0.8 added for websites created without an SSL certificate (the same settings stop mail at its next restart, so upgrading also brings mail back). If it stops again, run doveconf -n and send us what it prints.
  • “Failed to download the upgrade script from GitHub” or HTTP 429: GitHub is limiting downloads for a moment. Wait a few minutes and run the command again.
  • Anything else: contact support with a screenshot of the message and the last 50 lines of the log (tail -n 50 /var/log/cyberpanel_upgrade_debug.log). Please never send passwords in a ticket.