OpenClaw: Your Self-Hosted AI Gateway for Every Chat App
OpenClaw is a self-hosted AI gateway that turns your own machine into an always-on AI agent accessible from WhatsApp, Telegram, Discord, and more.
Most AI assistants live behind a company’s servers. You send a message, it goes to their cloud, their logs, their infrastructure. OpenClaw flips that model. It’s a self-hosted AI gateway that runs on your own machine — a laptop, a VPS, a Raspberry Pi — and turns it into an always-on AI agent accessible from WhatsApp, Telegram, Discord, iMessage, and more.
Think of it as your personal AI bridge: you pick the model, you own the data, you control the rules.
“EXFOLIATE! EXFOLIATE!” — A space lobster, probably (OpenClaw’s unofficial mascot is a lobster 🦞)
Key facts:
- Open source (MIT license)
- Self-hosted — runs on Node 22+, on any OS
- Multi-channel — one Gateway process serves multiple chat apps simultaneously
- Model-agnostic — plug in Anthropic, OpenAI, Google Gemini, Ollama, or any OpenRouter model
- Agent-native — built for tool use, memory, multi-agent routing, and persistent sessions
🆚 Why Not Just Use ChatGPT or Claude.ai?
Great question. Those tools are excellent. But they have tradeoffs:
| Feature | Hosted AI (ChatGPT, Claude.ai) | OpenClaw (Self-Hosted) |
|---|---|---|
| Data stays on your machine | ❌ | ✅ |
| Works in your existing chat apps | ❌ | ✅ |
| Multi-channel (WhatsApp + Telegram + Discord) | ❌ | ✅ |
| Persistent memory across sessions | Limited | ✅ (Markdown files) |
| Custom personas and agent rules | Limited | ✅ |
| Multi-user, isolated agents | ❌ | ✅ |
| Your own API keys / billing | ❌ | ✅ |
| Mobile integration (camera, screen, location) | ❌ | ✅ (iOS + Android nodes) |
If you’re a developer, power user, or someone who just doesn’t want their life events logged in a stranger’s database — OpenClaw is worth a look.
⚙️ How It Works
At its core, OpenClaw runs a Gateway daemon — a persistent process that:
flowchart TD
WA["📱 WhatsApp"]:::channel --> GW
TG["✈️ Telegram"]:::channel --> GW
DC["🎮 Discord"]:::channel --> GW
GW["🦞 Gateway\n(routes messages)"]:::gateway --> A1["🤖 Agent Pi\n(your workspace)"]:::agent
A1 --> T["🔧 Tools\n(exec, browser, files)"]:::tool
A1 --> M["🧠 Memory\n(Markdown files)"]:::tool
A1 --> S["💬 Sessions\n(per-user context)"]:::tool
A1 --> GW
GW --> WA
GW --> TG
GW --> DC
classDef channel fill:#4A90D9,stroke:#2c5f8a,color:#fff
classDef gateway fill:#9B6EBD,stroke:#6b4785,color:#fff
classDef agent fill:#5BA85A,stroke:#3a6e39,color:#fff
classDef tool fill:#D97B4A,stroke:#9e5430,color:#fff
- Listens to your configured chat channels (WhatsApp, Telegram, Discord, etc.)
- Routes incoming messages to the right AI agent
- Runs the agent turn (tool calls, model inference, memory lookup)
- Replies back to the chat
🚀 Getting Started in 5 Minutes
You need: Node 22+ and an API key (Anthropic, OpenAI, etc.).
1. Install OpenClaw
1
2
3
4
5
6
7
8
# macOS / Linux
curl -fsSL https://openclaw.ai/install.sh | bash
# Windows (PowerShell)
iwr -useb https://openclaw.ai/install.ps1 | iex
# Or via npm
npm install -g openclaw@latest
2. Run the Onboarding Wizard
1
openclaw onboard --install-daemon
This interactive wizard walks you through:
- Configuring your AI provider and model
- Setting up channels (Telegram, WhatsApp, Discord)
- Installing OpenClaw as a background service
3. Start the Gateway
1
openclaw gateway --port 18789
4. Open the Control UI
1
openclaw dashboard
Opens a browser-based dashboard at http://127.0.0.1:18789/ — a full chat interface, session inspector, and config editor.
5. Connect a Channel (e.g., Telegram)
1
openclaw channels login --channel telegram
Follow the prompts to link your Telegram bot token (get one from @BotFather).
🧠 The Agent Workspace
One of OpenClaw’s most interesting design choices: the agent’s “brain” is just a folder of Markdown files.
By default this lives at ~/.openclaw/workspace/. The files inside define who the agent is:
| File | Purpose |
|---|---|
SOUL.md | Personality, tone, core values |
AGENTS.md | Operating instructions, memory workflow |
USER.md | Info about the person the agent serves |
IDENTITY.md | Agent name, emoji, avatar |
TOOLS.md | Notes on external tool setup (cameras, SSH hosts, etc.) |
MEMORY.md | Long-term curated memory |
memory/YYYY-MM-DD.md | Daily running notes |
HEARTBEAT.md | Periodic background task checklist |
You edit these files directly. The agent reads them at the start of each session. The files are the memory. No black-box database, no proprietary format — just text you can version-control with Git.
💾 Memory: Smarter Than You’d Expect
OpenClaw’s memory system is deceptively powerful.
Layer 1 — Markdown files: The agent writes notes to memory/YYYY-MM-DD.md during conversation. These persist across sessions.
Layer 2 — Semantic search: OpenClaw builds a vector index over your memory files. When the agent calls memory_search, it runs hybrid BM25 + vector retrieval — finding relevant notes even when the wording is different.
Layer 3 — Auto-flush before compaction: When a session context is getting full, OpenClaw silently prompts the agent to write important things to disk before the context is summarized. Nothing important gets lost.
Advanced options include:
- MMR re-ranking to reduce duplicate results
- Temporal decay so recent memories rank higher than old ones
- Local embeddings (no API key needed) via
node-llama-cpp
🔀 Multi-Agent Routing
Run multiple isolated agents on a single Gateway — each with its own workspace, persona, auth credentials, and session store.
Real-world uses:
- Personal vs. Work: Different WhatsApp numbers route to different agents with different system prompts and tool access.
- Family group chat: A dedicated agent for a group chat, with restricted tools (no file writes, no exec).
- Channel-based routing: WhatsApp messages go to a fast everyday agent; Telegram goes to a slower, more thoughtful one.
1
2
3
4
5
6
7
8
9
10
11
12
{
agents: {
list: [
{ id: "everyday", workspace: "~/.openclaw/workspace-everyday", model: "anthropic/claude-sonnet-4-5" },
{ id: "deep", workspace: "~/.openclaw/workspace-deep", model: "anthropic/claude-opus-4-6" }
]
},
bindings: [
{ agentId: "everyday", match: { channel: "whatsapp" } },
{ agentId: "deep", match: { channel: "telegram" } }
]
}
🛠️ Skills: Extending What Your Agent Can Do
OpenClaw agents get their capabilities from skills — small packages of instructions and scripts that tell the agent how to use external tools.
Built-in and installable skills include:
| Skill | What it does |
|---|---|
| gog | Gmail, Calendar, Drive, Sheets, Docs via Google OAuth |
| github | Issue management, PRs, CI runs via gh CLI |
| obsidian | Read/write notes in your Obsidian vault |
| weather | Current conditions and forecasts (no API key needed) |
| maps | Distance, routing, geocoding (free, no API key needed) |
| summarize | Summarize URLs, PDFs, YouTube videos, audio |
| safe-exec | Human-approval workflow for dangerous shell commands |
| self-improving-agent | Captures errors and corrections to improve over time |
1
2
openclaw skills install weather
openclaw skills install github
📱 Mobile Nodes: Your Phone as a Sensor
OpenClaw can pair with your iPhone or Android device as a node — giving the agent access to:
- 📷 Camera (snap, record video clips)
- 🖥️ Screen recording
- 📍 Location
- 🔔 Notifications (list, dismiss, reply)
- 💬 SMS (Android)
1
openclaw nodes pair
🌐 Supported Channels
| Channel | Notes |
|---|---|
| Via WhatsApp Web (Baileys); one or multiple accounts | |
| Telegram | Via grammY; multi-bot support |
| Discord | Via discord.js; per-guild/channel config |
| iMessage | macOS only, via local imsg CLI |
| Signal | Supported |
| Mattermost | Via plugin |
| Web Control UI | Browser chat, always available on gateway host |
| macOS app | Menu bar companion |
🔒 Security Model
Key controls:
allowFrom— allowlist of phone numbers or user IDs allowed to DM the agentdmPolicy—pairing(QR code handshake),allowlist, oropen- Per-agent tool restrictions — deny
exec,write,browserfor untrusted agents - Sandboxing — run agents in isolated Docker containers
1
openclaw security audit
🏠 Real-World Setup: What I’m Running
- Server: Ubuntu VPS (1 vCPU, 2 GB RAM) in Singapore
- Channel: Telegram bot
- Model: Claude Sonnet 4.6 via Anthropic API
- Skills: gog (Gmail + Calendar), github, obsidian, weather, maps, summarize
- Memory: Daily Markdown logs + semantic search via Gemini embeddings
- Heartbeats: The agent periodically checks email, calendar, and weather — reaching out proactively if something needs attention
🧭 The Philosophy
- Your data should stay on your hardware. No logs shipped to someone else’s cloud.
- AI should live where you already communicate. You shouldn’t have to open a separate app.
- The agent’s “brain” should be human-readable. Markdown files you can edit, search, and version-control.
- Self-hosting shouldn’t require a PhD. Install script → wizard → running in minutes.
📚 Resources
- 🌐 Website: openclaw.ai
- 📚 Docs: docs.openclaw.ai
- 🛠️ Skills marketplace: clawhub.com
- 💬 Community: Discord
- 📦 GitHub: github.com/openclaw/openclaw
Happy hacking! Next: building your first OpenClaw skill from scratch.