h4ckbot
Self-Hosting

Upgrading

Upgrading takes about 5 minutes. There is a short downtime while containers restart.

Steps

1. Pull the latest code

git pull origin main

2. Rebuild and restart

docker compose up -d --build

This rebuilds both the backend and frontend images. The first build after a dependency change takes longer.

3. Run database migrations

docker compose exec backend alembic upgrade head

Always run this after upgrading — skipping it on a release that adds migrations will break the backend.

4. Confirm the stack is healthy

curl https://your-domain.com/api/health
# → {"status":"ok"}

Rollback

If something breaks, check out the previous commit and rebuild:

git checkout <previous-commit-hash>
docker compose up -d --build
docker compose exec backend alembic downgrade -1

The downgrade -1 reverses the most recent migration. Only needed if the upgrade included a schema change.

See also