Skip to content

This guide shows you how to run Sluice and Postgres on one host with Docker Compose. The stack fits a trial, a laptop or a small server. For a cluster, see Deploy on Kubernetes with Helm.

The stack has two services:

Service Image Notes
postgres postgres:17-alpine The user, the password and the database are sluice. The data stays in the named volume postgres-data.
sluice sluice-uv Starts after Postgres is healthy. Tasks run on the process executor inside this container. The image has bash, uv, Python 3.12 and bun.

Sluice itself needs no volume. It keeps all state in Postgres, and the default storage driver postgres also keeps file contents, logs and artifacts there.

The repository holds deploy/compose/compose.yml. It builds the sluice-uv image from the source.

  1. Clone the repository and go to its root:

    Terminal window
    git clone https://github.com/alternayte/sluice.git
    cd sluice
  2. Set the two required variables. Compose stops when one of them is empty.

    Terminal window
    export SLUICE_BOOTSTRAP_ADMIN_PASSWORD='change-me-now-1'
    export SLUICE_MASTER_KEYS="k1:$(openssl rand -base64 32)"
  3. Start the stack:

    Terminal window
    docker compose -f deploy/compose/compose.yml up -d --build
  4. Open http://localhost:8080. Sign in as admin@local.test with the password of step 2.

Check that the server is ready. The answer lists the checks database, master_keys, migrations and storage:

Terminal window
curl -s http://localhost:8080/readyz

The compose file reads these variables from the shell or from a .env file next to it:

Variable Default Notes
SLUICE_BOOTSTRAP_ADMIN_PASSWORD none Required. The password of the first admin.
SLUICE_MASTER_KEYS none Required. The keys that encrypt the builtin secrets.
SLUICE_BOOTSTRAP_ADMIN_EMAIL admin@local.test The email of the first admin.
SLUICE_PUBLIC_URL http://localhost:8080 The URL that browsers use.
SLUICE_PORT 8080 A variable of the compose file only: the host port. Sluice does not read it.
POSTGRES_PASSWORD sluice The password of the Postgres user.

To set more server variables, add them under environment of the sluice service. Environment variables lists all of them.

The command in the steps creates a new master key each time. Sluice encrypts each builtin secret with the first key of SLUICE_MASTER_KEYS. When the key of a stored secret is missing, /readyz fails with master_key_missing. Store the value in a .env file next to the compose file:

Terminal window
printf 'SLUICE_MASTER_KEYS=%s\n' "$SLUICE_MASTER_KEYS" >> .env
printf 'SLUICE_BOOTSTRAP_ADMIN_PASSWORD=%s\n' "$SLUICE_BOOTSTRAP_ADMIN_PASSWORD" >> .env

Keep a copy of the key outside the host. Without the key, Sluice cannot read the builtin secrets of a database backup. To replace a key, see Rotate the master key.

Sluice creates the first admin from SLUICE_BOOTSTRAP_ADMIN_EMAIL and SLUICE_BOOTSTRAP_ADMIN_PASSWORD only when the users table is empty. Later starts do not change users. A new bootstrap password thus has no effect after the first start.

After the first sign-in, change the password on Settings → Profile. Then create one user for each person on Settings → Users.

Sluice serves plain HTTP. To serve it on a domain, put a reverse proxy with TLS in front of port 8080. Then set SLUICE_PUBLIC_URL to the https:// URL that browsers use. Sluice uses this URL for the same-origin check of the UI, the Secure flag of the session cookie, and the webhook URLs.

Command Effect
docker compose stop Stops the containers. The data stays.
docker compose down Removes the containers. The volume postgres-data stays.
docker compose down -v Removes the containers and the volume with all data.

To upgrade, back up the database first. Then change the image tag and start the stack again:

Terminal window
docker compose pull
docker compose up -d

In a checkout, pull the new source and run docker compose -f deploy/compose/compose.yml up -d --build. The server applies the new database migrations at start. See Upgrade and Back up and restore.