How to Set Up OpenClaw: Complete Step-by-Step Guide (2026)
OpenClaw is one of the most capable AI agent frameworks available today. But if you've tried to set it up yourself, you already know the problem: the documentation assumes you're comfortable with Linux servers, SSH, Node.js, Docker, and a handful of other tools most people have never touched.
This guide walks through the complete setup process — every step, every gotcha — so you know exactly what you're signing up for before you start.
What You'll Need Before You Begin
Before running a single command, you need to have:
- A cloud server (VPS) running Ubuntu 22.04 or later — a Hetzner CPX21, DigitalOcean Droplet, or similar
- Root SSH access to that server
- A domain name (optional but recommended for SSL)
- An API key from Anthropic, OpenAI, or Google
- 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 ~€6/month.
Step 1: Connect to Your Server via SSH
Once your VPS is provisioned, you'll connect to it from your terminal:
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, fixing permissions.
Step 2: Install Node.js
OpenClaw requires Node.js 18 or later. The version that comes with Ubuntu by default is usually too old, so you need to install it manually:
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 will fail silently or with cryptic errors:
sudo apt-get install -y build-essential git python3
Step 4: Install OpenClaw
Now you can install OpenClaw globally via npm:
npm install -g openclaw
This takes 3–10 minutes depending on your server speed. If you see errors about EACCES permissions, you'll need to fix your npm prefix settings first.
Step 5: Initialize OpenClaw
openclaw init
This creates a config file at ~/.openclaw/openclaw.json. You'll need to edit this manually to configure your AI provider, agent name, and other settings.
Step 6: Set Your AI Provider and API Key
OpenClaw doesn't read API keys from environment variables at runtime — they need to be written to a specific JSON file:
nano ~/.openclaw/agents/main/agent/auth-profiles.json
The format is specific and unforgiving:
{
"version": 1,
"profiles": {
"anthropic:default": {
"type": "api_key",
"provider": "anthropic",
"key": "sk-ant-..."
}
}
}
Get the format wrong and the agent silently fails to authenticate.
Step 7: Configure the Model
openclaw config set agents.defaults.model.primary "anthropic/claude-sonnet-4-6"
Note: you must use the dot-notation path model.primary, not just model. Using model directly causes a type validation error.
Step 8: Set Up the Gateway as a System Service
For your agent to run 24/7, you need to install it as a systemd service. OpenClaw provides a command for this:
openclaw gateway install --force --token YOUR_HOOKS_TOKEN
Then configure it to start on boot:
loginctl enable-linger root
systemctl --user daemon-reload
openclaw gateway start
Step 9: Connect Telegram
If you want a Telegram interface, you'll need a bot token from @BotFather. Then:
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 here — setting dmPolicy before allowFrom causes a validation error.
Step 10: Install a Watchdog (Don't Skip This)
OpenClaw's gateway process can enter a zombie state — the process appears running but the internal WebSocket server has crashed. Your agent stops responding, but systemctl shows it as "active". Without a watchdog, you won't notice until a user complains.
You'll need to write a health-check script and add it to cron to handle this automatically.
Common Errors You'll Hit
"Unknown channel: telegram" — You're on a beta version of OpenClaw. Pin to a stable release: npm install -g openclaw@2026.2.17
"Gateway not reachable" — The gateway is in zombie state. Run openclaw gateway restart.
Agent sends empty responses — Session token bloat. Clear the session files and restart.
"model expects object, not string" — You used config set agents.defaults.model instead of agents.defaults.model.primary.
Total Time Investment
If you're comfortable with Linux and servers: 2–3 hours for the initial setup, plus ongoing maintenance.
If you're non-technical: realistically 1–2 days, learning each tool as you go.
There's an Easier Way
Everything above is what SimplifyClaw does automatically in about 60 seconds.
You click a button, paste a Telegram bot token and an API key, and your OpenClaw agent is live — on a dedicated cloud server, with the watchdog installed, the model configured, Telegram connected, and SSL set up. No terminal required.
The server costs are included in the $39/month subscription. No surprise VPS bills, no midnight restarts, no config file spelunking.
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 entirely
SimplifyClaw deploys your OpenClaw agent in 60 seconds. No server, no terminal, no config files.
Deploy your agent →$39/month · 7-day money-back guarantee