> ## Documentation Index
> Fetch the complete documentation index at: https://docs.myrmagent.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Local Deployment

> Self-host Myrm with Docker or manually.

# Local Deployment

Run Myrm on your own machine with full control over your data.

## One-liner install (fastest)

**macOS / Linux / Git Bash**

```bash theme={null}
curl -fsSL https://myrmagent.ai/install.sh | bash
myrm start
```

**Windows (PowerShell)**

```powershell theme={null}
irm https://myrmagent.ai/install.ps1 | iex
myrm start
```

Open **[http://localhost:3000](http://localhost:3000)** and add your LLM API key in Settings. Harness comes from PyPI; no separate harness repo required for self-host.

## Clone and develop (OSS repo)

```bash theme={null}
git clone https://github.com/Pursue-LLL/myrm-agent.git
cd myrm-agent
myrm setup          # uv sync + bun install
myrm start          # backend (terminal 1)
cd myrm-agent-frontend && bun run dev   # frontend (terminal 2)
```

Dev scripts live under `scripts/` in the open-source repo so contributors clone once and run locally.

<Callout type="tip">
  **Split dev tip:** If you open only the WebUI (port 3000) without the backend, the UI shows a friendly banner with startup guidance—not cryptic errors. Settings cache offline and sync when the backend returns.
</Callout>

## Prerequisites (Docker path)

* Docker 24+ and Docker Compose v2
* 4GB RAM minimum (8GB recommended)
* 10GB disk space

## Docker Compose

```bash theme={null}
git clone https://github.com/Pursue-LLL/myrm-agent.git
cd myrm-agent/myrm-agent-server
cp .env.example .env   # if present
docker compose up -d
```

## Configuration

Edit `.env` to set your API keys:

```env theme={null}
# LLM Provider (at least one required)
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...

# Optional: Additional providers
DEEPSEEK_API_KEY=...
GOOGLE_API_KEY=...
```

See [Environment Variables](/docs/self-hosting/environment-variables) for the full reference.

## China Mainland Acceleration

The install script automatically detects China mainland networks (via timezone + connectivity check) and switches to domestic mirrors:

* **PyPI** → pypi.tuna.tsinghua.edu.cn
* **npm** → registry.npmmirror.com
* **Playwright** → cdn.npmmirror.com

For Docker builds, pass `--build-arg USE_CN_MIRROR=1`:

```bash theme={null}
docker build --build-arg USE_CN_MIRROR=1 -f myrm-agent-server/Dockerfile -t myrm-server .
```

Manual override: set `MYRM_USE_CN_MIRROR=1` to force domestic mirrors, or `MYRM_NO_CN_MIRROR=1` to disable auto-detection.

## Verify Installation

```bash theme={null}
curl http://localhost:3000/api/health
```

Expected response:

```json theme={null}
{ "status": "ok" }
```

## Production Docker builds (OSS server image)

When building the open-source server image from pre-built harness wheels, the builder selects the correct platform core wheel via BuildKit `TARGETPLATFORM` and runs `verify-harness-distribution` before the image is considered ready. Mismatched or incomplete installs fail at build/startup time—not mid-conversation.

See the harness distribution guide in the monorepo: `myrm-agent-harness/harness_packaging/DISTRIBUTION_SYSTEM.md`.

## Modular engine packaging (embedders)

The harness ships as **24 lean runtime dependencies** plus **11 optional Extras** (browser, retrieval, ACP, observability, etc.). End users installing via `install.sh`, Docker, or Tauri get the full server bundle automatically—no manual extra selection.

If you embed the engine in your own Python service, install only what you need:

```bash theme={null}
pip install 'myrm-agent-harness[fastapi,web,compiled-core]==0.1.0'
```

Missing an Extra surfaces a clear install hint at call time (not a silent mid-conversation crash). Architecture tests lock the core list to prevent dependency creep—**327** harness architecture tests verified (Jul 2026).

## Automatic Dependency Management

Myrm handles dependencies automatically so you never need to manually install packages:

* **Channel SDKs** — When you enable Matrix, Discord, or Feishu channels, the required Python packages are installed on-demand via an allowlist-secured mechanism. No restart needed.
* **MCP Servers** — External tools run via `npx`/`uvx` which manage their own environments automatically. Just add a server in the GUI and it works.
* **Doctor diagnostics** — Run `myrm doctor` to check system health: Python version, core dependencies, browser availability, and more. Each failure includes a fix suggestion.
* **Security by default** — Only pre-approved packages can be auto-installed. MCP servers are scanned for malware (OSV) and prompt injection before activation.

## Updating

```bash theme={null}
git pull
docker compose pull
docker compose up -d
```
