Self-hosting
Self-hosting is how you run Reactor for your own apps. Compose is the local cluster. The same image runs on Fly or, with the AWS template, on AWS. Clients do not change when you move: they still use the project host, the anon key, and /auth/v1, /data/v1, /storage/v1, and /fn/v1.
Compose
Section titled “Compose”From the repository root:
docker compose -f deploy/compose/compose.yaml build keysdocker compose -f deploy/compose/compose.yaml up -d| Port | Process |
|---|---|
127.0.0.1:18000 |
Reactor. Console at /console. Health at /health |
127.0.0.1:18001 |
A second Reactor process, same database and bucket |
127.0.0.1:5440 |
Shared Postgres |
127.0.0.1:5441 |
Dedicated-database Postgres |
127.0.0.1:19000 |
S3-compatible blob store |
The keys service writes the JWT private key and exits. Both app containers mount that volume read-only. Function workdirs are separate volumes, so a zip unpacked on one replica is not assumed to exist on the other. The blob store is the source of truth. Invoke unpacks again when the local copy is missing.
base_domain is apps.localhost. A project site is http://{ref}.apps.localhost:18000/. GET /health on port 18000 returns 200 with an empty body when Postgres accepts a query, and 503 when it does not.
First-run setup is the console or reactor setup. Then create a project.
deploy/fly/fly.toml runs the same image in listen mode. place is fly, so the console shows that. PostgREST is on 127.0.0.1:3000 inside the machine. Blobs are S3-compatible storage, not the machine disk. The health check is GET /health.
Secrets (database URL, operator token, storage keys, JWT) stay in the Fly secret store. They are not in the toml file that is committed.
More than one process
Section titled “More than one process”Add replicas when CPU is the limit. They share Postgres and the blob bucket. Nothing in the client URL changes. Add a dedicated database when one project is the limit, by setting that project’s database_url. Callers still use the same host and the same keys.
The AWS layout is the AWS page.
Backup and restore
Section titled “Backup and restore”Dump the control database, including every project schema, and copy the blob bucket. Both are required. A dump without the bucket loses function zips and site files. A bucket without the dump loses users, keys, and row data.
pg_dump --no-owner --no-acl "$DATABASE_URL" > reactor.sqlRestore by loading that file into an empty Postgres, then copying the bucket back to the same key layout. deploy/fly/backup is the Fly job that writes the dump into object storage. It is one way to run the dump, not the only one.