Skip to content

Upgrade

Terminal window
cd ownauth
git pull
cd docker
docker compose build
docker compose up -d

Migrations run at boot, under a Postgres advisory lock, before the first request is served. The health check has a 30 second grace period for exactly that.

Survives Why
accounts, sessions, organizations they are rows in your database
existing sessions the cookie is signed with BETTER_AUTH_SECRET, which you did not change
issued JWTs the JWKS keys are unchanged
your config file it is a volume, not part of the image
Does not survive Why
in-flight requests during the restart expected
anything you edited inside the container the image is replaced; edit the repo or the config volume
Terminal window
docker exec docker-db-1 pg_dump -U ownauth ownauth > ownauth-$(date +%F).sql
cp config/auth.config.yaml config/auth.config.yaml.$(date +%F)

The settings page already keeps one previous version as auth.config.yaml.bak, but that is one generation, not a backup policy.

BETTER_AUTH_SECRET encrypts the JWKS private keys and signs session cookies. If it changes:

  • every session becomes invalid,
  • every issued JWT fails verification,
  • and the instance refuses to boot with BETTER_AUTH_SECRET does not match this instance rather than failing mysteriously later.

That refusal is the feature. To rotate deliberately: truncate the jwks table, then start with the new secret. Every session and token becomes invalid, by design.

Terminal window
git checkout <previous-tag>
cd docker && docker compose build && docker compose up -d

Migrations are additive in practice but not guaranteed reversible. If a release adds a table, an older version ignores it; if it changes one, restore the dump instead of downgrading.

Terminal window
curl -s localhost:3000/api/health

Check version, database.ok, and that schema and searchPath are what you expect. Then open the console: the Overview page shows the version and the uptime, and Configuration shows the resolved settings.

If you run the repository yourself, bash scripts/cleanroom.sh proves the current main installs from scratch before you point your production instance at it.