// docs / configuration

Configuration

Openflow reads its configuration from a single .env file at /opt/openflow/.env. The manager reads all of it; instance containers receive only the subset they need, injected as environment variables at create time.

The .env file

The format is the conventional one: KEY=value per line, no shell quoting around values, comments with #. Values containing spaces are passed through as-is. .env.example in the repository is the canonical reference; copy it and fill in the blanks.

Manager keys

Read once at startup. Changing any of these requires a manager restart.

keydefaultpurpose
DATABASE_URLrequiredPostgres connection string
ROOT_DOMAINrequiredapex domain, e.g. example.com
MANAGER_URLrequiredfull URL the manager is served at; instance URLs derive from this
SESSION_SECRETrequired64-byte random; signs session cookies
JWT_SECRETrequired64-byte random; signs instance capability tokens
PORT4071HTTP listener port
NODE_ENVproductionset to development for the dev-login route
DATA_PATH./datawhere instance /data bind mounts live on the host
BACKUP_PATH./data/backupswhere scheduled backup tarballs land
PORT_RANGE_START10000first host port handed out to instance containers
PORT_RANGE_END11000last host port

Optional integrations

ANTHROPIC_API_KEYunsetenables the in-editor AI assistant
AUDIT_SUMMARY_ENABLEDfalseenables LLM-summarized audit log prose
AUDIT_SUMMARY_MODELclaude-haiku-4-5model used by the audit summarizer
AUDIT_SUMMARY_DAILY_TOKEN_BUDGET2000000safety budget for the summarizer
GOOGLE_OAUTH_CLIENT_IDunsetenables Google sign-in
GOOGLE_OAUTH_CLIENT_SECRETunsetpaired with the above

Per-instance keys

Some values aren't read from .env at all but live on the instances row in Postgres, set through the dashboard's instance settings. They're injected into the container at create time, prefixed with OPENFLOW_.

injected assource
OPENFLOW_INSTANCE_IDthe instance row id
OPENFLOW_SUBDOMAINthe instance's subdomain slug
OPENFLOW_AUTH_URLderived from MANAGER_URL
OPENFLOW_MAGIC_TOKENper-instance master token, generated at create
OPENFLOW_MQTT_HOST / _PORTthe shared EMQX broker
OPENFLOW_MQTT_USERNAME / _PASSWORDper-instance credentials, auto-provisioned
OPENFLOW_MQTT_TOPIC_PREFIXproject mountpoint, e.g. openflow/<projectId>/
OPENFLOW_CREDENTIAL_SECRETonly set on migrated instances, decrypts their flows_cred.json
OPENFLOW_PALETTEspace-separated npm specs the entrypoint installs before start

User-defined env vars

Per-instance, set through the dashboard. The container receives them verbatim. Reserved prefixes (OPENFLOW_, PATH, HOME, TZ, NODE_PATH) are silently filtered to prevent shadowing platform configuration.

Secrets

  • SESSION_SECRET and JWT_SECRET should be 64 raw bytes each, generated once at install. Rotating either of them invalidates all sessions and all in-flight instance capability tokens. Plan for it.
  • ANTHROPIC_API_KEY can be set in the manager .env or via the admin Settings tab. The Settings tab overrides the env var when both are set.
  • Database credentials are part of DATABASE_URL. The manager doesn't accept them as separate keys.

Applying changes

  • Manager-level keys take effect on the next process start: systemctl restart openflow
  • Per-instance keys (palette, user env vars, resource limits) take effect on the next container start. The dashboard surfaces a "Restart needed" indicator after edits that require it.
  • Some keys (e.g. ROOT_DOMAIN change) also require a client rebuild AND a wildcard cert that covers both the apex and *.<new-root>. See install for the cert dance.