Docs / Self-hosting

Configuration

Configure your self-hosted Datum installation through deploy/.env.

Overview

Datum reads its settings from deploy/.env. Docker Compose also reads this file and passes it to the app container. ocmgr doctor --init creates the file with comments for each variable. ocmgr doctor checks the configured values.

This page covers common settings. deploy/.env.example documents all variables, including connector credentials and performance settings.

Configure

Change a setting

  1. Edit the file

    Open deploy/.env. Set or uncomment the required variable.

    Keep this file private. Never commit it or paste its contents into a message. It contains your database password and keys.

  2. Recreate the app

    Run the following command.

    docker compose -f deploy/docker-compose.yml up -d

    Compose recreates the containers whose settings changed. If you use the tls or events profile, set COMPOSE_PROFILES in deploy/.env so this command includes Caddy and Outpost. See TLS and event delivery.

  3. Check the configuration

    Run doctor.

    docker compose -f deploy/docker-compose.yml exec -T app ocmgr doctor --json

    The env check identifies invalid variables. Its report explains the problem without showing the value.

Run doctor --init again to add variables from a newer release. Follow the command in Install with Docker. The command preserves existing values.

The variables

Database

Variable Purpose
DATABASE_URL Selects the Postgres database. doctor --init uses the bundled db service.
POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB Configure the bundled database. Postgres reads these values only when it creates its volume. Later password changes also require ALTER ROLE. The stack requires a password. Doctor rejects passwords that Datum publishes.
OCMGR_DB_POOL_SIZE Limits connections per process. The default permits 10 for the server, or 4 for the CLI or a standalone worker.

Address and network

Variable Purpose
OCMGR_PUBLIC_URL Defines the address for users and agents, such as https://ocmgr.example.com. Datum derives sign-in cookies and agent identifiers from it. Agents require HTTPS at the host root, without a path. Keep the address stable.
OCMGR_TRUST_PROXY Identifies trusted proxies. Set 1 for one reverse proxy that terminates HTTPS, such as Caddy in the tls profile. Leave it unset without a proxy.
OCMGR_PUBLIC_HOST Names the domain for the tls certificate.
OCMGR_BIND_ADDR, OCMGR_PORT Set the host address and port. The default uses loopback at 127.0.0.1:3000.
OCMGR_EGRESS_PRIVATE Allows or denies connections to private addresses. Self-hosted installations default to allow. See Credentials and security.

Signing in

Variable Purpose
OCMGR_AUTH_SECRET Signs sessions and protects the signing key for agent tokens. Without it, the instance accepts API keys but cannot support sign-in. Preserve this secret. Changing it requires more than routine rotation.
SMTP_URL, OCMGR_MAIL_FROM Configure email for sign-in links and invitations. Example: smtp://user:[email protected]:587. Without email, the app prints sign-in links in its log, and shows each invitation link once to the owner who sends it.
GITHUB_OAUTH_CLIENT_ID, GITHUB_OAUTH_CLIENT_SECRET Enable Continue with GitHub. Create an OAuth app with callback URL <OCMGR_PUBLIC_URL>/auth/callback/github.
SLACK_OAUTH_CLIENT_ID, SLACK_OAUTH_CLIENT_SECRET Enable Continue with Slack. Use redirect URL <OCMGR_PUBLIC_URL>/auth/callback/slack.

These sign-in apps differ from the GitHub and Slack connections that import community data.

Stored credentials

Variable Purpose
OCMGR_MASTER_KEYS Lists encryption keys for stored source credentials, newest first. Back up the keys outside this machine.
OCMGR_ENV_CREDENTIALS Leave this at 0 to use each connection’s encrypted credentials. Setting 1 also allows connector variables such as GITHUB_TOKEN. Use 1 only with a single workspace.
OCMGR_WORKSPACE Sets the default workspace for CLI commands without --workspace.

Files

Variable Purpose
OCMGR_DATA_DIR Stores exports, cached avatars, pieces and local backups. The container uses /data on a Compose volume.
OCMGR_IMPORT_DIR Contains CSV files and Slack export ZIPs for connections from the app or an agent. The default is /data/imports.
OCMGR_EXPORT_TTL_HOURS Sets how long Datum keeps generated exports. The default is 24 hours.

Backups, events, judgment and billing

Variable Purpose
OCMGR_BACKUP_PUBKEY, OCMGR_BACKUP_S3_URL and related variables Configure encrypted backups and external copies. See Backups and restore.
OUTPOST_URL, OUTPOST_API_KEY and other OUTPOST_* values Configure event delivery through the events profile. See TLS and event delivery.
TYPESAFE_API_KEY Enables judgment and thread tone for all workspaces. OCMGR_JUDGMENT_CAP_CALLS sets each feature’s monthly allowance per workspace. The default is 20,000 calls. See Matching settings.
OCMGR_MCP_WRITE Allows a local ocmgr mcp agent to change data when set to 1. Otherwise, the agent has read-only access.
OCMGR_BILLING Leave this unset for a self-hosted instance. The default is off.

FAQ

Where do source tokens go: here or on the connection?

Store tokens on the connection. The vault encrypts them. Environment variables such as GITHUB_TOKEN provide fallback credentials for terminal commands.

I changed OCMGR_PUBLIC_URL. What else changes?

Agents must reconnect because existing tokens reference the previous address. Restart the app. Run doctor to check agent_auth and cookie_security.

Can I keep the file somewhere else?

The bundled Compose file requires deploy/.env. The option -f deploy/docker-compose.yml sets deploy/ as the project directory.