# Install Kaptain

One binary per platform, no system services. From nothing to a running Kaptain.

## 1. Pick your build

| You run | Download |
|---|---|
| Linux Intel/AMD | https://chynj.ca/download/kaptain/linux-x64 |
| Linux ARM (e.g. Raspberry Pi) | https://chynj.ca/download/kaptain/linux-arm64 |
| macOS Apple Silicon | https://chynj.ca/download/kaptain/macos-arm64 |
| macOS Intel | https://chynj.ca/download/kaptain/macos-x64 |
| Windows | https://chynj.ca/download/kaptain/win |
| Android client app | https://chynj.ca/download/kaptain/apk (pairs with a Kaptain on a machine above) |

## 2. Get the binary

Terminal installer (Linux/macOS) — installs, never starts anything:

    curl -sL https://chynj.ca/install.sh | sh

What it does: downloads via chynj.ca/download, smoke-tests the binary with `--help` (a broken download never replaces a working install), installs to `~/.local/bin` (never sudo; prints the PATH export line if needed). Re-run it any time to UPDATE — atomic swap. (SHA-256 verification against the signed manifest is the in-app updater's job, not the installer's.)

Or by hand: download (the saved file is named plain `kaptain` on Linux/macOS; Windows keeps kaptain-windows-x64.exe), `chmod +x kaptain`, move onto your PATH.
Windows: download `kaptain-windows-x64.exe`, double-click it — a no-terminal launch backgrounds the server and opens the browser.

Not sure which build: About This Mac ("Apple M..." = arm64, Intel = x64); `uname -m` (x86_64 / aarch64).
Machine needs: the binary is about 60 MB (the Claude sidecar is embedded), few hundred MB RAM; real demands come from the model route chosen DURING setup (CLI/cloud = nothing local; Ollama 4B ~8 GB RAM, 12B ~16 GB; building llama.cpp needs git + cmake). GPU optional (CUDA/ROCm/Metal/Vulkan detected; CPU works, slower).
Installer detail: smoke-tests via --help; installs to ~/.local/bin only, never sudo; never starts Kaptain (safe in Dockerfiles/CI); re-run = update.
First-launch confirmations (binaries not yet Apple/Microsoft-signed, one-time): macOS Gatekeeper -> Open Anyway; Windows SmartScreen -> More info -> Run anyway; Linux chmod +x.
Bare `kaptain` in a terminal prints the command list and exits (Windows Explorer double-click is the one exception — it starts, because there is no terminal to read the list in).

Per-platform detail: /documents/run/windows/ /documents/run/macos/ /documents/run/linux/ /documents/run/terminal/

Verify: `kaptain --version`

## 3. Run it

    kaptain start

Backgrounds the server in its own session (survives terminal close), waits for the web UI to answer, opens the browser. First launch lands on the setup wizard: https://chynj.ca/kaptain/docs/how-to/setup/

## The four commands

- `kaptain start` — detached; logs to kaptain.log in the data folder; the everyday command.
- `kaptain serve` — foreground; dies with the terminal (systemd, debugging).
- `kaptain stop` — stops the server; finds it even if it wasn't started with `start`.
- `kaptain status` — running or not, where, log path.

## Updating later

Settings > Update Kaptain (or `kaptain update`): downloads the published build, verifies SHA-256 against the signed release manifest, smoke-tests it, atomically swaps in place (old binary kept as `.bak`). Restart to run it: `kaptain stop` then `kaptain start`.

## If it goes wrong

- "command not found": `~/.local/bin` not on PATH, or an older `kaptain` shadows it — `type -a kaptain` shows what resolves.
- Browser didn't open: `kaptain status` prints the address.
- Release build answers 402: machine not bound to your account — https://chynj.ca/kaptain/docs/how-to/fix-402/
