Running the agent with Docker Compose
One file on any box with Docker. Good for a VM, a homelab, or alongside an existing compose.yaml.
1. compose.yaml
services:
pgblame-agent:
image: ghcr.io/liberzon/pgblame-agent:latest
restart: unless-stopped
environment:
PGBLAME_DATABASE_URL: ${PGBLAME_DATABASE_URL}
PGBLAME_TOKEN: ${PGBLAME_TOKEN}
volumes:
- pgblame-data:/home/nonroot/.pgblame
volumes:
pgblame-data:2. .env
Put the secrets next to it in a .env file (Compose loads it automatically — don't commit it):
PGBLAME_DATABASE_URL=postgresql://...
PGBLAME_TOKEN=pgb_...3. Start it
docker compose up -dThe agent ships its first delta after two ticks (~2 minutes).
Notes
- The named volume keeps the delta baseline + retry queue across restarts (recommended). It's mounted at the agent's default
PGBLAME_DATA_DIR(/home/nonroot/.pgblame), so the buffer lands inside it. - Run a single agent per database; don't scale this service.