@connectai/selfhost
One command takes a clean machine (only Docker + Node) to a health-checked
ConnectAI company-brain. No source clone, no local image build.
npx @connectai/selfhost run
Docker + Node
│ npx @connectai/selfhost run
▼
ConnectAI stack (local): api · worker · console · database · vault
│ open /setup, paste your token
▼
Your company brain, served to any agent over MCP
Quick start
-
Boot the stack (pulls prebuilt images, writes a hardened .env, waits for health):
npx @connectai/selfhost run
Quiet by default; add --verbose for the full docker output.
-
Copy the one-time setup token:
npx @connectai/selfhost token
-
Open http://localhost:5273/setup, paste the token, create the first
administrator, confirm inference, and connect a source.
That is the whole happy path. Full operator guide (remote origins, day-2
operations, model right-sizing): https://connai.dev/docs/self-hosting.
Commands
run (default) | pre-flight, materialize assets, write .env, boot the stack, print the next step |
token | print the one-time first-run setup token (or report the instance is already configured) |
logs | tail stack logs (e.g. connectai logs api) |
down | stop the stack (down -v also removes volumes and wipes the brain) |
help / version | usage / version |
Flags
--dir <path> | working directory (default ~/.connectai-selfhost) |
--verbose | stream the full docker output during boot (default: quiet spinner) |
--yes, -y | non-interactive (already the default; accepted for CI) |
--tag <tag> | run a specific release tag (advanced; also CONNECTAI_IMAGE_TAG) |
Requirements
- Docker with the Compose v2 plugin and a running daemon.
- Node >= 18 (for
npx).
- Roughly 8 GB RAM and 10 GB free disk for a comfortable first boot.
Good to know
- The canonical package is
@connectai/selfhost. After npm i -g @connectai/selfhost the connectai and selfhost binaries are aliases; do
not run npx connectai.
- Secrets are generated locally with a CSPRNG, written
chmod 600, never logged and
never transmitted. A second run is idempotent and never overwrites your values.
--dir is also the compose-project boundary, so a non-default dir gets its own
isolated project and down --dir <that-dir> tears down only that install.
- localhost is the v1 target. The prebuilt console bakes its API base URL at
publish time to
http://localhost:4000, which is correct for a same-box eval.
Serving it on a real domain needs extra setup: see
https://connai.dev/docs/self-hosting first.
- The first run downloads several GB of images and can take a few minutes; re-runs
are fast.
License
BUSL-1.1. Development, testing, and evaluation use need no license; production use
requires a commercial license. The self-host runtime guard fail-closes at run time,
so a published image gives away nothing licensed.