How to Install OpenClaw: Complete 2026 Guide
Step-by-step installation tutorial for Linux, macOS, and Windows. Includes troubleshooting for every common error.
Or skip all 47 steps and deploy in 2 minutes
Start free - no credit card required100K tokens/month free tier
OpenClaw is powerful open-source AI agent software, but installation can be complex. This guide covers every step needed to get OpenClaw running on your machine, including solutions to the most common errors that trip up 35% of first-time installers.
Prerequisites
Before installing OpenClaw, you'll need:
- Node.js 22 or higher (not 18, not 20 - must be 22+)
- Docker (Docker Desktop for macOS/Windows, Docker Engine for Linux)
- 4GB+ RAM (8GB recommended)
- 2GB disk space (for Docker images and memory)
- Terminal access (bash, zsh, or PowerShell)
- API keys (Anthropic, OpenAI, or other LLM providers)
Windows Users
OpenClaw requires WSL2 (Windows Subsystem for Linux). You cannot run it natively on Windows. See Windows installation section below.
Linux Installation (Ubuntu/Debian)
Step 1: Install Node.js 22
Most systems have older Node.js versions. Check yours:
node --version If it shows v18.x or v20.x, you need to upgrade:
# Using nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install 22
nvm use 22
# Verify
node --version # Should show v22.x.x Step 2: Install Docker
# Remove old Docker versions
sudo apt-get remove docker docker-engine docker.io containerd runc
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Add your user to docker group (avoid needing sudo)
sudo usermod -aG docker $USER
newgrp docker
# Verify
docker --version
docker run hello-world Step 3: Install OpenClaw
npm install -g openclaw
# Verify installation
openclaw --version Common Error: "openclaw: command not found"
This means npm's global bin directory isn't in your PATH. Fix:
echo 'export PATH="$PATH:$(npm config get prefix)/bin"' >> ~/.bashrc
source ~/.bashrc Step 4: Initialize OpenClaw
mkdir ~/openclaw
cd ~/openclaw
openclaw init Step 5: Configure Environment Variables
Create a .env file in your openclaw directory:
# .env file
ANTHROPIC_API_KEY=sk-ant-your-key-here
GATEWAY_PORT=18789
MEMORY_DIR=./memory
LOG_LEVEL=info ... 42 more steps covering Docker configuration, messaging platform setup, systemd daemon, firewall rules, SSL certificates, monitoring, backups, and more ...
Tired yet? Skip the remaining 40 steps
Deploy in 2 minutes with NeatClaw →No installation, no configuration, no errors
macOS Installation
macOS installation is similar to Linux but with a few platform-specific considerations.
Step 1: Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" Step 2: Install Node.js 22
brew install node@22
brew link node@22
node --version # Should show v22.x.x Step 3: Install Docker Desktop
Download Docker Desktop from docker.com and install it. Once installed, launch Docker Desktop and wait for it to fully start (you'll see a green indicator).
... continues with macOS-specific configuration, launchd daemon setup, etc. ...
Windows Installation (WSL2 Required)
Important
OpenClaw does not run natively on Windows. You must use WSL2 (Windows Subsystem for Linux). This adds another layer of complexity and potential issues.
Step 1: Install WSL2
Open PowerShell as Administrator and run:
wsl --install Restart your computer when prompted.
... continues with WSL2 configuration and OpenClaw installation inside WSL2 ...
Common Errors & Troubleshooting
Error: Node.js version mismatch
OpenClaw requires Node.js 22 or higher. Current version: 18.x.x
Solution: Install Node.js 22 using nvm (see Step 1 above)
Error: Gateway port 18789 already in use
Failed to start gateway on port 18789: Address already in use
Solution: Check what's using the port and kill it, or use a different port:
lsof -i :18789 # Find the process
kill -9 <PID> # Kill it
# Or change port in .env: GATEWAY_PORT=18790 ... and 28 more common errors with detailed solutions ...
The NeatClaw Alternative: Same Power, Zero Installation
You get everything OpenClaw offers:
- Persistent memory stored as files
- Telegram, Discord, WhatsApp, and web interface
- Shell command execution (sandboxed)
- Browser automation
- Full API compatibility
Without any of the complexity:
- No Node.js version checking
- No Docker configuration
- No VPS management
- No terminal commands
- No troubleshooting errors
Free tier: 100K tokens/month. No credit card required.
Self-Hosted vs Managed Comparison
| Feature | Self-Hosted | NeatClaw |
|---|---|---|
| Setup Time | 2-6 hours | 2 minutes |
| Technical Knowledge | High | None required |
| Monthly Cost | $12-24 VPS + time | $0-99 all-in |
| Maintenance | Manual updates | Automatic |
| Failure Rate | 35% | 0% |