key0ai/key0 image is published to Docker Hub on every release. It bundles the Key0 server, the setup UI, and a health check endpoint — everything you need to run Key0 without installing Node or Bun.
Image tags
Pin to a specific semver tag (e.g.
key0ai/key0:1.2.3) in production to avoid unexpected upgrades.Quick start
- docker run
- Docker Compose
Run Key0 with a single command. You provide your own Redis and Postgres URLs.The server starts on port 3000. If required configuration is missing, the server redirects to
/setup — a browser-based UI where you can configure your wallet address, pricing plans, storage, and other settings. Once saved, the server restarts automatically with your configuration applied. You can revisit /setup at any time to reconfigure.Compose profiles
Docker Compose profiles let you choose how much infrastructure Key0 manages for you.Managed infrastructure is auto-detected at startup via DNS resolution. The
KEY0_MANAGED_INFRA environment variable is optional and only needed as an explicit override.Compose file reference
The fulldocker-compose.yml ships in the docker/ directory of the repository.
Download docker-compose.yml
docker-compose.yml
Services
Volumes
To reset all persisted state and start fresh:
Environment variables
Pass environment variables via-e flags, an env_file, or shell exports that Docker Compose reads automatically.
For the full list of Key0 application-level environment variables (wallet address, network, JWT secrets, etc.), see the Environment Variables page.
Per-Request Proxy Mode
SetPROXY_TO_BASE_URL to enable pay-per-call gateway mode. After a paid route purchase is verified, Key0 proxies the request to this base URL and returns the backend response directly to the agent — no ISSUE_TOKEN_API call is made for route-based purchases.
PROXY_TO_BASE_URL description, and the PPR Standalone example for a complete walkthrough.
Health check
The Key0 container includes a built-in health check that pollsGET /health every 30 seconds.
Building from source
To build the image locally instead of pulling from Docker Hub:Networking tips
The Compose file mapshost.docker.internal to the host gateway. This lets the Key0 container reach services running on your host machine (e.g. a local Redis or Postgres instance) using host.docker.internal as the hostname.

