OpenClaw Installation Guide · 2026
How to Install OpenClaw in 2026
Three methods: managed hosting in under a minute, Docker self-host, or npm for developers. Pick what fits your skill level.
What is OpenClaw?
OpenClaw is an open-source AI assistant framework that connects large language models — Claude, GPT-4, Gemini — to messaging platforms like Telegram and WhatsApp. Once installed, you get a personal AI assistant that lives in your chat app, responds to messages, and can be extended with custom tools and workflows.
Installing OpenClaw means getting its gateway service running on a server and connecting it to your messaging accounts. There are three main ways to do this — we cover all of them below. If you want the short version, skip straight to Method 1.
Method 1 — ClawMates Managed Hosting
Setup time: under 1 minute · No Docker or server required
ClawMates is a managed hosting service built specifically for OpenClaw. Instead of installing and configuring everything yourself, you enter your bot credentials and click deploy. The entire OpenClaw installation happens automatically on dedicated infrastructure.
Sign up for ClawMates
Visit clawmates.net/setup and create a free account. The 7-day trial requires no credit card. You get full access to the dashboard, deployment tools, and bot management from day one.
Enter your bot token
For Telegram: paste the bot token you got from @BotFather. For WhatsApp: enter your phone number — ClawMates walks you through the QR pairing. No API keys to configure, no environment variables to set.
Click Deploy
ClawMates provisions a dedicated server, pulls the latest OpenClaw Docker image, writes the configuration, and starts your bot. Within 60 seconds your AI assistant is live and responding to messages. No Docker knowledge needed. No server management. No ongoing maintenance.
What you get: Fully managed OpenClaw installation, automatic restarts on crash, 24/7 uptime monitoring, AI API access included (Claude, GPT-4, Gemini), Telegram + WhatsApp support — all for $29.99/month. Free 7-day trial included.
Method 2 — Docker Self-Host
Setup time: 30–60 minutes · Requires: Linux server, Docker, AI API keys
Docker is the most reliable way to self-host OpenClaw. You get full control over the installation, configuration, and data. This method is suitable for developers comfortable with the command line and Linux server administration.
Prerequisites
docker --version to verify)Step 1 — Pull the OpenClaw Docker image
The official OpenClaw image is published on Docker Hub under the alpine/openclaw namespace:
docker pull alpine/openclaw:latestThis pulls the latest stable release. The image is based on Alpine Linux and weighs around 200MB compressed.
Step 2 — Write the OpenClaw config file
Create a configuration file at /opt/openclaw/config.json. This is the minimal config for a Telegram bot with Claude as the AI backend:
mkdir -p /opt/openclaw
cat > /opt/openclaw/config.json << 'EOF'
{
"gateway": {
"mode": "local",
"controlUi": {
"dangerouslyDisableDeviceAuth": true
}
},
"agents": {
"defaults": {
"model": "claude-opus-4-5"
}
},
"channels": {
"telegram": {
"enabled": true,
"botToken": "YOUR_TELEGRAM_BOT_TOKEN",
"dmPolicy": "open"
}
}
}
EOFReplace YOUR_TELEGRAM_BOT_TOKEN with the token from @BotFather. The gateway.mode must be "local" — other values cause the gateway to exit immediately.
Step 3 — Run the container
Start OpenClaw with the config file mounted and your AI API key passed as an environment variable:
docker run -d \
--name openclaw \
--restart unless-stopped \
--memory 2g \
-p 8080:18789 \
-v /opt/openclaw/config.json:/home/node/.openclaw/config.json \
-e ANTHROPIC_API_KEY=sk-ant-YOUR_KEY \
-e NODE_OPTIONS=--max-old-space-size=1536 \
alpine/openclaw:latest \
node /app/openclaw.mjs gatewayKey flags explained:
--memory 2g — caps container memory at 2GB; without this, an OOM kill will crash the gateway mid-init-p 8080:18789 — exposes the Control UI on port 8080 (OpenClaw listens on 18789 internally)NODE_OPTIONS=--max-old-space-size=1536 — sets Node.js heap limit; prevents JS heap OOM during WASM compilationnode /app/openclaw.mjs gateway — do not use openclaw gateway run (that subcommand was removed in 2026 versions)Step 4 — Verify OpenClaw is running
OpenClaw takes about 5 minutes to initialize on first start. You can watch the logs to confirm it's working:
# Follow container logs
docker logs -f openclaw
# Look for these lines indicating success:
# [gateway] WASM sandbox compiled
# [telegram] Polling started
# [gateway] Listening on 127.0.0.1:18789Once you see the polling started message, open your Telegram app and send a message to your bot. You should get an AI response within a few seconds. Access the Control UI at http://YOUR_SERVER_IP:8080.
Common issues: If the gateway exits immediately, check your config.json for unrecognized keys. Keys like selfPhoneMode, dms, or groups cause an immediate exit=1. Only use the documented config keys listed in the OpenClaw tutorial.
Method 3 — npm Install (For Developers)
Setup time: 15–30 minutes · Requires: Node.js 18+, npm, AI API keys
If you're a developer who wants to run OpenClaw directly on your machine or integrate it into an existing Node.js project, the npm install method gives you the most flexibility. This is also useful for local development and testing before deploying to a server.
Step 1 — Install OpenClaw globally
npm install -g openclawThis installs the openclaw CLI globally. Verify the installation with:
openclaw --versionStep 2 — Initialize a config
Run the init command to generate a starter configuration file in the current directory:
openclaw initThis creates ~/.openclaw/config.json with sensible defaults. Open it in your editor and add your bot token and AI API key.
Step 3 — Edit the config file
The generated config will look similar to this. Fill in your credentials:
// ~/.openclaw/config.json
{
"gateway": {
"mode": "local",
"controlUi": {
"dangerouslyDisableDeviceAuth": true
}
},
"agents": {
"defaults": {
"model": "claude-opus-4-5"
}
},
"channels": {
"telegram": {
"enabled": true,
"botToken": "YOUR_TELEGRAM_BOT_TOKEN",
"dmPolicy": "open"
}
}
}Important config rules:
gateway.mode MUST be "local"agents.defaults.systemPrompt or agents.defaults.temperature — these are unrecognized and cause exit=1dmPolicy explicitly to "open" or the doctor auto-sets it to "pairing" which blocks all messagesStep 4 — Start the gateway
# Set your AI API key
export ANTHROPIC_API_KEY=sk-ant-YOUR_KEY
# Start the gateway
openclaw gatewayThe gateway starts and after ~5 minutes of initialization, your bot is live. The Control UI is available at http://localhost:18789. See the OpenClaw setup guide for more configuration options.
Running as a background service (Linux)
For a persistent installation on Linux, create a systemd service so OpenClaw restarts automatically:
# /etc/systemd/system/openclaw.service
[Unit]
Description=OpenClaw Gateway
After=network.target
[Service]
Type=simple
User=ubuntu
ExecStart=/usr/bin/openclaw gateway
Restart=always
RestartSec=10
Environment=ANTHROPIC_API_KEY=sk-ant-YOUR_KEY
Environment=NODE_OPTIONS=--max-old-space-size=1536
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable openclaw
sudo systemctl start openclaw
sudo systemctl status openclawClawMates vs Docker vs npm — Which Should You Use?
Here's a side-by-side comparison of all three OpenClaw installation methods:
| Feature | ClawMates | Docker | npm |
|---|---|---|---|
| Setup Time | < 1 minute | 30–60 minutes | 15–30 minutes |
| Technical Skill | None | Intermediate (Linux, Docker) | Developer (Node.js) |
| Server Cost | Included | $5–20/mo (VPS) | $5–20/mo (VPS) |
| AI API Keys | Included | Separate ($10–50+/mo) | Separate ($10–50+/mo) |
| Maintenance | Fully managed | Manual | Manual |
| Uptime Monitoring | 24/7 auto-restart | DIY | DIY |
| Auto Updates | Yes | Manual | Manual |
For most users, ClawMates is the right choice. If you have specific self-hosting requirements or are integrating OpenClaw into an existing infrastructure, Docker or npm gives you full control. See the OpenClaw hosting overview for a deeper comparison.
OpenClaw Installation FAQ
Do I need Docker to install OpenClaw?
No. If you use ClawMates managed hosting, Docker is not required. ClawMates handles the entire installation automatically. If you prefer to self-host, Docker is the recommended approach.
How much RAM does OpenClaw need?
OpenClaw requires at least 2GB of RAM. The gateway compiles a WASM sandbox on startup which peaks at ~1.3GB. Using less than 2GB leads to out-of-memory crashes during initialization.
How long does OpenClaw take to start?
OpenClaw's gateway takes approximately 5 minutes to fully initialize on first start. During this time it compiles its WASM sandbox. After the first boot, restarts are faster.
Can I install OpenClaw on Windows?
Yes, using Docker Desktop for Windows or WSL 2. The npm install method also works on Windows. For production use, a Linux server is recommended.
Is OpenClaw free to install?
OpenClaw itself is open-source and free. However, self-hosting requires a server (typically $5–20/month) and AI API keys. ClawMates bundles everything for $29.99/month with a free 7-day trial.
What is the correct command to start the OpenClaw gateway?
In OpenClaw 2026+, use `node /app/openclaw.mjs gateway` or `openclaw gateway`. The older `openclaw gateway run` subcommand was removed. Using the wrong command causes a silent startup failure.
How do I install OpenClaw for WhatsApp?
After installing OpenClaw, open the Control UI at port 18789, go to Channels > WhatsApp, and scan the QR code with your WhatsApp mobile app. ClawMates automates this through the setup wizard.
More OpenClaw Resources
What is OpenClaw?
Learn how OpenClaw works and what you can build with it.
OpenClaw Setup Guide
Step-by-step walkthrough for configuring Telegram and WhatsApp channels.
OpenClaw Hosting Options
Compare managed vs self-hosted OpenClaw deployments in detail.
OpenClaw Tutorial
End-to-end tutorial: create your first AI bot in under 10 minutes.
Skip the installation complexity.
Deploy OpenClaw in under a minute
ClawMates handles the entire OpenClaw installation automatically. Your AI bot is live on Telegram and WhatsApp before you finish your coffee.
Install OpenClaw with ClawMatesFree 7-day trial · No credit card required · Cancel anytime