Troubleshooting

Starting and reaching Kraft

Fix a kraft command that isn't found, a server that won't start because its port is taken, and a 403 "unexpected Host" from a webhook or proxy.

kraft: command not found

Your shell prints kraft: command not found (zsh: command not found: kraft) when the directory kraft was installed in isn't on your PATH. That is usual right after a uv install, the install script included.

  1. Run uv tool update-shell, or add the directory kraft is in to PATH yourself.
  2. Open a new terminal.
  3. Check that the command is found:
    kraft --version
    

You know it worked when kraft --version prints kraft X.Y.Z.

After a Homebrew install, put $(brew --prefix)/bin on your PATH instead.

If Kraft runs as a service, which keeps the PATH it was installed with, also read kraft on PATH.

Kraft won't start: port already in use

If something already answers on Kraft's port (8765 by default), kraft refuses to start and says what it found:

kraft: refusing to start - something is already answering on 127.0.0.1:8765. curl http://127.0.0.1:8765/api/health to inspect it, or `kraft admin stop` if it's yours.

When it names a Kraft server instead of "something", that is an instance you already started: kraft admin stop stops it.

A port held by something that doesn't answer gets past that check, and the start exits with address already in use instead. It exits before it looks at any work items, so items that were running are left as they were.

Otherwise pick another port. kraft admin start --port 9000 moves only the server. To have the kraft command, the plugin and the VS Code extension follow it, set port in access.yaml instead.

A webhook or proxy gets 403 "unexpected Host"

{"detail":"unexpected Host for a server bound to 127.0.0.1"}

On a loopback bind (the default), Kraft answers only a request addressed to localhost, 127.0.0.1 or [::1]. A webhook to POST /api/triggers, a health check to GET /api/health, and anything else that reaches Kraft through a tunnel or reverse proxy with the name its client used, gets this 403. Adding the name to allowed_hosts changes nothing: it isn't read on a loopback bind.

Fix it one of two ways:

  • For the board, webhooks and scripts: bind Kraft beyond loopback, with a password, and list the name the proxy's clients use in allowed_hosts. Put a proxy in front of Kraft has the steps.
  • For webhooks and scripts alone: make the proxy send Host: localhost. A loopback-bound Kraft asks a request from this machine for no password, so read Put a proxy in front of Kraft before you do.

Who may call lists which callers need which credentials, and when each gets a 403.

Copyright © 2026