# Upgrade the server

> Pick an image tag, back up, then start the new version on the same data.

Source: https://docs.telesphorepo.com/upgrade/

## Image tags

The image is `ghcr.io/telesphorepo/telesphorepo`, for `linux/amd64` and `linux/arm64`.

| Tag            | Is                                            |
| -------------- | --------------------------------------------- |
| `latest`       | The newest release                            |
| `0.1.0`, `0.1` | One release, or the newest of a minor version |
| `main`         | The newest tested build of the main branch    |
| `sha-<commit>` | One build of the main branch                  |

Use `latest`, or pin a version such as `0.1` to choose when you upgrade.

## Upgrade

1. Open **Settings** › **Backups**, and click **Back up now**.

2. Start the new version on the same data, with the same `-e` variables.

   - Docker

     ```sh
     docker pull ghcr.io/telesphorepo/telesphorepo:latest
     docker rm -f telesphorepo
     docker run -d --name telesphorepo -p 127.0.0.1:8080:8080 -v telesphorepo-data:/data -v telesphorepo-backups:/backups ghcr.io/telesphorepo/telesphorepo:latest
     ```

     With Podman, write `podman` in place of `docker`.

   - Docker Compose

     ```sh
     docker compose pull
     docker compose up -d
     ```

   - Program

     Stop the server. Put the new `telesphorepo-server` from [GitHub Releases](https://github.com/Telesphorepo/Telesphorepo/releases) in place of the old one, and start it.

3. Check that it runs. The answer is `ok`.

   ```sh
   curl https://repo.example.com/healthz
   ```

On its first start, the new version updates the database.

## If something goes wrong

The server refuses to start after a downgrade

The server does not start on a database from a newer version. [Restore](/back-up-and-restore/#restore) the backup you made before the upgrade.
