# Online upgrades

Upgrade the controller and nodes from the panel: pre-checks, staged and one-click upgrades, automatic rollback on failure.

Both the controller and nodes are upgraded from System Admin › Upgrade & Maintenance in the panel. You don't need to re-run the install command.


## Upgrade the controller
Open System Admin › Upgrade & Maintenance › Master Upgrade, check the current and available versions, and click Upgrade Master. If the page says the controller needs a restart afterwards, restart it as prompted.

:::tip
Before upgrading, check whether the release notes mark the version as requiring a restart, and schedule it for a quiet period.
:::

## Upgrade nodes
Node upgrades support staged rollout and one-click upgrade: upgrade a few nodes first and extend to the rest once they look healthy. For the stages and automatic rollback see [Staged rollout and automatic rollback](https://www.gocdn888.com/en/guide/rollout). You can also turn on "Auto-upgrade nodes when the Master is upgraded", so nodes follow the controller.

A node upgrade replaces the whole package: the new version is unpacked into its own directory and switched in atomically. If the new config fails its check, or nginx isn't ready after restart, the node switches back to the old version and keeps serving, and the upgrade is recorded as failed. The previous version is kept, and Roll back in the panel switches to it any time.

When an upgrade needs to restart nginx, the node is first taken out of DNS and restarts nginx only after the DNS cache has expired, so there is basically no downtime. If the master is unreachable or too old, or the line group cannot spare the node, it restarts directly with a short outage. With many nodes, upgrade in batches at off-peak hours.

Nodes refuse downgrades by default: if the target version is older than the node's current version, the node rejects the upgrade and states the reason. A node only goes back to an older version through "Roll Back" on a rollout record, or when you create an upgrade and confirm the panel's warning that some nodes will be rolled back to an older version.

## Re-running the installer also upgrades
Re-running the controller's install command also upgrades it to the newest version on the release site. The command is unchanged and existing data is untouched.

:::warn
The one-click controller upgrade only replaces the controller program and its config; it does not upgrade ClickHouse. ClickHouse is upgraded only when the install script is re-run.
:::

If a license problem shows up during an upgrade, see [Licenses and add-ons](https://www.gocdn888.com/en/guide/license).