Docs / Self-hosting / About 15 minutes

Install with Docker

Install Datum with Docker Compose on your own machine.

Overview

A self-hosted Datum installation uses two containers. Postgres 17 stores the data. The app container runs the website, API, CLI, connectors and background worker. The settings live in deploy/.env.

You need Docker, the Compose plugin and git. Run these commands from the repository root. The VPS installer completes these tasks on a fresh Ubuntu server.

  1. Build the imagePrepare the app image

    Clone the repository. Open its directory. Build the image with the following commands.

    git clone https://github.com/OCMGR/ocmgr.git && cd ocmgr
    docker build -t ocmgr:local .

    Datum does not yet publish an image. The first build takes a few minutes.

    Done whendocker image ls shows ocmgr:local
  2. Write the settings fileGenerate deploy/.env

    Run ocmgr doctor --init to create the settings file.

    docker run --rm --user "$(id -u):$(id -g)" -v "$PWD/deploy:/env" \
      --entrypoint ocmgr ocmgr:local \
      doctor --init --out /env/.env --json

    The command adds comments and random secret values. It preserves existing values when you run it again.

    Keep the --user flag. On Linux, the container user can differ from the owner of deploy/.

    Add --public-url https://ocmgr.example.com if users will access that address. Otherwise, the command uses http://localhost:3000.

    Copy OCMGR_MASTER_KEYS into your password manager. Copy OCMGR_AUTH_SECRET there too. A restored database needs the master keys to decrypt source credentials.

    Done whendeploy/.env contains the database password, sign-in secret and master key

    Read more: Configuration →

  3. Start the stackStart Postgres and the app

    Start the containers. Check the health endpoint.

    docker compose -f deploy/docker-compose.yml up -d
    curl -s localhost:3000/healthz

    The app applies database migrations before it serves requests. This makes the first start slower. The health endpoint returns {"status":"ok","database":"ok",…} when the app is ready.

    Run docker compose -f deploy/docker-compose.yml logs app if the health check fails.

    The app listens only on 127.0.0.1:3000. Add the TLS profile after this walkthrough to serve the app over HTTPS.

    Done when/healthz returns status ok
  4. Run doctorCheck the installation

    Run the installation checks.

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

    Each check reports ok, failed or skipped. Doctor skips checks for services you have not configured, such as email, backups or source tokens. A skipped check does not indicate a failure.

    Follow each failed check’s hint.

    Done whendoctor reports no failed checks

    Read more: Doctor →

  5. Create a workspaceCreate a workspace for your community

    Create the workspace.

    docker compose -f deploy/docker-compose.yml exec -T app \
      ocmgr workspace create --name "My community" --json

    Copy the returned id. Add OCMGR_WORKSPACE=<id> to deploy/.env to set the default workspace. Run docker compose -f deploy/docker-compose.yml up -d to apply the setting.

    Recover an existing workspace ID with docker compose -f deploy/docker-compose.yml exec -T app ocmgr workspace list --json.

    Until you set the default, pass --workspace <id> with each command.

    Done whenThe command prints the workspace id
  6. Create the first ownerCreate your owner account

    Create the first owner from the terminal.

    docker compose -f deploy/docker-compose.yml exec -T app \
      ocmgr admin user create --email [email protected] --workspace <id> --json

    Open the returned signInUrl in your browser. Keep this link private. Anyone who has it can sign in. It expires shortly and works once. Without email, the command output contains the only copy.

    Invite subsequent users from Settings → Members, or from the terminal:

    docker compose -f deploy/docker-compose.yml exec -T app \
      ocmgr admin user invite --email [email protected] --role member --workspace <id> --json

    Without email, share the returned inviteUrl privately. The recipient accepts in a browser.

    Done whenYou can sign in to your workspace

    Read more: Team and roles →

  7. Set your teamExclude your staff from community counts

    Open Settings → General. Add your company’s email domains under Team email domains before you connect sources.

    You can also set and check the domains from the terminal. This replaces the complete domain list:

    docker compose -f deploy/docker-compose.yml exec -T app \
      ocmgr workspace settings set --team-domains example.com --workspace <id> --json
    docker compose -f deploy/docker-compose.yml exec -T app \
      ocmgr workspace settings show --workspace <id> --json

    Datum uses these domains to exclude your staff from community counts.

    Done whenSettings → General lists your company's domains

    Read more: Workspace settings →

Next