Environment Variables
Most O.D.I.N. configuration (SMTP, notifications, integrations, branding) is done through the Settings UI and stored in the database. Environment variables are used for Docker-level bootstrapping — secrets, database path, server binding, and a few override options that cannot be changed after container start.
Auto-Generated Secrets
These three secrets are auto-generated on first run if not provided. They are persisted to /data/ inside the volume so they survive container restarts.
If you set these in your compose file, you risk accidentally rotating them on container recreate, which invalidates all existing sessions and encrypted data. Let O.D.I.N. manage them automatically. The only reason to set them manually is for disaster recovery when restoring from a backup.
| Variable | Description | Auto-Generated Path |
|---|---|---|
ENCRYPTION_KEY | Fernet key for encrypting secrets at rest (printer API keys, SMTP passwords, webhook URLs) | /data/.encryption_key |
JWT_SECRET_KEY | HS256 key for signing JWT session tokens | /data/.jwt_secret |
API_KEY | System-level API key for service-to-service auth | Auto-generated if blank |
Server Configuration
| Variable | Default | Description |
|---|---|---|
DATABASE_URL | sqlite:////data/odin.db | SQLite connection string. Do not change the path — it must match the Docker volume mount. |
HOST | 0.0.0.0 | Bind address for the FastAPI server |
PORT | 8000 | Listening port for the web UI and API |
CORS_ORIGINS | http://localhost:8000,http://localhost:3000 | Comma-separated list of allowed CORS origins |
COOKIE_SECURE | true | Set to false for local HTTP development (disables the Secure flag on session cookies) |
COOKIE_SAMESITE | strict | Cookie SameSite policy. Set to lax if your OIDC identity provider is cross-origin. |
ODIN_HOST_IP | Auto-detected | LAN IP used for go2rtc WebRTC ICE candidates. Set explicitly if auto-detection picks the wrong interface or Docker bridge IP. |
TZ | America/New_York | Timezone for log timestamps and scheduler quiet hours |
DEBUG | false | Enable FastAPI debug mode (verbose errors) |
PostgreSQL (Optional)
| Variable | Default | Description |
|---|---|---|
POSTGRES_URL | (none) | PostgreSQL connection string (e.g., postgresql://user:pass@host:5432/odin). When set, O.D.I.N. uses PostgreSQL instead of SQLite. Recommended for farms with 20+ printers or multi-instance deployments. |
MCP Server
| Variable | Default | Description |
|---|---|---|
MCP_ENABLED | false | Enable the built-in Model Context Protocol server. When true, O.D.I.N. exposes an MCP endpoint for AI assistant integration (Claude, GPT, etc.). |
For the standalone odin-print-farm-mcp@2 npm package (recommended for most agent use cases), configure the client-side environment:
| Variable | Required | Description |
|---|---|---|
ODIN_BASE_URL | Yes | Full URL of your O.D.I.N. instance (e.g., http://192.168.1.100:8000). Used by the MCP package to reach your backend. |
ODIN_API_KEY | Yes | Per-user scoped token (odin_... prefix) with scope agent:read or agent:write. See MCP Server. |
ITAR / CMMC Mode
| Variable | Default | Description |
|---|---|---|
ODIN_ITAR_MODE | 0 | Set to 1 to enable fail-closed air-gap mode. O.D.I.N. refuses to boot if any configured outbound destination resolves to a public address; every runtime outbound call (HTTP / SMTP / MQTT) is DNS-pinned and proxy-bypass-proofed. APNs and Web Push are hard-disabled. See ITAR / CMMC Mode. |
OIDC Configuration
| Variable | Default | Description |
|---|---|---|
OIDC_REDIRECT_URI | Derived from request.base_url | Pin the OIDC callback URL when behind a reverse proxy. Example: https://odin.example.com/api/auth/oidc/callback. Required if the auto-detected URL resolves to an internal address. |
Spoolman Integration
| Variable | Default | Description |
|---|---|---|
SPOOLMAN_URL | (none) | Base URL of your Spoolman instance (e.g., http://192.168.1.x:7912). When set, O.D.I.N. syncs filament consumption to Spoolman on print completion. |
Scheduler Configuration
These variables set defaults for the job scheduler. They can also be adjusted in the Settings UI.
| Variable | Default | Description |
|---|---|---|
BLACKOUT_START | 22:30 | Quiet hours start time (24h). Jobs are not dispatched during quiet hours. |
BLACKOUT_END | 05:30 | Quiet hours end time (24h). |
SCHEDULER_HORIZON_DAYS | 7 | How far ahead the scheduler looks when assigning time windows (days). |
Docker Compose Example
The minimal docker-compose.yml from the official installer:
services:
odin:
image: ghcr.io/hughkantsime/odin:latest
container_name: odin
restart: unless-stopped
ports:
- "8000:8000" # Web UI + API
- "1984:1984" # go2rtc API
- "8555:8555" # go2rtc WebRTC
volumes:
- ./odin-data:/data
- ./odin-data/go2rtc:/app/go2rtc
environment:
# Auto-generated on first run if left blank
- ENCRYPTION_KEY=${ENCRYPTION_KEY:-}
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-}
- API_KEY=${API_KEY:-}
- DATABASE_URL=sqlite:////data/odin.db
- CORS_ORIGINS=http://localhost:8000,http://localhost:3000
# Set to your server's LAN IP for WebRTC camera streaming
- ODIN_HOST_IP=${ODIN_HOST_IP:-}
- TZ=${TZ:-America/New_York}
# Optional: PostgreSQL backend (omit to use SQLite)
# - POSTGRES_URL=postgresql://user:pass@host:5432/odin
# Optional: MCP server for AI assistant integration
# - MCP_ENABLED=false
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
See Also
- Installation — full Docker setup guide
- Backup & Restore — protecting your database and secrets
- OIDC / SSO Setup —
OIDC_REDIRECT_URIreverse proxy configuration - Docker Logs & Support Bundle — diagnosing startup issues