# Update a self-hosted Truetask instance

How truetask-update.sh moves your instance to a new version, where to read the version you are on, and why a rollback means restoring a backup.

URL: https://docs.truetask.io/self-hosted/updates

Self-hosted only.

Updating a self-hosted Truetask instance is one command that pulls the release repository, pulls the new images and recreates the containers.
Your data directory and your `.env` are never touched, and Truetask never updates or checks for updates on its own.

## Run the update

```bash
scripts/management/truetask-update.sh
```

The script does four things in order.

1. Prints the version you are on, read from the `VERSION` file in the repository.
2. Runs `git pull --ff-only`.
   The new checkout is what carries the new image tag, because `docker-compose.yml` pins the release version as its default.
   It prints the old and new version when they differ.
3. Runs `docker compose pull` to fetch the new images.
4. Runs `docker compose up -d`, which recreates only the containers whose image changed, and prints your access URL.

The stack needs Docker Engine 25 or newer: check `docker version` on an older host before you update.

The same thing by hand:

```bash
git pull && docker compose pull && docker compose up -d
```

> **The pull must fast-forward**
>
> `git pull --ff-only` fails if you have edited a tracked file in the release repository.
> The script prints git's own output and stops rather than guessing.
> Stash or revert your change and run it again.
> Keep your configuration in `.env`, which is git-ignored, not in edits to the shipped files.

If the directory is not a git checkout at all, the script says so and skips the pull.
In that case pin the version yourself by setting `TRUETASK_VERSION` in `.env`, or re-clone the repository.

## What happens on the way up

PocketBase runs `pocketbase migrate up` before it starts serving.
If a migration fails the container refuses to start, on purpose, so an inconsistent schema never takes traffic, and its log names the failing migration.
Automatic schema migration is off; only the migration files shipped in the image run.
A restart with nothing changed since the last boot skips this step and goes straight to serving.

Nothing else moves.
`DATA_DIR` keeps pointing at the same directory, and the database, uploads, plugins, logs and MCP config in it are reused as they are.

## Check the version you are on

**Settings > Site > Health** shows three numbers at the top: how many of the three checked services are up, the Truetask **Version**, and the PocketBase version under **Database**.
It also lists PocketBase, the API server and the MCP server individually with a **Refresh** button.

From the command line:

```bash
scripts/management/truetask-status.sh
```

That prints the version, the git checkout, every container's state, a health probe, the size of your data directory, how many backups exist with the newest one's name, and the free disk.

## No automatic updates

Truetask never checks for a new version on its own and never contacts an external server about your instance.
Updating is always a command you run.

The only scheduled jobs that talk to the Truetask portal are gated to Cloud workspaces and return immediately on a self-hosted instance.
The daily license job runs locally: it reads the key already stored in your database and sends mail to your own admins.

Truetask Helper on your computers is different: it updates itself, from the release list the workspace offers.
That list is read from `truetask.io` unless `HELPER_RELEASE_MANIFEST` points elsewhere or is `off`.
See [Truetask Helper](https://docs.truetask.io/helper/).
See [What leaves a self-hosted instance](https://docs.truetask.io/self-hosted/outbound-data) for everything else that could leave the box, and [Network policy](https://docs.truetask.io/self-hosted/network) for what it takes to allow it.

## Updates and your license

Your license is perpetual, but new versions are only included until the date on the key.
**Settings > Site > License** shows it as **Updates included until**.
See [How Truetask is licensed](https://docs.truetask.io/self-hosted/licensing#the-updates-window).

Past that date the instance keeps running exactly as it is.
Pulling a newer image is what stops being covered.
[License](https://docs.truetask.io/self-hosted/license) covers the renewal reminder and the **Renew Updates** flow.

## Rolling back

There is no rollback command, and downgrading an image is not safe on its own.
The container only ever runs migrations forward, so an older image can meet a newer schema and refuse to start.

To go back to an earlier version, restore the state that matched it:

1. Stop the stack with `scripts/management/truetask-stop.sh`.
2. Restore the `pb_data` directory from a backup taken on the old version.
   [Backups](https://docs.truetask.io/self-hosted/backups) has the procedure.
3. Check out the old release tag in the repository, or pin `TRUETASK_VERSION` in `.env` to the old tag.
4. Start it again with `scripts/management/truetask-start.sh`.

> **Back up before you update**
>
> Take a backup first, every time.
> It costs a minute and it is the only rollback you have.

## Related

- [Backups](https://docs.truetask.io/self-hosted/backups)
- [Install](https://docs.truetask.io/self-hosted/install)
- [License](https://docs.truetask.io/self-hosted/license)
- [Audit, sessions and logs](https://docs.truetask.io/admin/security)
