---
title: Set up a standalone Bot
description: Install Klex and create a self-hosted Bot without Cloud enrollment.
related:
  - /bot/quickstart
  - /bot/concepts/models
  - /bot/concepts/mcp
---

You can run a self-hosted Bot without enrolling it in Klex Cloud.

## Install Klex

Install Klex in a terminal:

**macOS, Linux, or WSL:**

```sh
curl -fsSL https://klex.bot/install.sh | sh
```

**Windows (PowerShell):**

```powershell
irm https://klex.bot/install.ps1 | iex
```

## Create a Bot interactively

Start the app:

```sh
klex --no-cloud
```

1. Press `a` to create a Bot and enter its name.
2. In **Settings → Providers & Endpoints**, configure a model provider. In **Model Selection**, select a chat model.
3. Open **Settings → Soul** and create a soul describing the Bot's character and work.
4. 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](https://github.com/stagewise-io/klex/tree/main/packages/mcp-extension-push-notifications). 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:

```sh
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](/bot/guides/observability#access-the-local-admin-api). 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](/bot/guides/control-and-limits#stop-a-headless-bot).
