How to Run OpenClaw on a VPS in 2026: Complete Setup Guide (Contabo + DigitalOcean)

Affiliate disclosure: We earn commissions when you shop through the links on this page, at no additional cost to you.

Running an AI assistant that is always on, always responsive, and completely under your control is no longer a luxury reserved for large engineering teams. With a modest VPS and OpenClaw, you can have a personal AI agent answering your Telegram messages, managing your schedule, monitoring your websites, and running automated workflows 24 hours a day, seven days a week — for less than the price of a streaming subscription. This guide walks you through every step, from choosing the right server to keeping OpenClaw humming in production.

Choosing Your VPS — What Specs Does OpenClaw Need?

OpenClaw itself is lightweight: it is a Node.js process that routes messages, calls AI APIs, and runs cron jobs. It does not run a local language model by default — inference is handled by providers like OpenRouter — so you do not need a GPU or enormous RAM just to get started.

Minimum requirements:

Advertisement

  • 2 vCPU
  • 4 GB RAM
  • 20 GB SSD
  • Ubuntu 22.04 LTS

Recommended for comfortable headroom (if you plan to run additional services like a small vector database or a reverse proxy alongside OpenClaw):

  • 4 vCPU
  • 8 GB RAM
  • 40 GB SSD

Budget pick — Contabo: For most users, Contabo is the standout choice. Their VPS S plan starts at around €5.99/month and includes 4 vCPU, 8 GB RAM, and 100 GB NVMe SSD — specs that would cost two to three times as much on US-centric providers. Contabo operates data centres in Germany, the US, Singapore, and Japan, giving you reasonable latency options worldwide.

Developer-friendly alternative — DigitalOcean: If polished documentation, a clean UI, and a massive ecosystem of one-click apps matter to you, DigitalOcean is hard to beat. Their Basic Droplets start at $6/month for 1 GB RAM but their 2 GB/1 vCPU Droplet at $12/month is the comfortable starting point for OpenClaw. DigitalOcean also offers managed databases, object storage, and App Platform if you want to grow beyond a single VPS.

Step 1 — Initial Server Setup (Ubuntu 22.04)

Once your VPS is provisioned and you have the root credentials, SSH in and run a full system update before doing anything else.

ssh root@YOUR_SERVER_IP
apt update && apt upgrade -y

Create a non-root sudo user for day-to-day work:

adduser deploy
usermod -aG sudo deploy

Set up the UFW firewall. Allow SSH, HTTP, and HTTPS — deny everything else by default:

ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable

Install fail2ban to automatically ban IPs that repeatedly fail SSH authentication:

apt install fail2ban -y
systemctl enable fail2ban
systemctl start fail2ban

Finally, disable password-based SSH authentication. Edit /etc/ssh/sshd_config and set:

PasswordAuthentication no
PermitRootLogin prohibit-password

Reload SSH: systemctl reload sshd. From this point on, only key-based login works.

Step 2 — Install Node.js v22+

OpenClaw requires Node.js 22 or later. The fastest way to get it on Ubuntu is via the NodeSource repository:

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

Verify the installation:

node -v   # should output v22.x.x
npm -v

Step 3 — Install OpenClaw

Install the OpenClaw CLI globally via npm:

npm install -g openclaw

Run the interactive setup wizard. It will ask for your OpenRouter API key, your preferred default model, and your workspace directory:

openclaw setup

Once setup completes, start the gateway:

openclaw gateway start

You should see the gateway confirm it is listening. Check the full documentation at docs.openclaw.ai for configuration options, including how to set a custom port or enable HTTPS termination.

Step 4 — Connect Telegram and Configure Your Agent

The most common way to interact with OpenClaw on a remote VPS is through Telegram. Here is the quickest path:

  1. Open Telegram and start a chat with @BotFather.
  2. Send /newbot and follow the prompts to get your bot token (a string that looks like 123456789:ABCdef...).
  3. In your OpenClaw workspace, run openclaw gateway status to open the admin interface, then navigate to Channels → Telegram and paste your token.
  4. Start a conversation with your new bot in Telegram. OpenClaw will respond immediately if the gateway is running.

You can also connect Signal, WhatsApp, Discord, and other channels — all are configured from the same gateway admin panel.

Step 5 — Keep It Running with PM2

The gateway will stop if you close your SSH session or the process crashes. PM2 is the standard Node.js process manager for keeping services alive through reboots and errors.

npm install -g pm2

Start the OpenClaw gateway under PM2:

pm2 start "openclaw gateway" --name openclaw-gateway

Configure PM2 to start on boot:

pm2 startup
# Run the command it outputs, then:
pm2 save

From this point, OpenClaw will restart automatically after a server reboot or a crash. You can monitor it with pm2 logs openclaw-gateway and pm2 status.

Conclusion

Self-hosting OpenClaw on a VPS gives you an AI assistant that runs around the clock without depending on third-party subscription tiers or usage caps beyond your chosen LLM provider. The entire stack — VPS, Node.js, OpenClaw, and PM2 — can be set up in under an hour, and the ongoing cost starts at well under $10 per month. Whether you choose Contabo for maximum value or DigitalOcean for developer experience, the result is the same: a personal AI agent that is yours, on your infrastructure, under your rules.

Frequently Asked Questions

How much does it cost to self-host OpenClaw per month?
The VPS itself starts at roughly €5–12/month depending on provider and plan. OpenClaw is open source and free to run. Your main recurring cost is the LLM API (OpenRouter or a direct provider), which for typical personal use runs $2–10/month. Total: under $25/month for a fully functional always-on AI agent.
Do I need technical experience to set this up?
Basic comfort with the Linux terminal is enough. If you can SSH into a server and run commands, you can follow this guide. The OpenClaw setup wizard handles most of the configuration interactively.
Is Telegram the only way to chat with OpenClaw?
No. OpenClaw supports Telegram, Signal, WhatsApp, Discord, Slack, and a web chat interface. You can have multiple channels active simultaneously on the same instance.
How do I update OpenClaw when a new version is released?
Run npm install -g openclaw to update to the latest version, then restart the gateway with pm2 restart openclaw-gateway. OpenClaw also has a built-in openclaw update command that handles this in one step.

This article was produced with the assistance of AI tools and reviewed by the AIStackDigest editorial team.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top