Documentation
Console on Vercel (optional)
You can host the console (landing page, docs, and the /console interface) on Vercel while the API, the worker and PostgreSQL run on a server of yours. This is optional. The Compose deployment already includes the console.
What cannot move to Vercel: the worker and the scheduler. They are long-running processes. The console's /api route on Vercel is only a proxy; it executes no task and keeps no state.
1. Run the backend somewhere persistent
On your server, run postgres, api and worker from the Compose file and publish the API behind TLS. The repository includes that layout ready to use: deploy/docker-compose.api-public.yml adds a Caddy service with automatic certificates, and deploy/install.sh sets a fresh Ubuntu server up in one go (see deploy/README.md):
PCMD_API_DOMAIN=api.agent.example.com PCMD_PUBLIC_ORIGIN=https://console.example.com \
PCMD_PROXY_SECRET='<long random value>' ANTHROPIC_API_KEY='…' bash deploy/install.sh
Whatever proxy you use, the server's .env needs:
PCMD_PUBLIC_ORIGIN=https://console.example.com
PCMD_COOKIE_SECURE=true
PCMD_PROXY_SECRET=<a long random value>
PCMD_PUBLIC_ORIGIN is the address of the console on Vercel. The API accepts state-changing requests from that origin only.
2. Deploy the console
Create a Vercel project from this repository with:
- Root Directory:
apps/web - Framework Preset: Next.js
- Include files outside the Root Directory: enabled (the build reads
/docsand/packages/shared)
Environment variables for the Vercel project:
| Variable | Value |
|---|---|
PCMD_API_ORIGIN | https://api.agent.example.com |
PCMD_PROXY_SECRET | The same value as on the server |
NEXT_PUBLIC_SITE_URL | https://console.example.com (optional; without it the production URL Vercel assigns is used for social-preview links) |
Do not set PCMD_STANDALONE on Vercel. Without PCMD_API_ORIGIN the deployment serves the landing page and the docs, and /console reports Backend offline with the reason.
3. Check it
Open the console. If it shows Backend offline, the proxy cannot reach PCMD_API_ORIGIN: check the URL, TLS and the firewall. That message is the console telling the truth; it never shows sample data in place of a backend.
Things that behave differently
- Event streams. Live updates use server-sent events through the proxy function. Hosting platforms end long requests after their function time limit. The console reconnects on its own and resumes from the last event it received, so nothing is lost; you may see a brief reconnect.
- Client addresses. Vercel sets
X-Forwarded-For, and the API believes it because the proxy presentsPCMD_PROXY_SECRET. - The API is reachable from the internet in this layout. It still requires a session for everything, but keep it patched and keep
PCMD_PROXY_SECRETset.
This layout was not deployed while building this version. The proxy route is exercised locally; the Vercel-specific parts are described from the platform's documented behaviour.