Self-hosted open-source AI agents: four checks decide the install
Self-hosting open-source AI agents comes down to four operational checks: where sessions run, who can sign up, what you back up, and the monthly bill.
Self-hosted open-source AI agents: four checks decide the install
Self-hosted AI agents are agents whose control plane you run: the repository, the shared memory, the accounts and the credentials sit on a machine you administer, and the work itself happens on a cloud computer that calls back to that machine. Anyone can stand that up in an afternoon, and the model choice rarely decides what breaks later. Four checks decide it instead: where sessions run, who can create an account, what you back up, and the monthly cost. Kortix is the open-source CompanyOS: the skills, the company memory and the connectors the agents load sit in a repository you control, while the sessions themselves run on machines in the cloud.
Where the pieces run
Self-hosting Kortix puts the full platform on a server you provide. kortix self-host init writes four files into ~/.config/kortix/self-host/<instance>/: docker-compose.yml, .env, a Caddyfile and updater.sh, and the kortix CLI handles installation, configuration and updates from them. One Compose project, kortix-<instance>, carries the web front end and kortix-api serving /v1; beside those run a standalone llm-gateway, a one-shot kortix-migrate job and a daily kortix-updater. The Supabase distribution sits behind them, pinned by digest, with Caddy in domain mode or cloudflared in tunnel mode. kortix self-host start runs docker compose up on that project.
None of the agent work happens on that server. kortix-api creates a Platinum sandbox with your PLATINUM_API_KEY, and that sandbox reaches the instance over its public API URL; the sessions themselves run there. The box is a control plane and a database, and the compute sits elsewhere. The model is not the part you host either, since the gateway calls providers you already hold keys for. What you host is the system around it.
Reachability decides the rest of the install.
| Mode | Public URLs | Sessions run |
|---|---|---|
| domain | site and API on your own domain | yes |
| tunnel | app on localhost, API on a tunnel URL | yes |
| local | none, every port on loopback | no, the sandbox cannot reach the API |
Domain mode is what production looks like: Caddy terminates TLS on 80 and 443 with an ACME certificate. Local mode is the honest answer to whether you can host an AI agent locally. The stack runs, and the web app answers on http://localhost:13737, but no session starts, because a Platinum sandbox cannot reach an API bound to 127.0.0.1. Tunnel mode suits evaluation on a laptop. The install script's header calls a run without --domain "for evaluation/testing only, not real use".
Before the first start, point A or AAAA records for <domain> and api.<domain> at the server, add a *.p.<domain> wildcard for previews, and leave 80 and 443 reachable. Previews without the wildcard fall back to a path proxy that breaks root-absolute links, and the doctor fails the install.
Sign-up stays open until you close it
One sentence in the self-hosting docs decides whether an install is safe: until you set EMAIL_URL or DISABLE_SIGNUP=true, "anyone who reaches the instance can create a confirmed account for any address, the admin address included". A new instance confirms each sign-up on its own, sending no mail. A domain-mode install is reachable by design, so an install that only ran the bootstrap had this decided for it.
Closing it takes one command and a restart: run kortix self-host env set DISABLE_SIGNUP=true, then kortix self-host start, so the auth service picks the value up. If you would rather have invitations and magic-link sign-in, set a provider connection string in EMAIL_URL; automatic confirmation stops and an address has to prove itself. Sign up as the platform admin first either way, because while sign-up is open, whoever claims an allowlisted address first becomes the admin.
Backups and updates are the part you own
A backup is two places: the instance directory, ~/.config/kortix/self-host/<instance>/, and four named Docker volumes. The directory holds .env with the secrets and the signing keys, volumes/db/data with Postgres, and volumes/storage with stored files. The volumes carry the name kortix-<instance>_<volume> and hold what sits outside the directory: db-config with the Postgres settings and its pgsodium key, kortix-capture-data with the Capture recordings, kortix-caddy-data with the TLS certificates, and kortix-updater-state with the updater status, the deployed version and image history. Stop the stack before you copy, so the database files stay consistent, then start it again:
kortix self-host stop
cd ~
sudo tar -czf kortix-backup.tgz -C ~/.config/kortix/self-host default
for v in db-config kortix-capture-data kortix-caddy-data kortix-updater-state; do
docker run --rm -v "kortix-default_$v":/data -v "$PWD":/backup alpine:3.20 \
tar -czf "/backup/$v.tgz" -C /data .
done
kortix self-host start
Swap default for your instance name. The self-hosting docs carry the reverse loop for a restore.
Two things stay outside this backup: Drive folders and App volumes, which live on Platinum volumes, and each session's /workspace, which lives in the session's sandbox. App volumes keep their own daily snapshots.
A database dump alone is not the backup. API_KEY_SECRET in .env encrypts every stored secret, connector credential and token, so losing it leaves the platform serving while credentials stop decrypting: project secrets read as Undecryptable, a connector call returns credential_undecryptable, and a request that needs a value answers 409 SECRET_UNDECRYPTABLE.
Updates run themselves. kortix-updater fires once a day at 02:00 by default in America/New_York, on the stable channel, the release Kortix promotes after it runs in production. Each run checks free disk space, pulls the tags, migrates and rolls the API, gateway and front end; a failed migration swaps nothing, and the previous version keeps serving. kortix self-host status reports the last outcome and the version change, kortix self-host rollback --release <version> goes back, and --tag pins one version through every daily run.
The doctor verifies the install
kortix self-host doctor runs eight checks and exits 0 when all pass, 1 when one fails.
| Check | Fails when | Fix |
|---|---|---|
| docker | docker --version fails | Install Docker |
| docker-compose | the Compose plugin is missing | Install the Compose plugin |
| compose-config | the rendered Compose file is invalid | Set the value the error names |
| capture-store | no capture-store service, so Capture devices cannot sync | Run kortix self-host update |
| instance-dir | the instance directory moved | Run configure, init, start, update or env set |
| email-url | EMAIL_URL is set but unparsable | Correct the value |
| preview-origins | domain mode has no preview base domain | Add the wildcard record, set the domain |
| open-sign-up | sign-up open, email confirmation off | Set EMAIL_URL or DISABLE_SIGNUP=true |
Two of the eight face outward, and those are the ones installs skip. preview-origins fails a domain-mode instance that never added the wildcard, and open-sign-up fails any public instance where confirmation is off. The rest is hygiene the default handles: only Caddy publishes public ports, .env is written with mode 0600, and connectors refuse private and internal addresses.
What the month costs
Three bills, and the software is not one of them. The first is the server, which needs a public IP, disk for Postgres, storage and two image versions, with 80 and 443 reachable. The docs publish per-service memory defaults rather than a minimum server size. They come to 2 GB each for kortix-api and llm-gateway, a memory default of 512 MB for the frontend, and a fixed 1,280 MB for Postgres.
The second is sandbox compute. Platinum charges for the machines your sessions run on, through the key you set at configure time. The default idle stop is 15 minutes after a turn ends. KORTIX_SANDBOX_AUTOSTOP_MINUTES is the first thing to tune if that bill surprises you. The third is model tokens, charged by the provider you connected. Each project holds its own key, and no managed-models markup sits in between.
Kortix itself costs nothing here. Self-hosting is free, and the managed cloud runs the same platform on someone else's servers, so the software is free either way. The pricing page carries the managed tiers and their prices.
What open source changes about the install
Open source, so the code is there to read, to fork and to audit. The system's definition lives in files you can diff: kortix.yaml and the agent files. On your own server those files are the patch path, and the code behind them tells you what the updater rolls at 02:00 and what the doctor checks.
When not to self-host
Self-hosting costs an afternoon and then a standing commitment. Skip it when one person wants an agent on a laptop for their own files. Local mode runs the stack and starts no sessions. Skip it when the need is chat over documents. A chat interface is far less to own, and the self-hosted workspace comparison covers that field. Skip it when nobody wants to own a server, its patches and its backups, because the managed cloud is the same platform without that work.
The four checks are worth running even if you end up on the cloud. They are questions about the system, and a self-hosted install is the one place you can answer all four from a shell.
Is Kortix free? covers the billing side. The review gate explains what stops agent work before it lands. The self-hosting docs hold every command in full. Kortix is where to start an instance.