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:
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:
Step 3: Install Build Tools
Some Node.js dependencies require native compilation. Without these, the install silently fails:
Step 4: Install 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:
Step 5: Initialize OpenClaw
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:
The format is:
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
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
Step 9: Install the Gateway as a System Service
For 24/7 operation, install as a user-level systemd service:
Step 10: Connect Telegram
Create a bot via @BotFather if you haven't already (20 seconds — see our Telegram setup guide), then:
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:
Make it executable and add to cron:
Common Errors You'll Hit
"Unknown channel: telegram" — You're on a beta OpenClaw version. Pin to stable:
"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.