Skip to content

Quick start

This guide brings up a burrowDB cluster on your laptop: PostgreSQL, pgbouncer, MinIO, three API replicas, a cron worker and an nginx edge, all in Docker. It takes a few minutes the first time (building the image) and about 30 seconds after that.

What you need

  • Docker with Compose (docker compose version).
  • The burrow CLI (below).

1. Install the CLI

Download the burrow binary for your platform from the latest release and put it on your PATH. On macOS with Apple silicon, for example:

curl -fsSL https://github.com/test-zeus-ai/burrowdb/releases/download/v0.1.1/burrow_v0.1.1_darwin_arm64.tar.gz | tar -xz
sudo mv burrow_v0.1.1_darwin_arm64/burrow /usr/local/bin/
burrow --version

Archives exist for linux and darwin (amd64, arm64) and windows_amd64 (zip). checksums.txt in the release is signed with cosign.

Or build it from a checkout (Go 1.27 or later):

git clone https://github.com/test-zeus-ai/burrowdb && cd burrowdb
go build -o ~/bin/burrow ./cmd/burrow      # any directory on your PATH

go install github.com/test-zeus-ai/burrowdb/cmd/burrow@latest does not work: the module points the PocketBase and dbx modules at the forks in engine/ and dbx/ with replace directives.

2. Bring up the stack

burrow up local --replicas 3

burrow up pulls ghcr.io/test-zeus-ai/burrowdb at the CLI's own version. From a checkout, --source . builds the image burrowdb:local instead.

What happens:

  1. The Compose project is written to ~/.burrow/stacks/local (--dir to change it), with a .env file of generated secrets (mode 0600). Running burrow up local again keeps those secrets.
  2. PostgreSQL 17, pgbouncer and MinIO start. On its first start PostgreSQL creates the role burrow (LOGIN CREATEDB, not a superuser) that every burrow process connects as. MinIO gets two buckets: burrow for files and burrow-backups for backups.
  3. The migrate service runs burrow migrate once: it creates the burrow_data and burrow_aux databases, applies the migrations, writes the settings from the environment (S3, backups, app URL) and creates the superuser.
  4. Three api replicas and one worker start. The nginx edge on 127.0.0.1:8090 spreads requests over the API replicas.
  5. burrow up waits until /readyz answers 200 through the edge, then prints:
{
  "dashboard": "http://127.0.0.1:8090/_/",
  "next": "BURROW_PASSWORD=... burrow login --url http://127.0.0.1:8090 --email admin@burrow.local",
  "password": "in /Users/you/.burrow/stacks/local/.env (BURROW_SUPERUSER_PASSWORD)",
  "replicas": 3,
  "stackDir": "/Users/you/.burrow/stacks/local",
  "superuser": "admin@burrow.local",
  "url": "http://127.0.0.1:8090"
}

Use --port for another local port.

3. Sign in

export BURROW_URL=http://127.0.0.1:8090
grep BURROW_SUPERUSER_PASSWORD ~/.burrow/stacks/local/.env | cut -d= -f2- | burrow login --email admin@burrow.local --password-stdin

The generated password is in the stack's .env file; the CLI never prints it. burrow login reads the password from stdin with --password-stdin or from BURROW_PASSWORD. The token is stored in ~/.burrow/credentials.json (mode 0600).

burrow status     # health, readiness, role and version of the replica that answered
burrow doctor     # what a cluster needs: S3 files, SMTP, scheduled backups, app URL

On the local stack doctor reports SMTP as not configured. Everything else should be ok.

4. Use it like PocketBase

Open the dashboard at http://127.0.0.1:8090/_/ and sign in with the same superuser. Or from the CLI:

burrow collections create '{"name":"posts","type":"base","listRule":"","viewRule":"",
  "fields":[{"name":"title","type":"text","required":true},{"name":"published","type":"bool"}]}'
burrow records create posts '{"title":"hello from burrowDB","published":true}'
burrow records list posts --filter 'published = true'

In another terminal, watch changes arrive. The subscription lands on one replica; the next write may land on another, and the event still arrives:

burrow realtime watch posts

Any PocketBase SDK works against http://127.0.0.1:8090:

import PocketBase from "pocketbase";
const pb = new PocketBase("http://127.0.0.1:8090");
const posts = await pb.collection("posts").getList(1, 20, { filter: "published = true" });

5. Hooks and migrations

The stack mounts ~/.burrow/stacks/local/pb_hooks and pb_migrations into every replica, read-only. Put *.pb.js files there and restart the replicas:

cd ~/.burrow/stacks/local
docker compose -p burrowdb restart api worker

New migrations are applied by the migrate step: docker compose -p burrowdb up migrate. Read Hooks at scale before writing hooks that send mail or call other services: every API replica loads them.

6. Stop or remove

burrow down local                      # stop; data stays in Docker volumes
burrow down local --volumes --yes      # stop and delete the database and files

Next