Prerequisites
- Docker and Docker Compose v2+
- Rust 1.92+ (only if building from source outside Docker)
- A configured LLM provider API key (see Local Mode for options)
Docker Compose
The fastest way to self-host is with Docker Compose. This starts the roz server, Postgres 16, NATS with JetStream, and Restate (for durable task workflows) in a single stack.Restate is an open-source (Apache-2.0) durable execution engine. roz uses it for reliable task lifecycle management. It runs as a single Docker container with no external dependencies.
Database Setup
If you are running Postgres outside Docker (or need to run migrations manually), use sqlx:migrations/ directory. Every table has Row Level Security (RLS) enabled — tenant isolation is enforced at the database layer.
Create Your First API Key
After the server is running and migrations are applied, create an API key. You can do this with SQL:roz_sk_<random> and are passed as Authorization: Bearer <key>. Keys do not expire by default — they remain valid until explicitly revoked.
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
DATABASE_URL | Yes | — | Postgres connection string |
NATS_URL | Yes | — | NATS server URL |
ROZ_API_URL | No | http://localhost:8080 | Public-facing URL for the API |
RUST_LOG | No | info | Log level filter |
PORT | No | 8080 | HTTP/gRPC listen port |
Health Check
Verify the server is running:/health endpoint does not require authentication.
gRPC
REST and gRPC are multiplexed on the same port. The server routes requests byContent-Type header — requests with application/grpc go to the tonic gRPC handler, everything else goes to the axum REST router.
gRPC requires HTTP/2. If you are running behind a reverse proxy, make sure it supports HTTP/2 end-to-end.
gRPC reflection is enabled. You can inspect available services with grpcurl:
StartSession— server responds withSessionStartedUserMessage— server streamsTextDeltachunks, ends withTurnCompleteRegisterTools— register MCP tools mid-session
Building from Source
If you prefer to build the server binary directly:target/release/roz-server. Run it with the environment variables above.
Next Steps
- Edge Deployment — deploy the worker binary to robot hardware.
- Roz Cloud — managed hosting (coming soon).
- gRPC API — session protocol and message types.