# Deploy on your VPS

ACRE ships as a Node server (Express + WebSocket) plus a static app, packaged with Docker + Caddy. On the box:

```bash
cd ~/acre
cp .env.example .env      # set ACRE_DOMAIN + optional ANTHROPIC_API_KEY
docker compose up -d --build
# app at https://your-domain/app · health at /api/health
```

## Environment

| Env | Purpose |
|---|---|
| `ACRE_DOMAIN` | hostname for auto-HTTPS (omit for IP:port) |
| `ANTHROPIC_API_KEY` | real Claude; without it, deterministic local agents |
| `OPENAI_API_KEY` | use OpenAI instead |
| `ACRE_MODEL` | override the model string |
| `ACRE_AGENT_CLI` | `codex` / `claude` subscription wrapper (gate behind auth) |
| `ACRE_ENABLE_PTY` | `1` to enable web terminals (auth required) |

> On a shared box, front it with a Cloudflare tunnel to a subdomain instead of binding 80/443, and keep data in the mounted volume so the brain survives restarts.

## Verify

```bash
curl https://your-domain/api/health
# {"ok":true,"provider":"anthropic","acres":5}
```

`provider` reflects what's wired: `local` (fallback), `anthropic`/`openai` (key), or `codex-cli`/`claude-cli` (subscription).
