Run the headless broker
The headless broker is Okashic with no UI, for agents that run on a server. It holds the synced vault, serves the local MCP endpoint your agent connects to, applies credentials in-service, and writes the audit log — the same broker the apps carry, without the screen.
You run it on the machine where your agent runs. If your agent runs on your Mac or phone, the app already carries a broker and you can skip this page — go straight to Agents & MCP.
1. Download the broker
Download the okashic-broker binary for your server’s architecture from your
account, then make it runnable and put it on your path:
chmod +x okashic-brokersudo mv okashic-broker /usr/local/bin/okashic-broker version2. Point it at your account
The broker reads its configuration from the environment. For a server joining an account you already created on your phone or Mac, set the cloud URL and your credentials:
export OKASHIC_CLOUD_URL=https://api.okashic.ioexport OKASHIC_EMAIL=you@example.comexport OKASHIC_PRIMARY_PASSWORD=… # your primary passwordThen join the account. This recovers the shared vault key on this device, the same way a second app does when you sign in:
okashic-broker loginIf you’re setting up a brand-new account from the server instead, set OKASHIC_INVITE to your
invite code and run okashic-broker enroll in place of login.
The vault lives at ~/.okashic/vault.sqlite by default; set OKASHIC_VAULT to move it.
3. Run it
okashic-broker serveserve is also the default, so okashic-broker with no subcommand does the same thing. It
serves the local API and the MCP endpoint on 127.0.0.1:8765 and syncs with the cloud. Leave it
running; the next step points an agent at it.
The endpoint is loopback-only by default, so only processes on this machine can reach it. If
your agent runs in a container, set OKASHIC_LOCAL_HOST to the bridge address the container can
reach (for example 0.0.0.0) and OKASHIC_LOCAL_PORT to change the port — the agent still
authenticates with its API key, so widening the bind doesn’t widen access.
4. Run it as a service
To keep the broker running across reboots, run it under systemd. Put the environment in a root-owned file so the password isn’t in the unit:
OKASHIC_CLOUD_URL=https://api.okashic.ioOKASHIC_EMAIL=you@example.comOKASHIC_PRIMARY_PASSWORD=…A ready-to-copy user unit ships in the repo at clients/broker/okashic-broker.service (with notes on
providing the password as a systemd encrypted credential). The system unit below is equivalent:
[Unit]Description=Okashic headless brokerAfter=network-online.targetWants=network-online.target# Back off a crash-looping start (corrupt vault / failed migration) instead of hammering.StartLimitIntervalSec=300StartLimitBurst=5
[Service]EnvironmentFile=/etc/okashic/broker.envExecStart=/usr/local/bin/okashic-broker serveRestart=on-failureRestartSec=5
[Install]WantedBy=multi-user.targetsudo systemctl daemon-reloadsudo systemctl enable --now okashic-brokersudo systemctl status okashic-brokerNext: connect an agent
With the broker running, create an agent, point its MCP client at http://127.0.0.1:8765/mcp,
and give it a connection. That’s the Agents & MCP walkthrough.
Common commands
okashic-broker runs the service and owns account and vault lifecycle; okashic --help lists
everything. The ones you’ll reach for most:
okashic-broker sync— push local records and pull the account’s newer ones. Writes sync on their own, so this is mostly for an explicit catch-up.okashic-broker connection add …/connection list— manage connections.connectandsession capturecover the browser-based OAuth and website-session logins.okashic-broker audit verify— check the local audit log’s hash chain and signatures.okashic-broker device pair …— link a new device over the channel.
Creating agents and connections is owner work, so it lives in the okashic CLI, which drives
whatever broker is running: okashic agent create, okashic connection add, okashic audit tail, okashic device list. See the Agents & MCP walkthrough.