ClawSquire/Guides/VPS Setup

Guide

How to Set Up OpenClaw on a VPS

Running OpenClaw on a VPS keeps your AI agent always on and accessible from anywhere. Ideal for Telegram and WhatsApp bots that need 24/7 uptime. This guide covers everything from server selection to remote management.

Quick Answer

5 steps: 1) Get a VPS ($3-10/month, Ubuntu 22.04+, 1GB RAM). 2) Install Node.js 20+ and OpenClaw. 3) Run openclaw doctor for initial setup. 4) Create a systemd service for auto-restart. 5) Connect from your desktop using ClawSquire (automatic) or SSH tunnel (manual). Total time: ~15 minutes.

Why Use a VPS?

  • Always-on — agent runs 24/7 regardless of your desktop being open
  • Accessible from anywhere — chat via Telegram, WhatsApp, or Discord from any device
  • Better for bots — messaging platforms need a stable, always-reachable webhook endpoint
  • Isolate from personal machine — agent actions don't touch your local files
Recommended

Manage Your VPS with ClawSquire

After installing OpenClaw on your VPS (steps below), use ClawSquire on your desktop to connect and manage it — no SSH commands needed after the initial setup.

One-Click Connect

Add your VPS once, then click Connect anytime. SSH tunnel is handled automatically.

ClawSquire VPS Manager showing TEST VPS instance with host IP, SSH port 22, ubuntu user, password authentication, and green Connect button — agent ready status with automatic SSH tunnel setup
Visual Dashboard

See OpenClaw status, safety settings, config backups — everything at a glance.

ClawSquire Dashboard showing OpenClaw v2026.3.7 on macOS with Safety Level Conservative, 3 Config Backups, Quick Actions (New Setup, Run Doctor, Backup Now, View Config), and OpenClaw CLI Advanced section
Health Check

Verify installation, config, and backup status after setup — one click.

ClawSquire Health Check showing 3 Total, 3 Pass, 0 Warning, 0 Fail — verifying OpenClaw installation, config file location, and backup count after VPS setup
Config Backup

Version your config before making changes. One-click restore if something breaks.

ClawSquire Config Backups showing 3 versioned backups with timestamps, file sizes, Create Backup button, and Compare/Restore actions for safe config management

Prerequisites

  • • VPS with Ubuntu 22.04+ (or Debian 12+, CentOS 9+, Amazon Linux 2023)
  • • SSH access (password or key-based)
  • • At least 1 vCPU + 1 GB RAM (2 GB recommended)
  • • An LLM API key (DeepSeek, OpenAI, Anthropic, etc.)

Setup Steps (~15 minutes)

1

SSH into your VPS

Your local terminal
ssh user@your-vps-ip

Replace user with your SSH username (often root or ubuntu) and your-vps-ip with the server's public IP.

Security tip: Set up SSH key authentication and disable password login for production servers.
2

Install Node.js 20+

OpenClaw requires Node.js 18 or newer. We recommend Node.js 20 LTS:

On the VPS
# Ubuntu / Debian
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

# Verify
node --version   # should print v20.x
npm --version
Alternative: using nvm (if you don't have sudo)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
source ~/.bashrc
nvm install 20
nvm use 20
3

Install OpenClaw

On the VPS
npm install -g openclaw

Verify the installation:

openclaw --version

If you see a permission error, use sudo npm install -g openclaw or configure npm to use a local directory: npm config set prefix ~/.npm-global.

4

Run initial setup

On the VPS
openclaw doctor

This creates your config file at ~/.openclaw/openclaw.json and checks all dependencies. Follow the prompts to add your LLM API key.

Or configure manually via CLI:

# Set your LLM provider (example: DeepSeek)
openclaw config set models.default "deepseek"
openclaw config set models.providers.deepseek.apiKey "sk-your-key"

# Verify config
openclaw config get
5

Start as a systemd service (auto-restart)

Create a service file so OpenClaw starts on boot and restarts on failure:

Create service file
sudo tee /etc/systemd/system/openclaw.service > /dev/null << 'EOF'
[Unit]
Description=OpenClaw Gateway
After=network.target

[Service]
Type=simple
User=YOUR_USER
ExecStart=/usr/local/bin/openclaw gateway
Restart=on-failure
RestartSec=5
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target
EOF
Important: Replace YOUR_USER with your actual username. Verify the path with which openclaw — if it's different from /usr/local/bin/openclaw, update the ExecStart line.
Enable and start
sudo systemctl daemon-reload
sudo systemctl enable openclaw
sudo systemctl start openclaw

# Check status
sudo systemctl status openclaw
Quick alternative: screen / tmux
screen -S openclaw
openclaw gateway
# Press Ctrl+A then D to detach
# Reattach later: screen -r openclaw

Screen/tmux is fine for testing but doesn't auto-restart on crash or reboot.

6

Connect from your desktop

Easiest: Use ClawSquire

Open ClawSquire → click + New Setup → enter your VPS IP, SSH user, and password/key → click Connect. Done.

Or via command line:

Your local terminal
# SSH tunnel (keep running)
ssh -NL 18789:localhost:18789 user@your-vps-ip

# Open in browser:
# http://localhost:18789
7

Set up messaging channels

Connect your agent to Telegram, WhatsApp, or Discord. Use the Dashboard (via ClawSquire or SSH tunnel) or the CLI:

VPS Provider Comparison

ProviderPrice (1GB)Best ForNotes
Tencent Cloud$3–5/moAsia-based usersLighthouse is cheapest; good China/HK/SG latency
Hetzner€4/moEurope-based usersBest price-to-performance ratio
AWS Lightsail$5/moAWS ecosystemSimple UI, global regions, included bandwidth
DigitalOcean$6/moDeveloper experienceClean dashboard, good docs, 1-click Ubuntu
Vultr$6/moGlobal coverage32 locations, hourly billing

OpenClaw needs 1 vCPU + 1GB RAM minimum. 2GB is recommended if running multiple channels. Prices are approximate as of March 2026.

Security Checklist

Frequently Asked Questions

SSH tunnel not working — can't reach Dashboard+
Verify: 1) The gateway is running on the VPS: openclaw gateway status. 2) Port 18789 is not blocked: sudo ufw allow 22 (SSH must be open, but do NOT expose 18789). 3) Your tunnel command uses localhost not 0.0.0.0: ssh -NL 18789:localhost:18789 user@server. 4) No other process occupies local port 18789: lsof -i :18789.
Gateway stops after SSH disconnect+
The gateway runs as a child of your shell session. Use systemd (recommended) or screen/tmux to keep it running. With systemd: sudo systemctl enable openclaw && sudo systemctl start openclaw. It auto-restarts on failure and starts on boot.
Telegram bot doesn't respond after VPS setup+
Check: 1) The gateway is running: openclaw gateway status. 2) Your bot token is set: openclaw config get channels. 3) The VPS has internet access: curl https://api.telegram.org. 4) Telegram webhook is configured: check gateway logs with journalctl -u openclaw -f. 5) The bot was started via BotFather and is active.
Which VPS provider should I choose?+
For most users: Tencent Cloud Lighthouse ($3-5/month, good for Asia), AWS Lightsail ($5/month, global), DigitalOcean ($6/month, developer-friendly), or Hetzner ($4/month, great value in EU). OpenClaw needs 1 vCPU + 1GB RAM minimum. Choose a region close to your Telegram/WhatsApp users for lower latency.
How much does it cost to run OpenClaw on a VPS?+
VPS: $3-10/month (1 vCPU, 1-2GB RAM is enough). LLM API costs depend on usage — DeepSeek is ~$0.14/M input tokens, OpenAI GPT-4o is ~$2.50/M. Most personal use costs under $15/month total (VPS + API).
"Control UI requires device identity" when accessing Dashboard+
This means you're accessing the Dashboard via a non-localhost IP. Use ClawSquire (auto SSH tunnel) or create a manual tunnel: ssh -NL 18789:localhost:18789 user@server. Then open http://localhost:18789 in your browser. See our detailed guide.
Can I run OpenClaw on a Raspberry Pi?+
Yes — OpenClaw runs on any device with Node.js 18+ and 1GB+ RAM. Raspberry Pi 4 or 5 works well. Install Node.js via nvm: nvm install 20, then npm install -g openclaw. Use the same systemd setup as VPS.

Next Steps

Download ClawSquire — Free

Guided VPS setup, health diagnostics, config backup — 7 languages.