Open Source 191K+ Stars

$ root_access

The definitive guide to OpenClaw — the self-hosted AI agent that runs shell commands, controls browsers, sends emails, and connects to your messaging apps. From first install to production-hardened power user. Treat it like infrastructure, not a toy.

February 12, 2026 · MIT License · v2026.2.x · 25 min read · By Justin Sparks
Scroll

A self-hosted agent runtime with real-world capabilities

OpenClaw is not a chatbot. It is a self-hosted agent runtime and message router — a long-running Node.js service that connects AI models to your messaging platforms, local files, shell, browser, and dozens of third-party services. Unlike ChatGPT or Claude’s web UI, OpenClaw doesn’t just answer questions. It acts: running shell commands, controlling browsers, reading and writing files, managing calendars, and sending emails — all triggered by a text message from your phone.

Created by Peter Steinberger (PSPDFKit founder) in November 2025 under the name “Clawdbot,” the project was renamed to “Moltbot” after Anthropic trademark complaints, and finally to “OpenClaw” on January 30, 2026. It is one of the fastest-growing open-source projects in GitHub history.

191K+
GitHub Stars
900+
Contributors
5,700+
Community Skills
13
Chat Channels
Architecture: Gateway Control Plane
Messaging Channels
13 Platforms
WhatsApp · Telegram · Discord · Slack · Signal · iMessage · Google Chat · Teams · Matrix · Zalo · BlueBubbles · Mattermost · WebChat
Control Plane
Gateway — ws://127.0.0.1:18789
Pi Agent Runtime · WebSocket API · JSON Schema Validation · Session Management
Tool Execution Layer
Capabilities
Shell
Filesystem
Browser (CDP)
Cron
Webhooks
Sub-Agents
Web Search
Image Gen
Email

Supported AI Providers

Anthropic, OpenAI, OpenRouter, Google Gemini, xAI, Groq, Mistral, Cerebras, Amazon Bedrock, Ollama (local), and 15+ more. Model failover cascades automatically through your configured fallback chain with cooldowns at 1 min, 5 min, and 1 hour.

What It Costs

The software is free and MIT-licensed. Your cost is AI API usage:

$10–30
$30–70
$100–150+
Light use Typical Heavy automation

Dedicated hardware. No exceptions.

The OpenClaw community and security researchers universally agree: never run OpenClaw on your primary computer or work machine. Use a dedicated VPS, VM, or spare hardware. As one of OpenClaw’s own maintainers warned: “If you can’t understand how to run a command line, this is far too dangerous of a project for you to use safely.”

Hosting Options

DigitalOcean
~$24 /mo
1-Click hardened image with Caddy TLS, Docker, Fail2ban pre-configured
Oracle Cloud
$0 /mo
Always Free: 4 ARM CPUs, 24 GB RAM, 200 GB disk. Runs OpenClaw + Ollama 7B.
AWS / Azure
~$5–15 /mo
EC2/Lightsail or Azure Linux VMs. Pulumi IaC templates available.

Resource Tiers

A
Learning
1 vCPU
2 GB RAM
10 GB disk
B
Daily Use
2 vCPU
4 GB RAM
40 GB SSD
C
Multi-Channel
2–4 vCPU
8–16 GB RAM
60+ GB SSD
D
Local Models
4+ vCPU
16–24 GB RAM
GPU optional

Ubuntu 24.04 LTS is the most widely tested OS. macOS is “perhaps the best choice” for local installs and the only option for iMessage integration. WSL2 is strongly recommended over native Windows.

Network Lockdown

Critical

Port 18789 must NEVER be exposed to the public internet

SecurityScorecard found 40,214 exposed OpenClaw instances across 82 countries, with 93.4% having authentication bypasses. 63% were exploitable via remote code execution. The Gateway binds to 127.0.0.1 by default — verify this stays that way.

$ sudo ufw default deny incoming
$ sudo ufw default allow outgoing
$ sudo ufw allow 22/tcp
$ sudo ufw limit 22/tcp    # rate-limit SSH brute force
# NEVER expose port 18789 publicly
$ sudo ufw enable

For remote access, the officially recommended approach is Tailscale Serve — zero public ports, encrypted mesh networking, and identity-based access. SSH should be hardened with ed25519 keys, password auth disabled, root login disabled, and fail2ban enabled. Full disk encryption (LUKS) is explicitly recommended in the official security docs.


Attack surface: enormous. Stakes: everything.

OpenClaw has shell access, browser control, file system access, email sending capabilities, and connects to your most sensitive accounts — on a loop, without asking. Cisco, Kaspersky, Bitdefender, Palo Alto Networks, and multiple independent researchers have published detailed security analyses. Treat your deployment as production infrastructure.

40,214
Exposed instances found
93.4%
Had auth bypasses
63%
Exploitable via RCE
CVE-2026-25253
CVSS 8.8 — 1-click RCE
Patch Immediately

CVE-2026-25253: One-Click Remote Code Execution

The Control UI trusted gatewayUrl from URL query strings without validation. Clicking a crafted link triggered cross-site WebSocket hijacking, extracting the gateway token in milliseconds, leading to full host compromise — including the ability to disable sandboxing and execute arbitrary commands. Patched January 30, 2026. Update to v2026.1.29+ and rotate all credentials.

ClawHub: The Malicious Skills Problem

This is arguably the most pressing ongoing threat. Multiple security firms have documented widespread malware in the community skill marketplace:

Cisco
26%
Bitdefender
~20%
Koi Security
341 skills
Snyk
283 skills

Cisco scanned 31,000 skills and found 26% contained at least one vulnerability, including command injection, data exfiltration, and prompt injection. The #1-ranked skill (“What Would Elon Do?”) was “functionally malware” performing silent data exfiltration. Koi Security found 341 malicious skills deploying the Atomic macOS Stealer, keyloggers, and backdoors via a campaign called “ClawHavoc.”

“If you can’t understand how to run a command line, this is far too dangerous of a project for you to use safely.” — OpenClaw maintainer

The Security Hardening Checklist

Prompt Injection: The Unsolved Problem

No model is immune

Even OpenClaw’s maintainers acknowledge prompt injection is an industry-wide unsolved problem. Zenity researchers turned OpenClaw into a persistent backdoor by modifying SOUL.md through injected prompts. Kaspersky demonstrated private key extraction via email containing prompt injection. Palo Alto Networks describes the “lethal trifecta”: access to private data + exposure to untrusted content + external communication + persistent memory = delayed multi-turn attack chains.

Mitigation: Use the strongest available models (Anthropic’s Opus series provides the best prompt injection resistance). Enable sandboxing. Use per-channel-peer session scope. But understand: no model is immune.


From zero to production-hardened in one config file

Installation is a one-liner. Getting the configuration right is where the real work lives. All configuration lives in ~/.openclaw/openclaw.json (JSON5 format — comments and trailing commas allowed). The schema is strictly validated: unknown keys or invalid types prevent Gateway boot.

Installation

# macOS / Linux / WSL2 (recommended)
$ curl -fsSL https://openclaw.ai/install.sh | bash

# npm global install
$ npm install -g openclaw@latest
$ openclaw onboard --install-daemon

# Docker
$ git clone https://github.com/openclaw/openclaw.git
$ cd openclaw && ./docker-setup.sh

# From source (development)
$ git clone https://github.com/openclaw/openclaw.git
$ cd openclaw && pnpm install && pnpm ui:build && pnpm build
$ pnpm link --global && openclaw onboard --install-daemon

The onboarding wizard guides you through model/auth setup, workspace creation, channel configuration, skill selection, and daemon installation. It installs the Gateway as a launchd service (macOS), systemd user service (Linux), or scheduled task (Windows).

Production-Ready Baseline

The non-negotiable defaults

The config below represents the community consensus for a security-hardened starting point. bind: "loopback" keeps the Gateway off the public internet. dmScope: "per-channel-peer" prevents cross-user leaks. Docker sandboxing runs all non-main sessions in isolated containers with no network, no filesystem access, and dropped capabilities.

// ~/.openclaw/openclaw.json
{
  gateway: {
    port: 18789,
    bind: "loopback",          // NEVER "0.0.0.0"
    auth: { token: "${OPENCLAW_GATEWAY_TOKEN}" },
  },
  agents: { defaults: {
    model: { primary: "anthropic/claude-sonnet-4-5" },
    sandbox: {
      mode: "non-main",
      docker: { network: "none", readOnlyRoot: true, capDrop: ["ALL"] },
    },
  }},
  session: { dmScope: "per-channel-peer" },
  tools: { profile: "coding", deny: ["gateway"] },
}

Key Configuration Patterns

Model failover

Configure fallback chains so your agent never goes dark. Resolution: primary → auth profile rotation → fallback cascade → error. Cooldowns: 1 min → 5 min → 1 hour.

Multi-agent routing

Isolate workspaces per use case. Bind agents to channels: “home” agent on WhatsApp for personal, “work” agent on Slack for business. Each gets its own workspace, model, and session scope.

Config hot reload

Most changes apply without restart (channels, agents, models, hooks, cron, tools, skills). Only gateway.* settings (port, bind, auth, TLS) and plugins require a Gateway restart. The Gateway drains active turns before restart to prevent message loss.


Six traps the docs won’t save you from

Every tool has its gotchas. OpenClaw has more than most, because its power surface is enormous and its user base ranges from seasoned sysadmins to people who learned what a terminal is last week. These are the issues that generate the most confused Discord messages.

The migration landmine

Upgrading from Clawdbot/Moltbot? The .clawdbot directory migrates to .openclaw automatically, but dual services can remain running, causing port 18789 conflicts.

Fix: systemctl --user stop clawdbot-gateway.service && systemctl --user disable clawdbot-gateway.service

Windows CRLF line endings

Git checks out shell scripts with CRLF instead of LF, causing container startup failures with exit code 126. OpenClaw strongly recommends WSL2 on Windows.

Fix: git config --global core.autocrlf input

npm global install + node managers

A critical bug (fixed in #14919) caused missing Control UI dashboard assets when installed via symlink-based Node managers (nvm, fnm, Homebrew Node). Update to latest.

Fix: npm install -g openclaw@latest

Bundled skills auto-loading

If a CLI tool is installed on your system (e.g. gh for GitHub), the associated bundled skill activates automatically, giving the agent capabilities you didn’t intend.

Fix: Use skills.allowBundled as a whitelist to control exactly which skills are active.

Context window overflow

Long conversations fill the context window, triggering context_length_exceeded errors. This is the #1 source of confusion for new users.

Fix: /compact to summarize, /new for fresh session, /status to monitor usage

Token burn from cron & heartbeat

Each cron execution and heartbeat tick consumes tokens. A 30-minute heartbeat at $0.01–0.05/turn adds up fast. Set HEARTBEAT.md to empty lines to skip idle checks. Use cheaper models for background tasks.

Fix: --model "anthropic/claude-haiku-3-5" for cron jobs, consolidate related checks


Automation, skills, cron, webhooks, and browser control

Once your OpenClaw instance is secured and stable, the real fun begins. The agent runtime supports cron scheduling, webhook-driven workflows, browser automation via Chrome DevTools Protocol, custom skill authoring, plugin development, and even asking the agent to build its own skills. Here are the patterns that matter.

Essential CLI Commands

# Diagnostics
$ openclaw status --all --deep
$ openclaw doctor --deep --yes
$ openclaw security audit --deep --fix
$ openclaw logs --follow --json

# Agent interaction
$ openclaw agent --message "Deploy to staging" --thinking high

# Multi-instance
$ openclaw --profile work gateway
$ openclaw --dev gateway       # port 19001, separate state

Custom Skills

Skills are Markdown instruction files. Create ~/.openclaw/workspace/skills/my-skill/SKILL.md with YAML frontmatter (name, description, required binaries, environment variables) and instruction sections. The agent reads the Markdown and follows the directions using available tools. You can also ask OpenClaw to build skills for itself: “Create a skill that monitors my Hetzner server uptime and alerts me on Telegram if it goes down.”

Cron Recipes

# Morning briefing at 8am ET
$ openclaw cron add --name "Morning Briefing" --cron "0 8 * * *" \
  --tz "America/New_York" --session isolated \
  --message "Summarize inbox + calendar + weather." \
  --announce --channel telegram

# Weekly deep review with powerful model
$ openclaw cron add --name "Weekly Review" --cron "0 6 * * 1" \
  --model "opus" --thinking high \
  --message "Deep analysis of project progress."

HEARTBEAT.md for Proactive Behavior

The agent’s standing orders

HEARTBEAT.md is a checklist the agent evaluates on every heartbeat tick. Structure it by time-of-day: “Always Check” items (calendar reminders, urgent emails), “Business Hours” items (PR reviews, error monitoring), and “Nighttime” (respond HEARTBEAT_OK unless urgent). Empty lines = skip the heartbeat entirely to save tokens.

Browser Automation

OpenClaw launches a managed headless Chrome instance and assigns numeric reference IDs to interactive elements — the AI uses these directly instead of fragile CSS selectors:

$ openclaw browser start
$ openclaw browser open https://example.com
$ openclaw browser snapshot    # AI-readable element refs
$ openclaw browser click ref=btn_1
$ openclaw browser type ref=input_1 "search query"
$ openclaw browser screenshot
$ openclaw browser pdf

Webhook-Driven Workflows

Configure hook mappings in openclaw.json to route external events to agent actions. GitHub PR notifications, Gmail alerts, deployment status — any HTTP POST triggers the agent with a templated message. Webhooks support preset integrations for Gmail, GitHub, and custom JSON bodies.

The Debugging Sequence

# When something goes wrong, follow this order:
$ openclaw status --all          # quick overview
$ openclaw status --deep         # deep probe
$ openclaw logs --follow         # live logs
$ openclaw channels status --probe # channel health
$ openclaw security audit --deep  # security check

Common error codes: 1008 unauthorized = token mismatch. EADDRINUSE = another Gateway is running. context_length_exceeded = use /compact. pairing / pending approval = DM hasn’t been approved.

“The most effective deployment pattern: Tailscale + Docker sandboxing + strict DM allowlists + credential brokering — zero public ports, containerized tool execution, explicit sender authorization, and the agent never seeing raw API keys.” — Community consensus, February 2026