Configuration
How configuration works
Section titled “How configuration works”Octipus keeps configuration in two places, with a clear split:
- A minimal
.env— only the handful of values needed to boot: which storage mode to use, how to reach the database/cache, and the security keys. Nothing else belongs here. - The database (and encrypted vault) — the source of truth at runtime for everything else: model config and provider keys, channel tokens, workspace paths, agent limits, feature flags, ports, and so on. Edit these under Settings → Configuration in the web UI, or via the API.
The minimal .env
Section titled “The minimal .env”This is the entire .env for a typical install. bun run setup writes it for you
(and generates the three secrets). Copy .env.example if you prefer to do it by hand.
# ── Storage mode ────────────────────────────────────────────# 'embedded' = PGlite + in-memory cache (zero external deps, local dev)# 'external' = PostgreSQL + pgvector + Valkey (production)STORAGE_MODE=external
# ── Database + cache (external mode ONLY — omit for embedded) ─DATABASE_URL=postgresql://octipus:octipus@localhost:5442/octipus# Valkey is Redis-compatible; the var stays REDIS_URL for client compatibility.REDIS_URL=redis://localhost:6379
# ── Security keys (required, ≥ 32 chars — `bun run setup` generates these) ─MASTER_KEY=JWT_SECRET=SESSION_SECRET=
# ── API server (optional — these are the defaults) ──────────API_HOST=127.0.0.1API_PORT=3005| Variable | Required? | Notes |
|---|---|---|
STORAGE_MODE | Yes | embedded or external |
DATABASE_URL | External only | Postgres + pgvector connection string |
REDIS_URL | External only | Valkey/Redis connection string |
MASTER_KEY | Yes | Vault encryption root (AES-256-GCM). Derives per-user data-encryption keys. |
JWT_SECRET | Yes | Signs auth tokens |
SESSION_SECRET | Yes | Signs sessions |
API_HOST / API_PORT | No | Default 127.0.0.1 / 3005. HOST / PORT also accepted. |
DATA_DIR | No | Embedded-mode data dir (default ~/.octipus/data) |
| Service | Default | Set via |
|---|---|---|
| Backend API | 3005 | API_PORT (env, bootstrap) |
| Web UI | 3007 | WEB_PORT (env, bootstrap) |
| PostgreSQL | 5442 → 5432 | repo docker-compose.yml (POSTGRES_PORT) |
| Valkey | 6389 → 6379 | repo docker-compose.yml (REDIS_PORT) |
The container ports above are the repo compose mappings (host → container). When you
run the backend natively (bun run start:all) it listens directly on 3005 / 3007.
Everything else lives in the database
Section titled “Everything else lives in the database”You will not find these in .env — set them in the web UI once Octipus is running:
| Area | Where to set it |
|---|---|
| Models & default model | Models page |
| Provider API keys (OpenAI, Anthropic, Gemini, Grok, DeepSeek, OpenRouter, Voyage) | Encrypted vault (added on the Models / Secrets pages) |
| Channel tokens (Telegram, Slack, Teams, WhatsApp) | Settings → Channels / vault |
| Agent limits (token budget, timeout, iterations) | Settings → Configuration |
| Enabled tools, workspace path | Settings → Configuration |
| Logging level, CORS origins | Settings → Configuration |
| Multi-user flags, org/SSO | Admin pages |
Configuration methods, in short
Section titled “Configuration methods, in short”bun run setup— interactive wizard; writes the minimal.env, registers the admin, optionally wires the first model..env— the minimal bootstrap values above (and, for CI, optional one-time seeds).- Web UI → Settings → Configuration — the canonical place to change anything at runtime.