# Upgrade the server

This page is for on-premises servers. In the cloud, IZT upgrades the server for you.

The console and the join page are built into the server, so upgrading the server upgrades them too. Agents update separately: see [Keep agents up to date](/install/agent-updates/).

## Before you upgrade

1. [Back up the database and the data folder](/install/back-up-and-restore/).
2. Note the version of the image you run now, so you can tell the two apart. An image prints its version with:

   ```sh
   docker run --rm <blink-server-image> -version
   ```

:::caution[Going back is not always possible]
A new version may update the database when it starts. An older version can refuse to start on a database a newer one has updated. Keep the backup from before the upgrade until you are happy with the new version.
:::

## Upgrade

1. Get the new server image version.
2. Stop the running container and give it time to stop cleanly:

   ```sh
   docker stop -t 45 blink
   ```

   During those seconds the server pauses live sessions and finishes the recordings in progress.
3. Remove the old container (keep the volume: do **not** use `docker rm -v`):

   ```sh
   docker rm blink
   ```

4. Start a new container from the new image with exactly the same volume, ports, database settings and options as before.
5. Wait until `docker ps` shows the container as `healthy` and the sign-in page loads, then sign in to the console.

A session that was live during the restart waits up to two minutes for the server to come back; if the server takes longer, the session ends. Access agents reconnect on their own.

## After the upgrade

- Open **Instance** › **License** and check the license and **Agent builds** cards for warnings.
- Start a test session to confirm everything works.
