Skip to content

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.

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.

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:

Terminal window
docker compose up -d

The 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').

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:

Terminal window
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.

Read the release notes first, as for every update. Then:

Terminal window
git fetch --tags
git checkout vX.Y.Z
docker compose up -d --build

Then 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).

  • No migrations in the release: check out the previous version and run docker compose up -d --build again.

  • 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 scheduler
    docker compose exec -T postgres pg_restore -U restow -d restow --clean --if-exists < restow-YYYY-MM-DD.dump
    git checkout vPREVIOUS
    docker compose up -d --build

    Backups taken after the update are in the chunk store but not in the restored database, so run a backup after the rollback.

Contributions are described in CONTRIBUTING.md in the repository.