Updates & Migrations
Updates and migrations
Section titled “Updates and migrations”The SelfHosted backend prepares the SQLite database during startup.
A brand-new empty database is bootstrapped to the current schema. An existing database follows the normal Entity Framework migration path. If the existing schema is not safe to migrate, startup fails rather than silently stamping it as current.
Before updating
Section titled “Before updating”Keep a recent local backup or another independent copy of the persistent /data volume.
Upgrade the container
Section titled “Upgrade the container”docker compose pulldocker compose up -dCompose replaces the application container while preserving the mounted /data volume.
The latest tag is published only after the full public CI passes on main.
Pin a specific build
Section titled “Pin a specific build”Every release also gets an immutable selfhosted-sha-<commit> tag. The committed Compose file reads it from NOSTOS_IMAGE_TAG:
NOSTOS_IMAGE_TAG=selfhosted-sha-<full-commit-sha> docker compose up -dUse only selfhosted-sha-* tags as pins. Older sha-* tags in the same package predate the SelfHosted image and may point at other builds.
Coming from an older image
Section titled “Coming from an older image”Images published before October 11, 2026 kept the key ring inside the container, at /home/app/.aspnet/DataProtection-Keys. Current images keep it in /data/keys, so it survives container replacement.
Before you replace an older container, copy the files from that directory into the volume’s keys/ directory, owned by a user the app can read and write as. If the old container is already gone, re-enter your AI keys in Settings. Keys supplied through environment variables are not affected.
Verify startup
Section titled “Verify startup”Check the service state and recent logs:
docker compose psdocker compose logs --tail 100 nostosConfirm that the container remains running and that startup shows no database-bootstrap, migration, storage, or fatal application errors.
Do not rely on one exact success log sentence; startup messages can change while the migration contract remains the same.