Docker Compose

Run PostgreSQL, two or more Stater servers and an HAProxy edge on one machine with the signed Docker Compose bundle.

See it in the tour: Install on your own server

On this page

The compose bundle runs PostgreSQL 17, two or more Stater servers and an HAProxy edge on one machine, from the published, signed image. It suits a single server in a back office or a small cloud machine. For more than one machine, use Kubernetes or the Linux packages with a separate database.

You need Docker with Compose v2 (docker compose), or Podman 4.4 or later with podman compose, and about 2 GB of memory.

1. Check and unpack#

Note. Stater is in early access. The release files and images are not public; request early access to get them.

You need stater-compose-0.1.0.tar.gz, SHA256SUMS and SHA256SUMS.sigstore.json. Check them, then unpack:

cosign verify-blob SHA256SUMS --bundle SHA256SUMS.sigstore.json \
  --certificate-identity-regexp '^https://github.com/Kazarrackt/retail-ops-platform/.github/workflows/release.yml@refs/tags/v' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com
sha256sum --ignore-missing -c SHA256SUMS
tar -xzf stater-compose-0.1.0.tar.gz
cd stater-compose-0.1.0

The image is signed too:

cosign verify ghcr.io/kazarrackt/stater:0.1.0 \
  --certificate-identity-regexp '^https://github.com/Kazarrackt/retail-ops-platform/.github/workflows/release.yml@refs/tags/v' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

2. Install#

./install.sh

It checks that compose is there, then asks for the address people will open and how to set up email (now, by an owner in Admin › Email, or later; see Email). It writes .env (mode 0600), makes a database password and the secret key, pulls the pinned images, starts everything, waits until Stater answers through the edge and runs stater db doctor.

Finish setup straight away: until an owner exists, whoever opens Stater first creates one. Or give --owner-username U --owner-password-file F before the first start: the password goes in secrets/bootstrap_admin_password, never in .env.

For scripts:

./install.sh --non-interactive --public-url https://pos.example.com --email admin
./install.sh --non-interactive --public-url https://pos.example.com --email now \
  --smtp-host smtp.example.com --smtp-username [email protected] --smtp-password-file ./smtp-pw \
  --smtp-from [email protected] --licence ./shop.lic
Flag Default What it does
--public-url URL http://localhost:8080 The address people open.
--bind ADDR, --port N 127.0.0.1, 8080 Where the edge listens.
--replicas N 2 How many Stater servers.
--licence FILE Copies it to licence.lic, checks it with the image and sets STATER_LICENCE_FILE.
--email now|admin|later and --smtp-* admin As for stater configure; the password comes from --smtp-password-file or a prompt that does not echo.
--owner-username U, --owner-password-file F Create this owner on first start; the password (12 or more characters) goes in secrets/bootstrap_admin_password.
--image REPO ghcr.io/kazarrackt/stater Another registry or a mirror.
--upgrade Move STATER_VERSION to this bundle's version.
--no-pull, --no-start, --non-interactive Use local images; write settings only; ask nothing.

Running it again is safe: it keeps .env as you left it unless a flag changes something, and it never replaces the secret key.

What is where#

Path What it is
.env Settings. Every STATER_ line reaches the server; see .env.example.
secrets/ (0700) secret_key, the key that encrypts saved integration passwords, smtp_password and bootstrap_admin_password. They reach the containers as compose secrets, so they are not in docker inspect. Keep a copy of secret_key apart from your backups (Secrets).
licence.lic The licence; empty runs as Starter.
pgdata volume The database.
backups volume Backups, made inside Stater at 02:30 each night.

TLS in front#

The edge speaks plain http and listens on this machine only. To let tills and phones in, put a reverse proxy with TLS in front of 127.0.0.1:8080 (see the Caddy and nginx examples in Linux packages), or a cloud load balancer. --bind 0.0.0.0 publishes the edge on every address without TLS, and install.sh warns about it.

The bundle runs on its own network, 172.31.250.0/24, with the edge at 172.31.250.2. Stater believes X-Forwarded-For from the edge alone, so a till or phone cannot forge its address to get round the sign-in limits. A TLS proxy on this machine reaches the edge from the network's gateway, 172.31.250.1: add it so Stater sees each client's own address, with STATER_TRUSTED_PROXIES=172.31.250.2/32,172.31.250.1/32 in .env. A load balancer elsewhere is added the same way, by its address. If 172.31.250.0/24 is taken on this machine, set NETWORK_SUBNET, EDGE_ADDRESS and STATER_TRUSTED_PROXIES in .env together.

Scaling#

Each Stater server opens at most 8 database connections, plus 2 while it makes a backup. With the bundle's PostgreSQL (100 connections) that leaves room for about eight servers. Change the number with ./install.sh --replicas N or docker compose up -d --scale stater=N. Servers are stateless: sessions, live updates and the outbox are in PostgreSQL, so stopping one is not noticed.

Backups and restoring#

Backups go to the backups volume, which every server and docker compose run see. Add off-site S3 storage in Admin › Backups, and copy backups off the machine. The secret key is not in a backup: keep it apart. Database and backups explains it all.

docker compose run --rm stater backup run
docker compose run --rm stater backup list
docker compose stop stater
docker compose run --rm stater backup restore -force latest
docker compose start stater

Upgrading#

  1. Take a backup: docker compose run --rm stater backup run.
  2. Unpack the new bundle over this folder. The tarball never contains .env, secrets/, licence.lic or the volumes, so they are kept.
  3. ./install.sh --upgrade. The servers start on the new image and migrate the database.

Migrations cannot be undone. Going back means restoring the backup from step 1 with the old bundle; see Upgrading.

Removing#

docker compose down stops everything and keeps the data. docker compose down -v also deletes the database and the backups, which cannot be undone.