Pricing Blog → Get Started

How to Install OpenClaw on a VPS: Complete Setup Guide (2026)

Running OpenClaw on a VPS means your AI assistant is always available — whether your laptop is closed, on a plane, or just turned off. Unlike a local Mac install, a VPS setup gives you 24/7 uptime, a static IP, and the ability to receive webhooks and messages at any hour.

This guide walks you through a full OpenClaw VPS installation from scratch, using a clean Ubuntu 22.04 server. The same steps work on Hetzner, DigitalOcean, Vultr, Linode, or any comparable provider.

Don't want to do this yourself? We offer a done-for-you OpenClaw VPS setup service — live in 24 hours, no terminal required.

Why run OpenClaw on a VPS?

A local install on your Mac is great for getting started, but a VPS unlocks the full potential of OpenClaw:

A $6/month Hetzner CAX11 (2 vCPU, 4GB RAM) is more than enough to run OpenClaw, its gateway, and a few connected automations.

What you need before starting

Step 1 — Provision your server

Create a new VPS with at least 2GB RAM and 20GB disk. Ubuntu 22.04 LTS is the recommended OS. Once it's up, SSH in:

ssh root@YOUR_SERVER_IP

Update the system first:

apt update && apt upgrade -y

Step 2 — Install Node.js

OpenClaw requires Node.js 22 LTS or higher. Install it using the NodeSource setup script:

curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt install -y nodejs

Verify it installed correctly:

node --version   # should print v22.x.x
npm --version

Step 3 — Install OpenClaw

Install OpenClaw globally via npm:

npm install -g openclaw

This installs the openclaw CLI. Verify it works:

openclaw --version

Step 4 — Run initial setup

OpenClaw has an interactive onboarding wizard. Run it once to set your AI provider, API key, and workspace:

openclaw setup

The wizard will ask you to:

  1. Choose your AI model provider (Claude, GPT-4o, Gemini, Ollama)
  2. Paste your API key
  3. Set a workspace directory (default: ~/.openclaw/workspace)
  4. Optionally configure a persona name and initial memory

Your config is stored at ~/.openclaw/config.json. You can edit it directly later.

Step 5 — Configure the gateway

The OpenClaw gateway is what allows messaging channels (Telegram, WhatsApp, etc.) to reach your assistant. Start it:

openclaw gateway start

Check that it's running:

openclaw gateway status

By default, the gateway listens on port 3210. If you have a firewall, open that port:

ufw allow 3210/tcp
Pro tip: If you have a domain name, point it at your VPS IP and configure the gateway's publicUrl in your config. This makes Telegram webhooks and other integrations much more reliable.

Step 6 — Keep it always-on with systemd

To make OpenClaw survive reboots and run as a background service, create a systemd unit file:

cat > /etc/systemd/system/openclaw.service << 'EOF'
[Unit]
Description=OpenClaw AI Assistant
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/openclaw gateway start --foreground
Restart=on-failure
RestartSec=10
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
EOF

Enable and start the service:

systemctl daemon-reload
systemctl enable openclaw
systemctl start openclaw
systemctl status openclaw

Your OpenClaw gateway will now start automatically on boot and restart if it crashes.

Step 7 — Connect Telegram

This is the most satisfying part — chatting with your assistant from your phone. You'll need a Telegram bot token from BotFather.

Add the token to your OpenClaw config:

openclaw config set channels.telegram.token YOUR_BOT_TOKEN

Then restart the gateway:

systemctl restart openclaw

Open Telegram, find your bot, and send it a message. You should get a response from your AI assistant within a few seconds. For a full walkthrough, see our Telegram setup guide.

Troubleshooting common issues

Gateway won't start

Check the logs: journalctl -u openclaw -n 50. The most common causes are a missing API key, port conflict (something already using 3210), or a Node.js version below 22.

Telegram bot not responding

Make sure your gateway is reachable from the internet on port 3210. Test with: curl http://YOUR_SERVER_IP:3210/health. If it times out, check your VPS firewall rules.

High memory usage

OpenClaw itself is lightweight (~100MB), but repeated large AI conversations can grow memory over time. If you're on a 1GB RAM server, consider adding a 1GB swap file.

npm install fails

If you get permission errors, make sure you're running as root, or use sudo npm install -g openclaw. On non-root setups, configure npm's global prefix to a user-writable directory.

What to do next

Once your VPS setup is working, here's what most people do next:

If you'd rather skip the terminal entirely and have us handle this for you, our Power User setup includes VPS deployment, all channel connections, and 60 days of support — starting at $899.

Want us to do this for you?

We'll install, configure, and hand off a fully working OpenClaw on your VPS — live in 24 hours.

Get Your VPS Setup →