Build from source
This page is for people who work on Restow itself. To operate Restow, install the published release images as described in Get started.
Requirements
Section titled “Requirements”The same host requirements as the release stack: Docker Engine with the Docker Compose plugin. Node.js 22 and pnpm 9 are only needed to develop Restow, not to run the source stack.
Build and start
Section titled “Build and start”The repository’s own docker-compose.yml builds both images from source instead of pulling them. Get the repository onto the server, run cp .env.example .env, fill in the same values as for the release stack (see Get started → Fill in the required values; leave RESTOW_IMAGE and RESTOW_WEB_IMAGE empty: Compose then builds and runs restow:local and restow-web:local), and start it:
docker compose up -dThe first run builds the images (Dockerfile target runtime for api/worker/scheduler, target web for Caddy), which takes a few minutes. The source stack binds PostgreSQL to loopback (POSTGRES_PORT, default 5432). Everything else in Get started applies unchanged, including the setup token in the first step of the setup wizard (docker compose logs api | grep 'SETUP TOKEN').
Two build targets
Section titled “Two build targets”The Dockerfile builds the two builds of every release:
| Build | Dockerfile targets | Release images | Contains |
|---|---|---|---|
| Full | runtime, web |
ghcr.io/restow-backup/restow, ghcr.io/restow-backup/restow-web |
The core plus the Business and Service Provider modules under ee/, locked until a license key is installed. |
| Community | runtime-community, web-community |
ghcr.io/restow-backup/restow-community, ghcr.io/restow-backup/restow-web-community |
The Apache-2.0 core only. The build removes ee/ before anything is compiled and stops if any ee/ code reaches the image. |
The source stack builds the full targets. To run the Community build from a checkout, build its two targets:
docker buildx build --target runtime-community -t restow-community:local --load .docker buildx build --target web-community -t restow-web-community:local --load .Then set RESTOW_IMAGE=restow-community:local and RESTOW_WEB_IMAGE=restow-web-community:local in .env and run docker compose up -d without --build. The details, including the checks on the image contents, are in docs/CI.md (“Two build targets”) in the repository.
Update a source checkout
Section titled “Update a source checkout”Read the release notes first, as for every update. Then:
git fetch --tagsgit checkout vX.Y.Zdocker compose up -d --buildThen watch the migrations and the start with docker compose logs -f api.
If the updater ever wrote RESTOW_IMAGE and RESTOW_WEB_IMAGE into .env, those two lines decide which images the services run. Remove them to go back to building from the checkout. RESTOW_UPDATER_IMAGE is yours alone: the updater never writes it, and empty means the updater runs restow:local (rebuild it from the release you move to).
Roll back a source checkout
Section titled “Roll back a source checkout”-
No migrations in the release: check out the previous version and run
docker compose up -d --buildagain. -
With migrations: migrations are not reversible. Stop the stack, restore the database dump taken before the update, then start the previous version:
Terminal window docker compose stop api worker schedulerdocker compose exec -T postgres pg_restore -U restow -d restow --clean --if-exists < restow-YYYY-MM-DD.dumpgit checkout vPREVIOUSdocker compose up -d --buildBackups taken after the update are in the chunk store but not in the restored database, so run a backup after the rollback.
Contributing
Section titled “Contributing”Contributions are described in CONTRIBUTING.md in the repository.