Requirements
- Docker, or Node.js 20+ with pnpm
- a
.polpo/project directory - access to a model gateway or provider credential
- PostgreSQL only when
storageis set topostgres
Build the Docker image
The open-source repository contains the backend Dockerfile:workspace/.polpo/ project as shown in Local Development, then run:
/app/workspace as WORK_DIR and listens on port 3890.
Runtime and dashboard with Docker Compose
The repository includes a production-oriented Compose example. It keeps PostgreSQL and the runtime on a private network and exposes only the dashboard:docker/self-host/.env. Replace POSTGRES_PASSWORD and POLPO_API_KEY with independent random values, set POLPO_MODEL, and provide the matching model credential. The included example uses AI_GATEWAY_API_KEY for Vercel AI Gateway.
http://localhost:3000. The dashboard proxies runtime REST and completion requests; POLPO_API_KEY stays in the dashboard server process and is not shipped to browser JavaScript.
The example mounts docker/self-host/project.example/polpo.json, uses PostgreSQL for runtime state, and persists the workspace in a Docker volume. DATABASE_URL supplies settings.databaseUrl because it is omitted from the project file.
Stop the stack without deleting data:
--volumes only when you intentionally want to delete the PostgreSQL and workspace volumes.
Verify a checkout end to end
The repository also contains an isolated test stack with a deterministic mock model. It is separate from the production example:Storage backends
For PostgreSQL, set
settings.databaseUrl or DATABASE_URL. File and SQLite storage do not require a database URL.
Model gateway
For the default Vercel gateway, passAI_GATEWAY_API_KEY. To use another OpenAI-compatible endpoint, configure its URL and key variable name in the mounted .polpo/polpo.json:
MY_GATEWAY_API_KEY to the container. There is no AI_GATEWAY_URL server environment variable. See Model Gateway for provider overrides and local endpoints.
Server environment
Provider and custom gateway variables configured by the project must also be present in the server process.
Authentication paths
When either API-key variable is set, chat and standard REST routes accept a Bearer token:x-api-key header is also accepted by standard /api/v1 routes:
Reverse proxy
SSE responses must not be buffered. A minimal nginx location is:sandbox.isolation policy, but the selected host adapter decides whether reuse and fresh map to separate local processes, containers, or another sandbox provider. Self-hosting does not include the managed Cloud sandbox pool, project provisioning, or operational control plane.
The open-source dashboard exposes runtime-scoped views for agents, playground chat, skills, shared memory, files, and sessions. Organization management, billing, managed connections, Cloud provisioning, and other control-plane screens remain Cloud-only.