Skip to main content
🦞SimplifyClaw/Blog
April 8, 2026 · 8 min read
openclaw

How to Set Up OpenClaw: Complete Step-by-Step Guide (2026)

The full honest guide to setting up OpenClaw on your own server — every step, every gotcha, and why most people give up halfway through.

SimplifyClaw·8 min read·April 8, 2026

Setting up OpenClaw on your own server takes 2–4 hours if you're technical. If you're not comfortable with Linux, SSH, and Node.js, it can take significantly longer. This guide covers every step — so you know exactly what you're getting into before you start.

Want to skip all of this? SimplifyClaw deploys OpenClaw in 60 seconds with no server setup required. Plans start at $9.99/month with a 7-day money-back guarantee.

· · ·

What You'll Need Before You Begin

Before running a single command, you need:

  • A cloud server (VPS) running Ubuntu 22.04 or later — see our best VPS guide for provider recommendations
  • Root SSH access to that server
  • A domain name (optional but recommended for SSL)
  • An AI API key from Anthropic, OpenAI, or Google — see our API key setup guide
  • A Telegram bot token if you want Telegram integration

If you don't have a VPS yet, budget 20–30 minutes to provision one. Hetzner is the best value — a CPX21 starts at ~€8/month.

· · ·

Step 1: Connect to Your Server via SSH

Once your VPS is provisioned, connect from your terminal:

bash
ssh root@YOUR_SERVER_IP

If you've never used SSH before, this step alone can take 30–60 minutes to set up properly — generating keys, adding them to the server, and fixing permissions.

Step 2: Install Node.js

OpenClaw requires Node.js 18 or later. The default Ubuntu version is usually too old:

bash
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
node --version  # should show v20.x

Step 3: Install Build Tools

Some Node.js dependencies require native compilation. Without these, the install silently fails:

bash
sudo apt-get install -y build-essential git python3

Step 4: Install OpenClaw

bash
npm install -g openclaw

This takes 3–10 minutes. If you see EACCES permission errors, you need to fix your npm prefix settings first.

Important: Pin to a stable version immediately after installing. The default install can pull beta releases with regressions:

bash
npm install -g openclaw@2026.4.15

Step 5: Initialize OpenClaw

bash
openclaw init

This creates a config file at ~/.openclaw/openclaw.json. You'll edit this to configure your AI provider, agent name, and other settings.

Step 6: Set Your AI Provider and API Key

OpenClaw reads API keys from a specific JSON file — not from environment variables:

bash
nano ~/.openclaw/agents/main/agent/auth-profiles.json

The format is:

json
{
  "version": 1,
  "profiles": {
    "anthropic:default": {
      "type": "api_key",
      "provider": "anthropic",
      "key": "sk-ant-..."
    }
  }
}

Use "google:default" for Gemini, "anthropic:default" for Claude, "openai:default" for GPT-4o. Get the format wrong and the agent silently fails to authenticate.

Step 7: Configure the AI Model

bash
openclaw config set agents.defaults.model.primary "anthropic/claude-sonnet-4-6"

Use dot-notation (model.primary), not just model. Using model directly causes a type validation error. For Gemini: "google/gemini-2.0-flash". For GPT-4o: "openai/gpt-4o".

See our AI model comparison for help choosing.

Step 8: Set Gateway Mode

bash
openclaw config set gateway.mode local

Step 9: Install the Gateway as a System Service

For 24/7 operation, install as a user-level systemd service:

bash
openclaw gateway install --force --token YOUR_HOOKS_TOKEN
loginctl enable-linger root
systemctl --user daemon-reload
openclaw gateway start

Step 10: Connect Telegram

Create a bot via @BotFather if you haven't already (20 seconds — see our Telegram setup guide), then:

bash
openclaw config set channels.telegram.botToken "YOUR_TOKEN"
openclaw config set channels.telegram.allowFrom '["*"]'
openclaw config set channels.telegram.dmPolicy open
openclaw gateway restart

Order matters: set allowFrom before dmPolicy open or validation fails.

Step 11: Install a Watchdog (Don't Skip This)

OpenClaw's gateway can enter a zombie state where the process looks active but stops responding. Create /opt/openclaw/healthcheck.sh:

bash
#!/bin/bash
export HOME=/root
TOKEN="YOUR_HOOKS_TOKEN"
STATUS=$(OPENCLAW_GATEWAY_TOKEN="$TOKEN" /usr/bin/openclaw channels status 2>/dev/null)
echo "$STATUS" | grep -q 'running' && exit 0
/usr/bin/openclaw gateway restart

Make it executable and add to cron:

bash
chmod +x /opt/openclaw/healthcheck.sh
crontab -e
# Add: * * * * * /opt/openclaw/healthcheck.sh
· · ·

Common Errors You'll Hit

"Unknown channel: telegram" — You're on a beta OpenClaw version. Pin to stable:

bash
npm install -g openclaw@2026.4.15

"Gateway not reachable" — Gateway is in zombie state. Run: openclaw gateway restart

Agent sends empty responses — Session bloat from accumulated context. See our troubleshooting guide for the fix.

"model expects object, not string" — Used config set agents.defaults.model instead of agents.defaults.model.primary.

· · ·

Total Time Investment

  • Technical users comfortable with Linux: 2–3 hours initial setup, ~30 min/month ongoing
  • Non-technical users: Realistically 1–2 full days, learning each tool as you go

For a full assessment of whether self-hosting makes sense for your situation, see our self-hosting vs SimplifyClaw comparison.

· · ·

Frequently Asked Questions

Do I need a domain name to run OpenClaw? No — a domain is optional. OpenClaw works with just an IP address. A domain is only needed if you want SSL for the Web UI gateway.

Can OpenClaw run on Windows or Mac? OpenClaw is designed for Linux servers. You can technically run it on macOS for development but it's not recommended for production use.

How do I keep OpenClaw updated? See our updating guide. The short answer: don't auto-update. Pin to confirmed stable versions and update deliberately.

What if my agent crashes? If you've installed the watchdog in Step 11, it restarts automatically. Without it, you'd need to manually run openclaw gateway restart.

How do I give my agent a custom name or personality? Use the BOOTSTRAP.md system. See our custom instructions guide.

· · ·

There's an Easier Way

Everything above — server provisioning, Node.js installation, OpenClaw configuration, Telegram connection, watchdog setup — is what SimplifyClaw automates in 60 seconds.

You paste a Telegram bot token and an API key, and your agent is live on a dedicated server with monitoring, auto-restart, daily backups, and a web dashboard. Plans start at $9.99/month.

If you enjoyed the process above, self-hosting is a great option and this guide has everything you need. If you'd rather just have a working agent: deploy with SimplifyClaw in 60 seconds.

Skip the setup

Deploy your OpenClaw agent in 60 seconds.

SimplifyClaw handles the server, watchdog, SSL, and Telegram setup. Sign in with Google, add your API key, and your agent is live.

Zero server setup
24/7 uptime + auto-restart
Bring your own API key
Cancel anytime
Deploy my agent →Plans from $9.99/mo