Last updated: March 202612 min read

How to Install OpenClaw in 2026

Four methods, one goal: your own AI assistant running on hardware you control. Pick the method that matches your skill level and get started in under 10 minutes.

Prefer experts handle this?

Skip the terminal. Our team installs, secures, and configures OpenClaw for you. Plans start at $299.

View Plans

Prerequisites

Before you install OpenClaw, make sure your server meets these minimum requirements. Running below these specs leads to slow responses, crashed processes, and frustrated users.

CPU

2 vCPU cores minimum. 4 vCPU recommended for multi-channel setups.

RAM

4 GB minimum. 8 GB recommended if running local LLMs through Ollama.

Storage

20 GB SSD minimum. Memory databases and logs grow over time. Plan for 50 GB long-term.

OS

Ubuntu 22.04+, Debian 12+, or any Linux with Docker support. macOS and Windows (WSL2) work too.

You will also need

  • SSH access to your server. If you can run ssh root@your-server-ip, you are good.
  • An AI model API key from Anthropic, OpenAI, Google, or a local model via Ollama. Get one before you start.
  • A domain name (optional). Not required, but recommended for SSL and clean webhook URLs.
Need a VPS? We recommend Hetzner (CX22 at ~$4.50/month) or DigitalOcean (Basic Droplet at $6/month). Both exceed the minimum requirements.

1.One-Liner (Recommended)

The fastest way to install OpenClaw. One command handles everything: dependency checks, downloads, configuration wizard, and service setup. Works on Ubuntu, Debian, CentOS, Fedora, Arch, and macOS.

curl -fsSL https://openclaw.sh | bash

What the installer does

1

Detects your operating system and package manager

2

Installs Node.js 20 LTS if not present

3

Installs pnpm globally for faster dependency resolution

4

Downloads the latest stable OpenClaw release

5

Runs the interactive configuration wizard

6

Creates a systemd service (Linux) or launchd agent (macOS)

7

Starts OpenClaw and confirms it is running

Expected output

[info] Detecting OS... Ubuntu 22.04 (x86_64)
[info] Node.js v20.18.1 found
[info] Installing pnpm...
[info] Downloading OpenClaw v2026.3.8...
[info] Running configuration wizard...
   → AI Provider: anthropic
   → Model: claude-sonnet-4-5
   → Port: 3100
[ok]   OpenClaw is running at http://localhost:3100
       Dashboard: http://localhost:3100/dashboard
The installer never runs with elevated privileges beyond what it needs. Review the script source before running it. We recommend this for all piped scripts.

Custom flags

Pass flags to customize the installation without the interactive wizard.

# Skip the wizard with pre-set values
curl -fsSL https://openclaw.sh | bash -s -- \
  --provider anthropic \
  --model claude-sonnet-4-5 \
  --port 3100 \
  --no-systemd

2.npm / pnpm

Best for developers who want full control over the process. This method gives you explicit visibility into every step.

Step 1 — Install Node.js 20+

OpenClaw requires Node.js 20 or later. Check your version first.

node --version
# If below v20, install via nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install 20
nvm use 20

Step 2 — Install pnpm

npm install -g pnpm

Step 3 — Install OpenClaw globally

pnpm install -g openclaw
# Or with npm:
npm install -g openclaw

Step 4 — Initialize the configuration

The init command creates a .env file and a data/ directory in your current folder.

mkdir ~/openclaw && cd ~/openclaw
openclaw init

Step 5 — Edit your .env file

.envenv
# ~/openclaw/.env
OPENCLAW_PORT=3100
AI_PROVIDER=anthropic
AI_MODEL=claude-sonnet-4-5
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxx
# Or for OpenAI:
# AI_PROVIDER=openai
# AI_MODEL=gpt-5
# OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxx

Step 6 — Start OpenClaw

openclaw start
# Or run in background:
openclaw start --daemon
Use openclaw logs to watch real-time output. Add --follow to stream new entries.

3.Docker

Docker isolates OpenClaw from your host system. Updates are simple: pull the new image and restart. This method is ideal for production servers and teams.

Step 1 — Install Docker

# Ubuntu / Debian
curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER
# Log out and back in for group changes to take effect

Step 2 — Create docker-compose.yml

docker-compose.ymlyaml
version: "3.8"

services:
  openclaw:
    image: openclaw/openclaw:latest
    container_name: openclaw
    restart: unless-stopped
    ports:
      - "3100:3100"
    volumes:
      - ./data:/app/data        # Persistent memory & databases
      - ./config:/app/config    # Configuration files
      - ./.env:/app/.env        # Environment variables
    environment:
      - NODE_ENV=production
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3100/health"]
      interval: 30s
      timeout: 10s
      retries: 3

Step 3 — Create your .env file

.envenv
OPENCLAW_PORT=3100
AI_PROVIDER=anthropic
AI_MODEL=claude-sonnet-4-5
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxx

# Optional: Enable persistent memory
MEMORY_ENABLED=true
MEMORY_PROVIDER=sqlite

# Optional: WhatsApp channel
WHATSAPP_ENABLED=false
WHATSAPP_PHONE_ID=
WHATSAPP_TOKEN=

Step 4 — Start the container

docker compose up -d

# Check the logs
docker compose logs -f openclaw

Updating with Docker

docker compose pull
docker compose up -d
Always bind-mount your data/ directory. Without a volume, you lose all memory and conversation history when the container restarts.

4.From Source

Build from source when you want to modify core behavior, contribute upstream, or run a pre-release branch. This path requires developer experience.

Step 1 — Clone the repository

git clone https://github.com/openclaw/openclaw.git
cd openclaw

Step 2 — Install dependencies

# Requires Node.js 20+ and pnpm
pnpm install

Step 3 — Copy and edit the environment file

cp .env.example .env
nano .env
# Set your AI_PROVIDER, API keys, and port

Step 4 — Build and start

pnpm build
pnpm start

# For development with hot reload:
pnpm dev

Updating from source

git pull origin main
pnpm install
pnpm build
# Restart your OpenClaw process or service
Building from source compiles TypeScript to JavaScript. The build step takes 30 to 90 seconds depending on your hardware. Subsequent builds are faster thanks to caching.

Post-Installation

OpenClaw is running. Now configure your AI model, connect a messaging channel, and verify everything works.

Configure Your AI Model

OpenClaw supports multiple AI providers. Set your preferred model in the .env file or through the dashboard.

ProviderModelsCost / msg
AnthropicClaude Opus 4.6, Sonnet 4.5, Haiku 4.5$0.001 – $0.05
OpenAIGPT-5, GPT-5 mini$0.002 – $0.03
GoogleGemini 3 Pro, Gemini 3 Flash$0.001 – $0.02
DeepSeekDeepSeek V3~$0.005
MistralMistral Large~$0.01
Ollama (local)Llama 4, Qwen 3, Mistral, and any GGUF modelFree
.envenv
# Example: Switch to Claude Opus 4.6
AI_PROVIDER=anthropic
AI_MODEL=claude-opus-4-6
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxx

# Example: Use a local model via Ollama
AI_PROVIDER=ollama
AI_MODEL=llama4:8b
OLLAMA_HOST=http://localhost:11434
Start with a cheaper model like Haiku 4.5 or Gemini 3 Flash while testing. Switch to a stronger model once your channels and memory are configured.

Set Up Your First Channel (WhatsApp Example)

OpenClaw supports 191+ integrations. WhatsApp is the most popular starting point. Here is how to connect it.

1

Create a Meta Business App

Go to developers.facebook.com. Create a new Business app. Enable the WhatsApp product.

2

Get your Phone Number ID and token

In the WhatsApp API settings, copy your Phone Number ID and generate a permanent access token.

3

Add credentials to .env

.envenv
WHATSAPP_ENABLED=true
WHATSAPP_PHONE_ID=123456789012345
WHATSAPP_TOKEN=EAAxxxxxxxxxxxxxxxx
WHATSAPP_VERIFY_TOKEN=your-random-verify-string
4

Set the webhook URL

In Meta's dashboard, set your webhook URL to https://your-domain.com/api/webhook/whatsapp and use the verify token from step 3.

5

Restart OpenClaw and send a test message

openclaw restart
# Or with Docker:
docker compose restart openclaw

Send Your First Message

Open WhatsApp and send "Hello" to your connected number. You should receive a response within 2 to 5 seconds. If you do not have WhatsApp configured, test through the dashboard.

# Quick test via CLI
curl -X POST http://localhost:3100/api/chat \
  -H "Content-Type: application/json" \
  -d '{"message": "Hello, what can you do?"}'

A successful response returns JSON with the AI's reply. If you get an error, check the troubleshooting section below.

Common Errors & Solutions

Most installation problems fall into five categories. Here is how to fix each one.

Error: Port 3100 already in use

Another process occupies the default OpenClaw port.

# Find what is using port 3100
sudo lsof -i :3100

# Option A: Kill the process
sudo kill -9 <PID>

# Option B: Change OpenClaw's port
# In .env, set:
OPENCLAW_PORT=3200

Error: Node version mismatch

OpenClaw requires Node.js 20 or later. Older versions cause syntax errors on startup.

# Check your current version
node --version

# If below v20, upgrade with nvm:
nvm install 20
nvm alias default 20
nvm use 20

# Verify
node --version  # Should show v20.x.x or higher

Error: Docker permission denied

You see "permission denied while trying to connect to the Docker daemon socket".

# Add your user to the docker group
sudo usermod -aG docker $USER

# Log out and back in, then verify:
docker ps
# If you still get errors, restart the Docker service:
sudo systemctl restart docker

Error: SSL certificate issues

Webhook providers like Meta reject HTTP endpoints. You need HTTPS.

# Install Certbot and get a free Let's Encrypt certificate
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d your-domain.com

# Auto-renewal is configured automatically
# Test renewal:
sudo certbot renew --dry-run
If you are behind Cloudflare, set SSL mode to "Full (Strict)" and use Cloudflare's origin certificates instead of Let's Encrypt.

Error: Out of memory / process killed

The Linux OOM killer terminates OpenClaw when the server runs out of RAM.

# Check available memory
free -h

# Option A: Add swap space (quick fix)
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

# Option B: Upgrade your VPS to 4+ GB RAM

# Option C: Use a lighter AI model
# In .env, switch from Opus to Haiku:
AI_MODEL=claude-haiku-4-5

The AI model itself runs remotely via API. Memory issues come from OpenClaw's memory database and Node.js process, not the model. 4 GB RAM is the practical minimum.

Post-Install Security

A running OpenClaw instance without security is a liability. Research shows that 93.4% of public instances lack basic authentication, and 42,665 are exposed on the open internet. Do not become a statistic.

Security checklist (quick version)

  • Enable authentication in .env: set AUTH_ENABLED=true and AUTH_SECRET to a random 32-character string
  • Configure UFW firewall: allow only ports 22 (SSH), 80 (HTTP), and 443 (HTTPS)
  • Set up SSL/TLS with Let's Encrypt or Cloudflare origin certificates
  • Disable the dashboard on production or protect it behind authentication
  • Keep OpenClaw updated: run openclaw update or docker compose pull weekly
  • Use a reverse proxy (Nginx or Caddy) in front of OpenClaw
  • Never expose port 3100 directly to the internet
# Quick firewall setup (Ubuntu/Debian)
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow 22/tcp    # SSH
sudo ufw allow 80/tcp    # HTTP
sudo ufw allow 443/tcp   # HTTPS
sudo ufw enable

# Verify
sudo ufw status

This is the abbreviated version. For the full 12-point security audit we apply to every client installation, read our Security Guide & Security Checklist.

FAQ

Need a hand?

Our team installs, secures, and configures OpenClaw on your server. Persistent memory, multi-channel setup, and a 12-point security audit included.