KlatchDocsGet early access

Install Klatch

The short way: one command on a fresh server. The long way (below) is the same steps by hand.

What you need

The command

curl -fsSL https://klatch.dev/install.sh | sudo sh -s -- --domain klatch.yourdomain.com

Options: --domain NAME (HTTPS, set up automatically), --yes (do not ask questions, needed when there is no terminal), --version TAG, --dry-run (show what would happen and change nothing).

What it does, in order:

  1. Checks the system and CPU, and that there is free disk.
  2. Asks before installing Docker with Docker's own script (https://get.docker.com), if Docker is missing.
  3. Creates /opt/klatch with a .env (new random secrets, mode 600) and a data folder.
  4. Pulls the Klatch hub image and takes compose.yml, the klatch command and the agent recipe out of it.
  5. Creates the klatch-agents Docker network. It is internal: containers on it have no route to the internet.
  6. Builds the agent image on your server. It contains Claude Code and the other agent tools, which we are not allowed to hand out ready-made, so each server installs them itself. The first install takes a few extra minutes.
  7. Starts Klatch (with Caddy for HTTPS when you gave a domain) and waits until it answers.
  8. Prints the setup address.

Running it again is the upgrade path: on an existing install it runs klatch update --version <tag> (default latest), which takes a backup first, so klatch rollback can undo it. Your .env and data are kept. --domain is ignored on an existing install.

The panel's machine binding reads the host's /etc/machine-id, which both compose files mount read-only into the hub as /etc/host-machine-id. Compose cannot mount a file conditionally, so install.sh (and klatch update) create /etc/machine-id with systemd-machine-id-setup when a server has none.

On a Mac

Run it as yourself, without sudo:

curl -fsSL https://klatch.dev/install.sh | sh

It installs into ~/Klatch, offers to install OrbStack with Homebrew if there is no Docker yet, puts the klatch command in Homebrew's bin (or ~/.local/bin), and opens the panel at http://localhost:8080. --domain is for servers only. Agents work only while the Mac is awake: keep it plugged in and stop it sleeping, or use a server for a team that works around the clock.

First run in the browser

Open the address the installer printed. It ends in #setup= and a token; the token proves you are the person who installed it, and it is used once. If you lost it: cat /opt/klatch/data/setup-token (it is deleted once the owner account exists).

Four steps, each can go back:

  1. Owner. Choose a password (8 or more characters). Optionally add an authenticator app.
  2. AI account. Pick Claude, Codex or Antigravity, enter the key, press Check. You can skip and do it later in Settings.
  3. First project. A name and the HTTPS URL of a git repo, with an access token that may push. You can skip this too.
  4. License. Paste your key. Without a valid license the team does not start new turns; reading and approving keep working.

If you did not use --domain, the panel only listens on the server itself. From your own computer:

ssh -L 8080:127.0.0.1:8080 you@your-server

then open http://127.0.0.1:8080.

Checking it

klatch status
klatch doctor

doctor prints ok, warn or FAIL for Docker, disk, the agent network, ports, DNS and HTTPS, your license, and whether the agent image works.

By hand

If you would rather not run a script: install Docker, then create /opt/klatch, put the deploy/compose.yml from this repository there, make a .env (see .env.example; set AUTH_MODE=password, and a 64-character hex KLATCH_SECRET_KEY), create the network with docker network create --internal --subnet 172.30.0.0/24 klatch-agents, build the agent image with docker build -t klatch-runner:2.1.312 runner/, and run docker compose up -d.

Without a domain: Tailscale

Put the server on your tailnet, set HUB_BIND to its tailnet address in .env, and AUTH_MODE=tailnet only if the tailnet itself should be the login. Anyone on the tailnet is then the owner. HUB_HOSTS must list the names you type in the browser (host:port).

Settings you may change in /opt/klatch/.env

SettingMeaning
HUB_BIND, HUB_PORTWhere the hub listens on the server. Keep 127.0.0.1 behind Caddy or a tunnel.
HUB_HOSTSNames the hub answers to (guards against DNS tricks). The installer sets it for your domain.
PUBLIC_URL, TRUST_PROXYSet with a domain: redirects to HTTPS and trusts Caddy's client address. Never set TRUST_PROXY if the hub port is reachable directly.
SLOTSHow many agent turns run at once (default 2).
TZTimezone for quiet hours and the morning digest.
KLATCH_SECRET_KEYEncrypts keys saved in the panel. Back it up with the data (klatch backup does).
KLATCH_VERSIONImage tag. klatch update --version X changes it.

After editing: cd /opt/klatch && docker compose up -d.

Deploys and installs

Agents can install tools for themselves and, once you add a provider token in the panel, ask to deploy your site. No extra server setup is needed. See deploy.md.

Forgot the password

cd /opt/klatch && docker compose exec hub node dist/hub.mjs passwd

Add --reset-totp if the authenticator is lost. It signs every session out.

Removing Klatch

cd /opt/klatch && docker compose down
docker network rm klatch-agents
rm -rf /opt/klatch

Deactivate your license first (Settings, License) so the seat is free for your next server.