Last updated: March 2026 | Tested on Hostinger KVM 1 VPS (Ubuntu 22.04) | Works worldwide
Affiliate Disclosure: This article contains affiliate links to Hostinger VPS plans. If you purchase through them, I earn a small commission — at no extra cost to you. I’ve personally tested this setup on the exact plan I recommend below.
This OpenClaw VPS setup guide shows you exactly how to install
OpenClaw on a Linux server and keep your AI agent running 24/7
— even when your laptop is off.
OpenClaw is the AI agent everyone’s talking about in 2026 — 247,000+ GitHub stars, WhatsApp and Telegram integration, and it actually does things instead of just answering questions. But there’s one problem nobody tells you upfront:
Running OpenClaw on your laptop means the moment you close the lid, your AI agent goes to sleep.
No background automations. No scheduled tasks. No always-on assistant.
The fix is simple: run OpenClaw on a VPS. This guide shows you exactly how to do it — from picking the right server to having OpenClaw running 24/7 and talking to you on Telegram or WhatsApp.
What You’ll Need Before Starting
- A Hostinger VPS (details below)
- An Anthropic API key (for Claude models — recommended)
- 30–45 minutes
Which VPS Plan Should You Pick?
I tested this entire tutorial on Hostinger’s KVM 1 plan. Here’s what you actually need to know:
| Plan | Price (India) | Price (Global) | RAM | Best For |
|---|---|---|---|---|
| KVM 1 — 20% off | ₹699/mo (~$8.4) | ~$5.99/mo | 4GB | Personal use, learning, 1–2 channels |
| KVM 2 — 20% off | ₹929/mo (~$11) | ~$8.99/mo | 8GB | Power users, 4–5 channels, heavy automation |
| KVM 4 — 20% off | ₹1,259/mo (~$15) | ~$12.99/mo | 16GB | Teams, production workflows |
| KVM 8 — 20% off | ₹2,519/mo (~$30) | ~$24.99/mo | 32GB | Large teams, multiple heavy workloads |
Note for international readers: Hostinger pricing varies by country. The dollar prices above are approximate — your checkout will show the exact price in your local currency. The 20% discount applies globally.
My honest recommendation: Start with KVM 1. OpenClaw with 2–3 connected channels runs comfortably on 4GB RAM. You can always upgrade later with one click from Hostinger’s dashboard.
Quick tip: Choose the annual plan — you effectively get 2 months free vs paying month-to-month.
Step 1: Set Up Your Hostinger VPS
After purchasing your plan, go to your Hostinger dashboard → VPS → Manage.
Choose your OS: Select Ubuntu 22.04 LTS. This is what I tested, and all commands in this guide are for Ubuntu.
Note your server IP address — you’ll need it in the next step.
Set your root password or add your SSH key under Access → Authentication.
Give it 2–3 minutes to finish provisioning. You’ll get an email when it’s ready.
Step 2: Connect to Your VPS via SSH
Open your terminal (Mac/Linux) or PowerShell (Windows) and run:
ssh root@YOUR_SERVER_IP
Replace YOUR_SERVER_IP with the IP from your Hostinger dashboard. Accept the fingerprint prompt and enter your password.
You’re now inside your VPS. Every command from here runs on the server, not your laptop.
Step 3: Update the Server and Install Node.js
First, update packages:
apt update && apt upgrade -y
OpenClaw requires Node.js 22 or higher (Node 24 recommended). Install it:
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt install -y nodejs
Verify the installation:
node --version
# Should show v22.x.x or higher
Step 4: Install OpenClaw
Run the official install script:
curl -fsSL https://openclaw.ai/install.sh | bash
This installs the OpenClaw CLI and all dependencies. It takes 1–2 minutes.
After installation completes, verify it worked:
openclaw --version
Step 5: Run OpenClaw Onboarding
This is the most important step. Onboarding sets up your AI model, gateway, and channels:
openclaw onboard --install-daemon
The --install-daemon flag tells OpenClaw to install itself as a systemd service — this means it will automatically start whenever your VPS reboots, with zero manual effort from you.
During onboarding, you’ll be asked:
1. API Key: Choose Anthropic and enter your API key. Get one at console.anthropic.com if you don’t have one. Claude Sonnet is the best balance of speed and cost for most users.
2. Gateway port: Leave as default (18789) unless you have a specific reason to change it.
3. Channels: You can set up Telegram or WhatsApp now, or skip and do it later. I recommend setting up at least Telegram during onboarding — it’s the easiest.
Step 6: Verify the Gateway Is Running
Check that the OpenClaw service started correctly:
openclaw gateway status
You should see something like: Gateway is running on port 18789.
Open the dashboard:
openclaw dashboard
This gives you a URL to access the OpenClaw Control UI from your browser. You’ll see something like http://YOUR_SERVER_IP:18789/.
Step 7: One Critical Security Fix (Don’t Skip This)
By default, OpenClaw’s Canvas Host binds to 0.0.0.0 — meaning anyone on the internet can reach your OpenClaw interface. Fix this immediately.
Find your config file:
cat ~/.openclaw/openclaw.json
Edit it to add the loopback binding:
nano ~/.openclaw/openclaw.json
Add or update the gateway section:
{
"gateway": {
"bind": "loopback",
"port": 18789
}
}
Save and restart the service:
systemctl restart openclaw
This ensures your OpenClaw interface is only accessible to you — not to the open internet.
Step 8: Set Up a Firewall (Recommended)
ufw allow ssh
ufw allow 18789
ufw enable
This allows SSH access and your OpenClaw port while blocking everything else.
Step 9: Connect Your Messaging Channel
If you skipped channel setup during onboarding, do it now.
For Telegram (easiest):
- Open Telegram and search for
@BotFather - Send
/newbotand follow the prompts to create a bot - Copy the bot token
- In your VPS terminal:
openclaw channel add telegram - Paste your bot token when prompted
Test it by sending your Telegram bot a message. You should get a response within a few seconds.
For WhatsApp:
Run openclaw channel add whatsapp and follow the QR code pairing process.
Step 10: Test Your Always-On Agent
From your terminal, send a test message:
openclaw agent --message "What time is it and what can you help me with?"
Or just message your Telegram/WhatsApp bot directly. If you get a response, everything is working.
Now close your laptop. Your OpenClaw agent is still running — on your VPS, 24/7.
Understanding API Costs (Important)
OpenClaw uses your Anthropic API key and you pay per token. This is different from a ChatGPT subscription.
Real-world cost estimate for personal use:
- Light use (10–20 tasks/day): ~$3–5/month
- Heavy use (100+ tasks/day, long sessions): ~$15–25/month
The biggest cost driver is context accumulation. The longer a session runs, the more old conversation gets re-sent with every new message. Habit: start fresh sessions regularly using /new or openclaw session new.
Model recommendations:
- Claude Sonnet 4.6 — best for most tasks, reasonable cost
- Claude Haiku 4.5 — fastest, cheapest, good for simple automations
- Claude Opus 4.6 — most powerful, ~1.7× more expensive
Common Errors and Fixes
ENOENT: no such file or directory, mkdir '/home/node'
This is the most common error for VPS setups. It happens when OpenClaw can’t find its expected home directory. Fix:
mkdir -p /home/node
OPENCLAW_HOME=/home/node openclaw gateway
Or set it permanently in your environment:
echo 'export OPENCLAW_HOME=/home/node' >> ~/.bashrc
source ~/.bashrc
Gateway not starting after reboot:
systemctl status openclaw
systemctl enable openclaw # Makes sure it starts on boot
systemctl start openclaw
openclaw doctor — your first debugging tool:
Always run this first when something isn’t working:
openclaw doctor
It checks your Node version, API connectivity, gateway status, and channel connections.
Keeping OpenClaw Updated
OpenClaw releases updates frequently. Update with:
npm install -g openclaw@latest
systemctl restart openclaw
Check the current channel:
openclaw update --channel stable # stable, beta, or dev
Stay on stable unless you specifically want to test new features.
What’s Next
Once you have OpenClaw running, the real fun begins. Some things worth exploring:
Skills: OpenClaw has a skills system where you can install community-built automations from ClawHub. Each skill is a directory with a SKILL.md file. Browse and install carefully — always read the source code before installing any skill.
MCP Servers: Connect external tools to OpenClaw via the MCP (Model Context Protocol) — this is how you give your agent access to your calendar, email, or custom tools.
Scheduled tasks: Set up automations that run at specific times — like a daily news briefing sent to your Telegram every morning at 8am.
Summary
| Step | What You Did |
|---|---|
| Bought VPS | Hostinger KVM 1 (~$6/mo · ₹699/mo in India), Ubuntu 22.04 |
| Installed Node.js | v22+ via NodeSource |
| Installed OpenClaw | Official install script |
| Ran onboarding | Set up API key + daemon |
| Fixed security | Canvas bind to loopback |
| Connected channel | Telegram or WhatsApp |
| Tested | Agent responding 24/7 |
Your VPS is now running OpenClaw as a persistent background service. It survives reboots, runs while you sleep, and costs less per month than a cup of coffee at a café.
More OpenClaw & AI Agent Guides for 2026
- How to Set Up OpenClaw.ai: Complete Tutorial for Beginners (2026)
- How to Build Custom MCP Servers (Python & Node.js) — 2026 Guide
- What Is Agentic AI? Explained Simply (2026)
- AI Agents in 2026: What They’re Good At, What They Break
- Best AI Agents You Can Use Right Now (2026)
- ChatGPT vs Claude vs Gemini vs Perplexity (2026): Tested All 4
Have questions? Drop them in the comments below. If you found this guide useful, the affiliate links above are a great way to support AIInsider — you also get 20% off your Hostinger plan.
For the latest OpenClaw updates and Indian AI news, subscribe to the AIInsider newsletter.

