OpenClaw is a free, open-source self-hosted AI assistant that connects to messaging apps — Telegram, WhatsApp, Slack, Discord — and runs AI tasks around the clock on your own infrastructure. Running it on a VPS instead of your laptop means it never sleeps, never hogs your RAM, and keeps your personal files off the equation.
This guide focuses on the absolute fastest path: the official one-liner installer, pointed at a fresh Ubuntu VPS. No Docker, no manual npm fiddling — just five steps and a working agent.
What you need before you start
| VPS RAM | 2 GB minimum (4 GB recommended) |
| CPU | 2 vCPU cores |
| OS | Ubuntu 22.04 or 24.04 LTS |
| AI API key | Anthropic, OpenAI, or Google Gemini |
| Messaging app | Telegram account (easiest to set up) |
| Estimated time | Under 20 minutes |
Popular VPS providers with verified OpenClaw guides include DigitalOcean, Hetzner, Hostinger, and Vultr. Any provider that gives you a fresh Ubuntu droplet works. Grab your AI API key before you SSH in — the installer will ask for it immediately and most delays happen from hunting it down mid-setup.
Note on 1 GB VPS plans: The official docs say 1 GB is enough, but in practice the npm install step often gets killed mid-run due to memory pressure. Stick to 2 GB or temporarily add a 2 GB swap file before installing.
Step-by-step setup
1
SSH into your VPS and update packages
Connect to your server and make sure the system is fully up to date before installing anything.
2
Run the official one-liner installer
The installer handles Node.js, npm, and the OpenClaw CLI automatically, then launches the interactive setup wizard.
3
Complete the onboarding wizard
Enter your AI API key, connect your messaging channel (Telegram bot token), and set a gateway access token.
4
Enable the daemon so it survives reboots
One extra command lets systemd manage OpenClaw as a background service that restarts automatically.
5
Access the web dashboard (optional)
Open the gateway UI via SSH tunnel to manage agents, view logs, and change settings without exposing a public port.
The actual commands
Connect to your VPS, then run these in order:
# 1. Update the system sudo apt update && sudo apt upgrade -y # 2. Run the OpenClaw installer (macOS/Linux path) curl -fsSL https://openclaw.ai/install.sh | bash # 3. After the wizard completes, enable the daemon loginctl enable-linger $USER openclaw onboard --install-daemon # 4. Verify it is running systemctl --user status openclaw # 5. SSH tunnel to access the web UI locally ssh -L 18789:localhost:18789 user@your-vps-ip
After step 5, open http://localhost:18789 in your browser and log in with the gateway token you set during onboarding.
Setting up Telegram in 2 minutes
Telegram is the most popular channel for OpenClaw because it requires no phone number exposure and works on every device. During the wizard — or later in the dashboard under Channels — paste the bot token you get from @BotFather on Telegram. Once connected, you can send messages to your bot and OpenClaw will respond, run tasks, browse the web, and remember context across sessions.
A few things worth knowing
Keep the gateway on loopback. The secure default is to never expose port 18789 publicly. Access the dashboard only through an SSH tunnel or Tailscale Serve. If you must bind to a network interface, always set a gateway auth token.
Choosing your AI model. Claude (Anthropic) is the most popular choice in the OpenClaw community for instruction-following. GPT-4o is a solid all-rounder. Gemini Flash is the cheapest for high-volume use. You can configure multiple providers and switch per conversation.
Staying up to date. OpenClaw ships updates frequently. Upgrade with npm update -g openclaw then systemctl --user restart openclaw. Your credentials and config in ~/.openclaw/ are never touched by updates.
Typical cost. A $5–$10/month VPS handles personal use comfortably. API costs for light use (a few dozen queries per day) run roughly $5–$15/month on top of that, depending on which model you use. Switching to a lighter model like Gemini Flash for routine queries is the easiest way to keep costs low.
Common issues
Gateway won't start: check logs with journalctl --user -u openclaw -n 50. Most failures are a missing API key or a port conflict.
npm install killed on low-RAM VPS: add a temporary swap file first — fallocate -l 2G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile.
Telegram bot not responding: run openclaw channels list and verify the bot token. Also check that your VPS can reach api.telegram.org — some providers block outbound traffic by default.
There's your article — complete with a thumbnail illustration showing the VPS → OpenClaw → messaging channels architecture, plus all the key content:
- What you need (specs table)
- 5 clear steps with the exact commands
- Telegram setup walkthrough
- Security tips, model selection, cost estimates
- Troubleshooting for the most common issues
The fastest real-world path is the official curl | bash installer — it handles Node.js and all dependencies, then drops you into a guided wizard. Total setup time is under 20 minutes if you have your API key ready.