Skip to content

Environment variables

The complete list of env vars the host reads. All come from .env.<env> (loaded via scripts/load-env.sh) — the host doesn’t read environment variables outside that flow.

VarPurposeNotes
DATABASE_URLPostgres connection stringName MUST end with _dev / _staging / _prod so the reset guardrail classifies it
HOST_MASTER_KEY32-byte hex AES-256-GCM keyGenerate with ./scripts/gen-secret.sh 32. Different per env. Host refuses to boot without it.
OPENCLAW_GATEWAY_PASSWORDBearer token for the OpenClaw gatewayMust match ~/.openclaw/config.toml. See OpenClaw setup
VarDefaultPurpose
HOST::Bind address. Dual-stack default works for both IPv4 + IPv6 + Tailscale
PORT3000HTTP port
VarDefaultPurpose
OPENCLAW_GATEWAY_URLhttp://localhost:18789Gateway address. Override only for non-default ports
OPENCLAW_WORKSPACE_DIR~/.openclaw/workspaceWhere the dream-cycle reads DREAMS.md from
OPENCLAW_CONFIG_PATH<repo>/openclaw.config.jsonCarabase’s own MCP-server config for OpenClaw to consume
VarDefaultPurpose
DEFAULT_WORKSPACE_ID(unset)When set, enables the cron schedulers (GitHub sync, calendar sync, memory distillation, etc.). Background workers stay dormant without it.
HOST_FILE_WATCHER0Set to 1 for headless deployments without the desktop client. Enables the chokidar file watcher for local markdown / calendar files

Optional — LLM bootstrap (background work only)

Section titled “Optional — LLM bootstrap (background work only)”

The chat path goes through OpenClaw’s own model config — see OpenClaw setup. These env vars are read by background workers (harvest, embeddings, summary) as a fallback for when model routing isn’t yet configured in the Admin SPA.

VarPurpose
OPENAI_API_KEYOpenAI key for utility-* tiers + embeddings
OPENROUTER_API_KEYOpenRouter key (alternative to OpenAI)
OLLAMA_URLLocal Ollama server (alternative to a hosted provider)
EMBEDDING_MODELOverride the default embedding model
LLM_MODELOverride the default chat model
EMBEDDING_DIMENSIONSVector dim. Default 4096. Change requires a migration regen

These are scheduled to move to a deprecation warning once the first-run wizard handles model routing more aggressively.

VarPurpose
HARVEST_LLM_PROVIDERollama / openai / openrouter for the harvest pipeline
HARVEST_LLM_MODELModel for entity extraction
HARVEST_CONCURRENCYMax parallel harvest jobs (default 3)
WHISPER_PROVIDERVoice transcription provider (auto-detected if blank)
WHISPER_MODELTranscription model name
DISTILL_LLM_PROVIDER / DISTILL_LLM_MODELMemory-distillation overrides
BRIDGE_LLM_PROVIDER / BRIDGE_LLM_MODELMemory-graph bridge overrides
GITHUB_REPOSComma-separated owner/repo list for GitHub sync (sync-rules supersede this)
GOOGLE_CALENDAR_IDCalendar to sync (default primary)
HARVESTER_DEVICE_AUTH_REQUIREDStrict mode for edge harvester push auth (default off)

These USED to be honored as fallbacks but were ripped out for the OSS launch:

  • GITHUB_OAUTH_CLIENT_ID — store in encrypted oauth_apps table via Admin SPA → OAuth Apps
  • GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET — same
  • GITHUB_TOKEN — populated by GitHub device-flow OAuth into the integrations table
  • GOOGLE_CALENDAR_TOKEN — populated by Google OAuth into integrations

If you have any of these set in a leftover .env.<env>, the host returns 503 Not Configured on the affected auth route with a message pointing you at the correct config surface.