Skip to content
briefkastencloud

self-host

Run briefkasten yourself

The gateway is open source and the hosted service runs the same code. Self-hosting is a first-class way to use briefkasten, not a teaser: modes are presets, not forks, so the CLI, the API and the MCP tools are the same everywhere.

Three modes: one app, your projects, or many tenants

single
Tenants
one, implicit
Config
one file
Hook URL
/hooks/<source>
For
one app, one server
personal
Tenants
one owner, N projects
Config
one file, projects: {}
Hook URL
/hooks/<project>/<source>
For
you, your side projects, your homelab
multi
Tenants
many
Config
a config store (pulled)
Hook URL
/t/<tenant>/hooks/<project>/<source>
For
a team platform, or a hosted service like this one

Set up a gateway and receive the first event

Write the config with the CLI (or by hand, it's a file you can review in a pull request), start the server, and point the same CLI at it. Switching targets works like kubectl contexts.

On a server with no browser: briefkasten login with an email code, a device code you approve from your phone, or a token in BRIEFKASTEN_TOKEN.

Apps connect the same way with the TypeScript SDK: connect({ url: "https://hooks.example.com", token }). Or skip the gateway and run briefkasten inside your app.

~/hooks
$ briefkasten init --mode personal
$ briefkasten project add acme-shop
$ briefkasten source add nightwatch --project acme-shop
hook url https://hooks.example.com/hooks/acme-shop/nightwatch
$ briefkasten token create --project acme-shop --name my-server
$ briefkasten server --port 8080
# elsewhere
$ briefkasten use https://hooks.example.com
$ briefkasten events --follow

Choose the database, mail and other services

Each outside service sits behind an interface with several adapters. The defaults work as they are.

Runtime
Node, or a Cloudflare Worker with a Durable Object per tenant
Event store
memory ring, SQLite, Durable Object SQLite
Transport
WebSocket (hibernating on Cloudflare) and SSE
Config
a file, a directory, or a pulled store (KV, D1, HTTP)
Secrets
env, a file with mode 600, an encrypted store
Mail (for login codes)
Resend, Cloudflare Email Sending, console, SMTP
Metering
none, counters in the event store, Analytics Engine
Source adapters
github, linear, nightwatch, posthog, sentry, generic

Switch between hosted and self-hosted with one command

$ briefkasten use https://briefkasten.fabrik.computer

Hosted to self-hosted, or back. The CLI keeps a credential per target, so you can manage both from the same terminal.