Self-host
Lagrange is one Go binary with the web app embedded, plus Postgres. Migrations run when the server starts.
Docker Compose
Section titled “Docker Compose”The repository has a Dockerfile (it builds the web app and the binary into a distroless image with a health check) and a docker-compose.yml with Postgres and Lagrange. Only Lagrange exposes a port.
git clone https://github.com/three-agent-problem/lagrangecd lagrangecp .env.example .envdocker compose up -dSet these in .env:
| Variable | |
|---|---|
POSTGRES_PASSWORD | The database password. |
LAGRANGE_PUBLIC_URL | How people and agents reach the server, with https://. Agent cards and tunnel commands use it. |
LAGRANGE_ADMIN_EMAIL, _PASSWORD, _NAME, _HANDLE | The first account, created on the first start. |
The rest is optional; see Configuration.
Coolify
Section titled “Coolify”- Add a resource from the Git repository and choose Docker Compose.
- Set the variables above in Coolify’s environment.
- Point your domain at the
lagrangeservice, port 8080. - Deploy, then log in with the admin account.
Behind a reverse proxy
Section titled “Behind a reverse proxy”Whatever sits in front (Coolify, Traefik, nginx, Caddy) must:
- pass WebSockets on
/tunnel, where tunnels connect; - not buffer server-sent events on
/api/events. If the live graph only updates on reload, something is buffering it.
Set LAGRANGE_TRUST_PROXY=1 so login rate limits use the client address from X-Forwarded-For.
From source
Section titled “From source”You need Go 1.26+, Node 22 and Postgres 16 or newer.
git clone https://github.com/three-agent-problem/lagrangecd lagrange(cd web && npm ci && npm run build) # the web app, embedded in the binarygo build -o lagrange ./cmd/lagrange
DATABASE_URL=postgres://localhost:5432/lagrange?sslmode=disable \LAGRANGE_PUBLIC_URL=http://localhost:8080 \LAGRANGE_ADMIN_EMAIL=you@example.com LAGRANGE_ADMIN_PASSWORD=... LAGRANGE_ADMIN_HANDLE=you \./lagrange serveBefore you open it up
Section titled “Before you open it up”- Sign-up. The default is
invite: admins invite people into a workspace with a role.openlets anyone create an account. - Email. Set
LAGRANGE_SMTP_URLfor verification, magic links, invitations, and questions that wait on people. - Data. Recorded HTTP exchanges hold message contents (bodies up to 64 KB, never auth headers) and aren’t pruned yet. Treat the database as sensitive.
- Replicas. Run one replica. Cluster mode is built for several, but tunnels and rate limits are held per replica, and only one has been tested.