Self-hosting dembrane

On this page

There is no supported recipe yet for running the whole platform on your own infrastructure. The repository gives you the code, five Dockerfiles and a working local setup. This page says what the platform needs, how to run it on your machine, and where the gaps are.

Read licensing before you run dembrane in production.

What runs

Five Bun apps, built from dembrane/platform.

App What it does
api The HTTP server for the dashboard, the portal and outside agents.
worker Runs queued jobs and schedules: the audio pipeline, analysis, reports, emails.
media An ffmpeg service. It has no database, no bucket credentials and no secrets.
web Serves the built dashboard and portal, and forwards /api to the API.
migrate A one-shot job that runs before every rollout.

PostgreSQL is the only stateful service the platform itself needs. Jobs, schedules, live updates and rate limits all run on it. There is no Redis, no Directus service, no Python process and no separate agent service.

Run it locally

You need Bun (the version in dembrane/platform/.bun-version), pnpm and Docker.

cd dembrane/platform
bun run setup        # Postgres in docker, dependencies, migrations
bun run dev          # API on :8080
bun --env-file=.env.local apps/worker/src/main.ts   # worker
bun run check        # lint, types, the layer rule, tests
cd dembrane/frontend
pnpm install
pnpm dev             # dashboard on :5173, /api proxied to :8080
pnpm participant:dev # portal on :5174

bun run setup copies .env.example to .env.local when it is missing and adds a generated AUTH_SECRET and INVITE_HASH_SECRET. Then it installs dependencies, starts Postgres 16 with pgvector on host port 5433, applies the migrations and adds the default verification topics.

Without Docker, run Postgres 16 with pgvector yourself on port 5432 and run mprocs from dembrane/. It starts the API, the worker, the dashboard and the portal. The one-time commands are in dembrane/platform/README.md.

What local mode does differently

What a deployment needs

These requirements come from the code.

Need What the code expects
PostgreSQL with pgvector Postgres 16 with pgvector is what the local setup uses. The login that migrates must be able to create the vector extension. Every process connects directly: a transaction-mode pooler breaks the job queue and the live streams.
Two database logins MIGRATION_DATABASE_URL is the owner login for the migrate job. DATABASE_URL is the runtime login. Set APP_DB_ROLE and the migrate job grants that role its data rights.
Object storage Two S3-compatible buckets: files (FILES_S3_*) and audio (STORAGE_S3_*). Outside local and test, the API and the worker refuse to start without both.
ffmpeg Run the media app and set MEDIA_URL, with MEDIA_AUTH=none when it is reachable only inside your cluster. Or put ffmpeg and ffprobe on the PATH of the API and the worker. Their images do not contain ffmpeg.
Language models A Google Cloud project with Vertex AI, and application default credentials. Set LLM_VERTEX_PROJECT.
Email SendGrid: SENDGRID_API_KEY, SENDGRID_REGION, EMAIL_FROM, EMAIL_FROM_NAME.
Secrets AUTH_SECRET (at least 32 characters) and INVITE_HASH_SECRET (at least 16).
Public addresses API_PUBLIC_URL, DASHBOARD_URL, PORTAL_URL.
The frontend The web app serves the built dembrane/frontend, once with WEB_ROLE=dashboard and once with WEB_ROLE=portal. Set WEB_DIST_DIR and WEB_API_ORIGIN. The web image does the build for you.

Every setting is on the configuration page.

Images and rollout

Not documented or not supported

Each of these is the state of the code today, not a plan.

Related pages

Comments