Install & run Docs menu

Docs

Install & run on a laptop, VPS or Docker

kwnt is one self-contained binary with the web app and SQLite built in. Build it once, then run it on your own computer or on a server. New to this? Read what self-hosting an AI agent team involves.

We earn commissions when you shop through the links below.

Build the release binary

make build
./target/release/kwnt serve

The binary embeds the web app, so the machine that runs it needs no Node.js. Docker is only needed for VM mode and the bots' shared browser (see Browser).

The Mac app

Download the Mac app (a universal .dmg for Apple silicon and Intel), open it and drag kwant to Applications. It runs its own kwant bots on your Mac, with the same data folder as kwnt serve (~/.kwnt), and keeps running in the menu bar when you close the window.

The app is signed ad hoc, not notarized by Apple yet, so macOS asks once, the first time you open it:

  1. Drag kwant to Applications and open it. When macOS says it couldn't verify it, click Done.
  2. Open System Settings › Privacy & Security and scroll down to Security.
  3. Click Open Anyway next to “kwant” was blocked, then Open Anyway again, and enter your Mac password or use Touch ID.
A mock-up of the three macOS steps: the “kwant” Not Opened alert with Done marked, System Settings › Privacy & Security, and the Security row “kwant” was blocked to protect your Mac with Open Anyway marked.

You only do this once. On macOS 14 or earlier, right-click kwant in Applications and choose Open instead.

When a bot needs you, with a question or an approval, the menu-bar icon plays a short animation once and a small note drops under it; click it to open that chat. The Linux app changes its tray icon and shows a notification. Untick Show nudges in the icon's menu to turn them off.

The Linux app beta

On Linux (x86_64) there's a desktop app too. Like the Mac app, it runs its own kwant bots, uses the same data folder (~/.kwnt) and puts an icon in the tray.

  • Ubuntu 22.04 or newer, Debian 12 or newer: download the .deb, then install it with sudo apt install ./kwant_amd64.deb. apt installs what it needs with it.
  • Other distributions: download the AppImage, then chmod +x kwant_x86_64.AppImage and run it. It needs a normal GTK desktop and FUSE.

Updates arrive in the app, which checks each one's signature before installing it. With the .deb, your system asks for your password to install the update. To remove the .deb, run sudo apt remove kwant; your data in ~/.kwnt stays.

The Linux app is a beta. We've tested it in clean installs of Ubuntu 22.04, Ubuntu 24.04 and Debian 12, but not yet on real desktops, so the tray icon, Wayland and HiDPI screens may behave differently on yours. It's x86_64 only for now: no ARM builds. Something wrong? Open an issue.

The Windows app beta

On 64-bit Windows there's an app too. It runs kwant on your PC with the same data folder as kwnt serve: .kwnt in your user folder.

  1. Download the installer, kwant_X.Y.Z_windows_x64_beta_setup.exe from the latest release. Its SHA-256 is next to it, in the .sha256 file and in the release notes.
  2. Run it. It installs for your user only, so it needs no admin rights, and adds kwant to the Start menu.
  3. The installer isn't code-signed yet, so the first time Windows SmartScreen warns about an unrecognized app. Click More info, then Run anyway.

The Windows app is a beta. It doesn't update itself yet: a new version is a new installer. Grok, the VM (bots work on your own computer instead) and looking inside videos aren't on Windows yet. Dev mode works, but in a folder OneDrive syncs with Files On-Demand, kwant can't safely read the repo's git files, so it asks you before every push from that folder. Something wrong? Open an issue.

This Mac and your servers, side by side

The Mac and Linux app can open This Mac and every server you use at the same time, each in its own window. Nothing restarts when you go from one to another.

kwant's Add a server window with the address kwant.example.com typed in and a Connect button.
Add a server takes an address or a sign-in link.
  • Add a server… in the menu bar (the tray on Linux) takes the server's address or a sign-in link. Sign in once, and the server stays listed and signed in until you remove it, so you never type it again.
  • The menu bar lists each place with what's waiting there, or "Sign in to see what's waiting", or "Couldn't reach it". Choose a place to open or bring up its window.
  • A link to another listed place opens that place's window. Other links open in your browser.
  • When a server can't be reached, its window says why, with Try again and Remove this server….
  • Remove a server asks first, then signs the app out on that server when it can reach it, so it also disappears from that server's signed-in devices. If the server is down, the app removes it anyway, and you can sign the app out later on the server in Settings → All spaces → Signed-in devices.
  • Run kwant on this Mac is on by default. Turn it off if you only use servers. You need at least one server added first.

The list is kept in ~/.kwnt/desktop-places.json. It holds addresses only, never a token.

After an update: What's new

New in 0.7.6. After kwant updates, a What's new sheet shows the version's highlights, smaller changes and fixes. Each device shows it once, and Got it closes it. The web app shows it when its server updates. See what's new on the Updated banner opens it again, and Settings › About keeps every version's notes.

kwant's What's new dialog for 0.7.7 over the app, updated from 0.7.6: Run Claude inside the VM, kwant for Windows (beta), Dev mode reviews only fresh work and Bring your bots, then Smaller changes and fixes: 6, and a Got it button.
What's new in 0.7.7, as the app shows it after the update.

Install the web app

kwant bots also installs from the browser, so it opens in its own window. In Chrome or Edge, click Install app in Settings → All spaces (or the install icon in the address bar; the sidebar also offers it once, as a tip). In Safari on a Mac, choose File › Add to Dock. On a phone, open your kwant in Safari or Chrome and add it to the Home Screen: kwant on your phone has the steps. Browsers only install pages served over https or from 127.0.0.1, so a server needs an HTTPS reverse proxy first.

On your own computer

Run kwnt serve and open http://127.0.0.1:8799. There's nothing to sign in to: requests from this machine need no token, and kwnt serve prints nothing about one.

"This machine" means a loopback connection with a loopback Host and no proxy headers. A VPS you reach through an SSH tunnel counts too:

ssh -N -L 8799:127.0.0.1:8799 user@your-vps   # on your computer, then open http://127.0.0.1:8799

Not with Docker: its published port always counts as remote. And 127.0.0.1 only: opening kwant at your computer's network address (say 192.168.1.20:8799) counts as another machine.

A Linux server in one line

New in 0.7.6. On Ubuntu 22.04 or newer, or Debian 12 or newer, on x86_64 or arm64, one command installs kwant and starts it. Run it as the user that should run kwant:

curl -fsSL https://kwant.si/install.sh | sh
A terminal on a Linux server running curl -fsSL https://kwant.si/install.sh piped to sh. It installs kwant 0.7.6 for Linux arm64, says it runs in the background and that Laya and a browser are getting ready, then shows a one-time sign-in link and the ssh tunnel command to run on a laptop.
The install ends with your sign-in link. The rest happens in the browser.
  • Checked before it installs. It downloads the prebuilt kwnt from the latest release and checks it against its SHA-256. If they don't match, nothing is installed. kwnt goes in ~/.local/bin and your data in ~/.kwnt.
  • Never sudo. When a step needs admin rights, it prints the command for you instead.
  • Keeps running. kwant runs as a service for your user when the system allows it, so it starts again after a reboot. If starting at boot needs admin rights, it prints the one command for that. With no user services, it runs in the background and says how to start it again.
  • Gets the rest ready. Laya and a browser for the bots install in the background, and Claude Code too when no AI CLI is there yet.
  • Sign in. It ends with a one-time link that works for 15 minutes. On a server, it also prints the ssh -N -L command to run on your laptop first, so the link opens there. In the browser you choose your AI and sign in. Lost the link? Run kwnt signin-link.
  • Update: run the same line again. It upgrades kwant in place and keeps your data.

On a VPS

Run kwant on a DigitalOcean Droplet

A 2 GB Droplet is enough for kwant. If you also run Laya, pick 4 GB. Create a DigitalOcean account, then follow the Docker or binary steps below. A DigitalOcean 1-Click App is coming soon.

# 1. Copy the binary to your server
scp target/release/kwnt user@your-vps:/usr/local/bin/kwnt

# 2. Run it
ssh user@your-vps "kwnt serve --host 0.0.0.0 --port 8799"

On a bind other than loopback, kwnt serve prints a one-time sign-in link on its output, never in the log. It works once, for 15 minutes:

http://<this-host>:8799/#kwnt_token=kl1.…

Swap <this-host> for the server's address and open the link. The page signs in with an HttpOnly cookie that lasts a year and clears the address bar. With KWNT_ALLOWED_ORIGINS set to your HTTPS address, the link is ready to open and comes with a QR code to scan with your phone.

  • Used, expired or lost the link? On the server, as the user that runs kwnt, kwnt signin-link (or kwnt token) prints a new one-time link, and cat ~/.kwnt/api-token prints the token to paste on the sign-in screen. With the systemd unit below that's sudo cat /var/lib/kwnt/api-token. Built from source and kwnt isn't on your PATH? Use ./target/release/kwnt token from the source folder.
  • Same user: run as another user, kwnt token fails with an error, because it can't find or read the token file. Run it as the user that runs kwnt, or with the systemd unit use sudo cat /var/lib/kwnt/api-token.
  • Same machine: each install has its own token. A token from your laptop won't open kwnt on your server. Get it on the server.
  • Scripts: kwnt token --raw prints just the token, to send as Authorization: Bearer <token>.
  • The token lives in <data dir>/api-token (mode 0600), or set KWNT_API_TOKEN (16+ characters).

Adding a phone or another browser: once you're signed in, open Settings → All spaces → Signed-in devices and choose Add a phone or browser. kwant shows a one-time QR code and a link to copy. Like the server's link, it works once, for 15 minutes. Scan it with your phone's camera and the panel changes to Signed in ✓. The QR code is drawn in your browser, and the code is hidden again when it expires, when you press Hide or New code, or when you leave the page.

Signed-in devices lists the browsers signed in with a link, a QR code or an approval, with Sign out for each one. The browser you're using is marked This device and has no Sign out button. Browsers signed in by pasting the API token aren't listed. Signing a browser out doesn't change the API token. On your own computer, where there's nothing to sign in to, this section doesn't appear.

Signing in from a new device without a link: on the sign-in screen, choose Sign in from another device. The new browser shows a short code, valid for 10 minutes. Every browser that's already signed in shows New device wants access with the same code, the browser name and its IP address. Check that the code matches, then press Approve, and the new browser signs itself in. Approve only a code that's on a screen you're holding right now. An approved device gets full control of kwant as you, so if someone asks you to approve a code, press Deny.

The link signs in as you. Anyone who can read the server's output, or docker compose logs with Docker, can use it. Keep that output private.

As a systemd service

Create a dedicated user (useradd --system --create-home --home-dir /var/lib/kwnt kwnt), then sign the CLIs in as that user, or add API keys in the app.

# /etc/systemd/system/kwnt.service
[Unit]
Description=Kwant AI agent platform
After=network.target

[Service]
Type=simple
User=kwnt
ExecStart=/usr/local/bin/kwnt serve --host 0.0.0.0 --port 8799
Restart=always
# Stop and restart only kwnt itself: programs a bot left running in the background keep running
KillMode=process
Environment=KWNT_DATA_DIR=/var/lib/kwnt
Environment=LAYA_URL=http://127.0.0.1:8000

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable --now kwnt

KillMode=process means an update or a restart stops only kwnt, not programs a bot deliberately started in the background (a dev server, a long build). kwant itself still stops a command that times out or a turn you cancel, with everything it started. Without that line, systemd stops every program kwnt ever started. systemctl status kwnt lists the ones still running; stop one with kill <pid>.

VPS in 5 minutes with Docker Compose

One command starts kwnt, Laya (with its model baked in) and a private Chromium for the bots, so VM mode works without mounting the Docker socket. You need Docker with Compose and about 4 GB of free RAM.

git clone https://github.com/alexsergivan/kwant.git && cd kwant
KWNT_CLIS=claude,codex docker compose up -d --build   # any of claude,codex,grok; leave out for none
docker compose exec kwnt kwnt doctor                  # what works, and the fix for what doesn't
docker compose exec kwnt claude auth login            # or codex login --device-auth, grok login --device-auth
docker compose exec kwnt kwnt token --raw             # the token to paste on the sign-in screen

The released image. Since 0.7.6, docker compose up -d without --build pulls the released kwnt image, ghcr.io/alexsergivan/kwnt, instead of building it here. It has no AI CLIs inside, so add an API key in the app, or build with KWNT_CLIS as above. To pin a version, set KWNT_VERSION=0.7.7 in .env. To update: docker compose pull kwnt && docker compose up -d.

Instead of CLIs you can add an API key in the app under Settings → This space → Accounts. CLI sign-ins persist in the kwnt-home volume and data in kwnt-data. The UI is published on 127.0.0.1:8799 only: put HTTPS in front (below) and set KWNT_ALLOWED_ORIGINS=https://your.domain in .env. With Caddy that's a two-line Caddyfile: your.domain { reverse_proxy 127.0.0.1:8799 }.

Requests through Docker's published port count as remote, so sign in with a one-time link: docker compose exec kwnt kwnt signin-link prints a new one (and a QR code), or paste the token from docker compose exec kwnt kwnt token --raw. kwant's own execute_shell tool isn't available in this stack, because it would need the host's Docker socket; the CLIs' shell tools work. Upgrading from an older image, where kwnt ran as root? If it says /data isn't writable, run once: docker compose run --rm -u root kwnt chown -R 10001:10001 /data.

On Railway, in one click

Deploy on Railway or Deploy kwant + Laya

  1. Deploy. The button deploys kwant, the bots' private headless browser on Railway's private network, and a volume on /data for your chats and settings. Without Laya, kwant picks which bot answers by keyword. Deploy kwant + Laya also runs the Laya message router, for smarter routing, and uses about 2 GB more RAM.
  2. Sign in. Railway makes the sign-in token: open the kwant service, copy KWNT_API_TOKEN from its Variables tab, open the service's public domain and paste the token on the sign-in screen.
  3. Add an AI account. The image has no AI CLIs inside, so the simplest start is an Anthropic, OpenAI or xAI API key, under Settings → This space → Accounts.

New Railway accounts start with a free trial, then Railway bills you directly. Deploying with these buttons supports kwant: Railway shares part of what it charges with the project, at no extra cost to you.

Render, CasaOS, Umbrel and Coolify

Deploy to Render

The button reads render.yaml: one web service from the released image, with a 1 GB disk on /data. Render keeps files only on a disk, and disks need a paid instance (Starter or up), so the free plan won't work. Render makes the sign-in token: copy KWNT_API_TOKEN from the service's Environment page and paste it on the sign-in screen.

For a home server, the repo's deploy/ folder has a listing for each store, pinned to the release:

  • CasaOS: sign in with the token that kwnt token --raw prints in the app's Terminal (kwant's menu on the dashboard). Until the store lists kwant, import the file under Custom Install.
  • Umbrel: sign in with the password Umbrel shows for kwant. Umbrel's own login stays in front of it.
  • Coolify: sign in with SERVICE_PASSWORD_64_KWNT from the service's environment variables. Until it is a Coolify template, run the file as a Docker Compose resource.

These run kwnt alone, without Laya or the bots' private browser, so bots are picked by keyword and VM mode is off. The image has no AI CLIs inside: add an API key in the app.

Without Docker: kwnt setup, then kwnt doctor

kwnt setup installs what kwant needs on this machine: Chromium or Chrome for the bots' browser, Laya (in kwant's data folder, with its own uv if there's no Python) and a CLI (claude unless you name others with --clis). It asks before each step (--yes skips the questions), never runs sudo itself (it prints the command for you), installs into your home folder where it can, skips Docker unless you pass --docker, and is safe to run again.

No Node needed. Since 0.7.6, on a Mac or Linux computer without Node, kwant installs Codex from OpenAI's standalone release and checks its SHA-256 before unpacking anything. With no Chrome or Chromium on the computer, kwant downloads Chrome for Testing into its own folder the first time a bot needs the browser. If a download fails, Settings says why.

# Mac or Linux app: nothing to run, it installs the Laya router itself on first start
# Mac or Linux, from source (needs Rust and Node)
git clone https://github.com/alexsergivan/kwant.git && cd kwant && make build
./target/release/kwnt setup && ./target/release/kwnt doctor
# Debian or Ubuntu, system packages only
sh scripts/install-linux-deps.sh --clis claude && kwnt doctor
# VPS with Docker: see above, then
docker compose exec kwnt kwnt doctor

Behind an HTTPS reverse proxy

Only the HTTPS port needs to be reachable from outside. Forward the original Host header, because the live browser stream checks Origin against it, and allow WebSocket upgrades:

location / {
    proxy_pass http://127.0.0.1:8799;
    proxy_http_version 1.1;
    proxy_set_header Host $http_host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_buffering off;
    proxy_read_timeout 90s;
}

Requests carrying proxy headers count as remote, so they need the sign-in link even if the proxy runs on the same machine. Never publish Chromium's debugging port or the Docker socket.

Settings

EnvironmentWhat it does
KWNT_DATA_DIRWhere kwant keeps its database (kwnt.db), account profiles and saved passwords. Default ~/.kwnt.
KWNT_REQUIRE_TOKENalways requires the token for local requests too; never turns the check off (only behind your own authentication).
KWNT_API_TOKENUse your own API token instead of the generated one.
KWNT_ALLOWED_ORIGINSExtra browser origins allowed to call /api, comma separated.
KWNT_COMPUTER_MODElocal or vm, unless a choice is saved in Settings.
LAYA_URLWhere the Laya router answers. Default http://127.0.0.1:8000.
KWNT_LAYA_MANAGED=0Don't install or run Laya; use your own. kwnt serve --no-laya skips it.

~/.kwnt/config.toml can also set host, port, data_dir and the Laya options (laya_url, laya_managed, laya_models). More on Laya is in Models & routing.