Set up a standalone Bot
Install Klex and create a self-hosted Bot without Cloud enrollment.
You can run a self-hosted Bot without enrolling it in Klex Cloud.
Install Klex
Install Klex in a terminal:
macOS, Linux, or WSL:
curl -fsSL https://klex.bot/install.sh | sh
Windows (PowerShell):
irm https://klex.bot/install.ps1 | iex
Create a Bot interactively
Start the app:
klex --no-cloud
- Press
ato create a Bot and enter its name. - In Settings → Providers & Endpoints, configure a model provider. In Model Selection, select a chat model.
- Open Settings → Soul and create a soul describing the Bot’s character and work.
- In Settings → MCP Servers, connect the servers the Bot needs. Configure its account permissions in the connected apps.
To receive events from an external channel, connect a server that supports the relevant MCP Events, live resources, or Klex’s push-notification extension. MCP Events require a watch, and live resource updates require the resource to be open. Some servers also require separate setup in the connected service.
Create a Bot without the picker
To create a standalone Bot without the interactive picker, provide a name:
klex --create-bot --no-cloud --bot-name Ada
Add --headless to run without the terminal UI. Configure a provider, chat model, and soul before the Bot can work. To configure a new Bot interactively, omit --headless and use the settings above. For headless configuration, use the Admin API; see its local access and security limits. Creation cannot be combined with --data-dir or KLEX_DATA_DIR; those select an existing Bot. For stopping a headless Bot, see Control your Klex Bot.