This is the order for standing up one managed, single-tenant kharon deploy: one broker, one customer vault, one gateway hostname and one owner hostname, with the agent connecting over WebSocket through the tunnel (path B, no VPN). Each step points at the section of the deployment guide or the compose README that holds the detail. This page doesn't repeat that detail. Where the guide doesn't cover a step yet, the step says so and names the issue tracking it.
Work from a tagged release, not a branch.
Who does what
- Operator. Runs the broker box and has its shell. Never learns the master password, unless the customer chooses a CLI unlock.
- Customer. Owns the Bitwarden vault and the passkey. The guide calls this person "the owner".
- Zone admin. Holds the Cloudflare account for the zone (for
example
twkr.io), and applies every Cloudflare-side change: the tunnel, its routes, DNS, WAF, rate-limit and Access rules. The guide says "the owner" for these too. - Agent host. Whoever runs the agent's runtime and its connector. That may be the customer's own machine, or a third party's hosted runtime that neither the operator nor the customer has a shell on. The operator hands it the agent token, the tunnel credential and the pin out of band.
Required steps must be done before the deploy carries anyone but a short pilot. Optional steps depend on the deploy's shape.
The examples use kharon.example.com (gateway) and
kharon-owner.example.com (owner UI). Use the customer's own names:
two hostnames, the owner UI on its own hostname, not a path under
the gateway's.
- Required. Pick the names and the shape (operator). Pick the gateway
hostname and the owner hostname, and the agent id, for example
assistant. Pick an ntfy server and a private topic, which carry approvals and the off-host audit checkpoints. Decide whether the deploy uses dashboard Connect ([oauth]) and Cloudflare Access. Background:- Two modes (always public mode on a managed deploy);
- Where cloudflared runs (option 1, the compose
edgeprofile, is the default); - Over WebSocket, through the public gateway.
- Required. Provision the box (operator). The rest of this runbook
uses the Compose package: a Linux VM with Docker Engine and the
Compose plugin (
docker compose), and a checkout of the release. OS notes, what this repo does and doesn't say about VM size and the Docker install, and the host-networked unit the pilot runs (the user,memlock,data_dir) are in Host install. - Required. Build the image (operator):
docker compose build kharonindeploy/compose. See the compose README, Run it.
- Required. Generate the kharon account's master password (customer,
on their own machine, with
kharon init). Whoever runsinitsees the password. See The kharon account and its master password, step 1. - Required. Create the account, organization, collection and API key
(customer). See steps 2–4 of the same section, and
Customer vault onboarding for the Bitwarden
web-app steps: the organization plan, the collection, inviting and
confirming the dedicated account, where
organization_idandcollection_idsare, the API key JSON, moving the logins kharon may fill into that collection, and URI match. - Required. Hand over the API key file, the account email, and the organization and collection IDs (customer to operator), out of band: never in a shared channel. The master password is never handed over.
- Required. Install the API key file as
deploy/compose/secrets/kharon_bw_api_key.json, owned by uid 10001, mode0400(operator). See step 4 of the kharon account and the compose README.
- Required. Mint the agent token (operator, in an interactive
terminal):
kharon token mint <id>. The hash goes in the config. The token goes only to the agent's own secret store. See Agent tokens. - Required. Mint the tunnel credential (operator):
kharon tunnel mint <id>. Its hash goes in the config asconnector_token_hash, and the credential goes only to the agent host's connector. See Path (B) broker. - Required. Make the
[connector]certificate and key, mount them, and computeBROKER_PIN(operator). Mount read-only, with the key owned by uid 10001 at mode0400, throughdocker-compose.override.yml.BROKER_PINis the SHA-256 of the certificate's DER. See Path (B) broker and Over WebSocket.
-
Required. Set up the ntfy topic before the first start (operator, with the customer). The topic carries approval prompts and the off-host audit checkpoints, and kharond starts pushing checkpoints the moment it starts. If the checkpoint keeper is not someone who may approve, use two topics: an approval topic and a checkpoint topic (
[audit] checkpoint_ntfy, step 12), so the keeper never reads a prompt:- Create the private topic's users on the ntfy server: a
write-only user whose token goes in kharond's
token_file(step 12), and a read-only user for each subscriber. The checkpoint keeper uses its user's token; the phone signs in with its user. Never reuse kharond's write token for a subscriber. With two topics, each topic gets its own write-only user and token file, the keeper's user reads only the checkpoint topic, and the phone's user reads only the approval topic. - Name who keeps the checkpoint stream. On a managed deploy that is the operator, unless the customer chooses to keep it. Start saving it off the broker host (a subscriber on another machine, or the ntfy server's own retention) before step 19, so the stream step 27 verifies is complete from the first checkpoint. On one topic the keeper can approve, since every reader of the approval topic can; on a managed deploy the operator can approve from the CLI anyway. With two topics the keeper reads checkpoints only and cannot.
- If approvals go through ntfy, the customer subscribes to the topic in the ntfy app on their phone and signs in as their read-only user (username and password).
See Setting up the ntfy topic for the tokens, the subscriber and the phone, and A separate checkpoint topic for the two-topic setup. Background: Audit checkpoints off-host and ntfy approve and deny.
- Create the private topic's users on the ntfy server: a
write-only user whose token goes in kharond's
-
Required. Write
kharon.tomlfromkharon.toml.example(operator). It needs:[bitwarden]: server, email, API key file, org and collection IDs.[agents.<id>]:token_hash,connector_token_hash, andcdp = { endpoint = "ws://127.0.0.1:9222", via = "agent_connector" }.[connector]:websocket = trueand the TLS files, with nolisten.[public_ingress]:listen = "127.0.0.1:8790"andpublic_host(required when published). See the[public_ingress]listener.[approval].ntfy: withtoken_fileholding the write token from step 11. With two topics, also[audit] checkpoint_ntfywith the checkpoint topic and its owntoken_file. See Audit checkpoints off-host and ntfy approve and deny.[owner_ui]:listen = "127.0.0.1:8788"andpublic_origin = "https://kharon-owner.example.com". See Publishing the owner UI, steps 1–2.- Optional,
[oauth] clients: for dashboard Connect. See OAuth discovery and Connect endpoints. - Optional,
[owner_ui.access]: only after the Access application exists (step 18).
-
Required. Check it (operator):
docker compose run --rm kharon --check --config /etc/kharon.toml(the example's header). kharond refuses unsafe combinations by name.
- Required. Create the tunnel and the gateway routes:
^/mcp$and^/connector$tohttp://127.0.0.1:8790, and a 404 catch-all. With[oauth], also the two.well-known/oauth-protected-resourceroutes. The dashboard creates the proxied DNS record. See Creating the tunnel (owner). - Required. Put the tunnel token in place (zone admin to operator,
never echoed or in argv):
secrets/cloudflared_tunnel_token, owned by65532:65532, mode0400. See Creating the tunnel and the compose README. - Required. Add the owner hostname route to
http://127.0.0.1:8788, with an empty path, no HTTP Host Header and no HTTP/2 to origin. Then apply the Cloudflare settings that keep the throttle working. See Publishing the owner UI, steps 3–4. - Required. Add the
/connectorrate-limit rule, Free or Pro form. See Per-customer deploy checklist. It's verified in step 22. - Optional.
- The WAF rules and the
/mcprate limit: see Optional: WAF and the/mcprate limit. - Cloudflare Access in front of the owner hostname, including the
ntfy bypass application (step 5 there) and, with
[oauth], the OAuth bypass (step 6 there): see Optional: Cloudflare Access in front. Then add[owner_ui.access]to the config.
- The WAF rules and the
- Required. Start the stack (operator):
COMPOSE_PROFILES=edgein.env, thendocker compose up -d. See Running it and What the example sets. The startup lines should say public mode for the owner UI andPOST /mcp and GET /connectorfor public ingress. Restart the whole stack, never theholderalone. - Required. Enrol the customer's passkey (customer and operator
together). The customer opens
/enrollfirst. The operator runskharon passkey-enrolland sends the 43-character code as a message the customer can paste from. It works once, for 120 seconds. Then check the owner UI answers200. See Publishing the owner UI, steps 5–6. - Required. Unlock (customer, from a bookmark of the owner
hostname). See
Unlocking from the browser.
After every restart and idle lock the broker is
locked. That is its normal resting state, not a fault.
-
Required. Run the checks (operator, from outside the broker host; the zone admin fixes anything Cloudflare-side that fails):
- Verifying: every other path is
404at the edge, andPOST /mcpwithout a token is401. - Checks on the first live deploy: the owner UI's Host check and Access.
- The
/connectorburst check in the rate-limit checklist. kharon statusshows no growingrequests without a usable CF-Connecting-IPcounter. See Watching it.
A checked-in script for these is tracked in #290.
- Verifying: every other path is
- Required. Install the connector (agent host, with what the
operator hands over): path B with
BROKER_URL=wss://kharon.example.com/connector, theBROKER_PINfrom step 10, the agent id, and the tunnel credential file from step 9, delivered out of band at mode0400. Run--checkonce with the service stopped, then expectagent connector attached: … transport=wsin kharond's log. See Agent host, Path (B) — agent-connector and Connector config over WebSocket. For hosted or root agent runtimes that can't runprovision-connector.sh, and for handing secrets to a runtime you have no shell on, see Agent side: hosted and root runtimes. - Required. Point the agent's MCP client at the gateway (agent
host):
POST https://kharon.example.com/mcp, with the agent token from step 8 as a bearer token. Apply the agent harness policy, and see Running the agent for the idle lock andkharon_contextafter an unlock. A worked client config is in MCP client. The tool schemas aredocs/api/mcp-tools.json.
-
Optional.
- The dashboard's operator publishes its client metadata document,
and its URL is listed in
[oauth] clients(step 12). - The customer clicks Connect in the dashboard and approves on the owner hostname with the passkey.
- The Connect then appears on the Connections page.
See OAuth discovery and Connect endpoints and Connections, Disconnect and panic. A Connect authorizes
/mcponly. A hosted dashboard runtime that fills still uses a hand-provisioned connector (steps 8–10 and 23) until #235. - The dashboard's operator publishes its client metadata document,
and its URL is listed in
- Required. Do one real fill end to end (agent host and customer): the agent asks for a grant, the customer approves on the owner UI (or through ntfy, step 11), and the fill lands in the agent host's browser through the connector. Then run the canary sweep and the filesystem check against REQ-GOAL-002 (SPEC §1) (agent host, with the operator). The live procedure, as #201 ran it, isn't in the repo yet; it's tracked in #290. Never paste a canary value into chat, a command line or an agent's context.
- Required. Verify the audit chain against the saved ntfy
checkpoint stream (whoever keeps it, step 11, hands the saved file
to the operator, who runs this on the broker):
kharon audit verify --data /data/audit --checkpoints <file>. See Audit checkpoints off-host and the compose README.
- Required. Walk the customer through it (operator, with the customer):
- Bookmark the owner hostname, and save a Bitwarden login item for it with URI match Host. See Unlocking from the browser.
- Open the Passkeys page together and confirm it lists only the
customer's own passkey. On a managed deploy the operator can
enrol a passkey too, and the audit log records it on
web_uijust like the customer's own (#249), so this page is the customer's real check. - What panic does, including that it ends every Connect. See Connections, Disconnect and panic.
- What to do with a lost passkey or after being throttled. See A lost passkey and The throttle, and getting back in.
- Required. Set up alerts, backup and rotation (operator). The
alerts are the connector outage line, the
CF-Connecting-IPcounter and the checkpoint subscriber; the list is Alerts. Backup and restore of/data, upgrades, and the secrets inventory are in Data backup, restore and upgrade and Secrets inventory.
To take the deploy off the internet again, see Rollback.