Services How It Works Pricing Blog Get Started
// VPS Setup Guide

How to Install OpenClaw on a VPS (Step-by-Step)

📅 April 13, 2026 ⏱ 10 min read 🛠 Beginner–Intermediate

OpenClaw is a self-hosted personal AI assistant. That means it runs on your own server — not on somebody else's cloud. A VPS (Virtual Private Server) is the most popular way to host it: cheap, always-on, and accessible from anywhere.

This guide walks you through the complete setup: picking a server, installing Node.js, configuring OpenClaw, connecting an AI model, and wiring up Telegram so you can chat with your assistant from your phone.

Total time: 30–60 minutes. Skill level: if you can SSH into a server, you can do this.

What You Need

Before you start, make sure you have:

Step 1: Choose Your VPS

Any basic VPS will do. Here's what actually matters:

ResourceMinimumRecommended
CPU1 vCPU2 vCPU
RAM1 GB2 GB
Storage10 GB SSD20 GB SSD
OSUbuntu 22.04 / 24.04 LTS
LocationClosest to you (lower latency)

Popular providers that work well: DigitalOcean ($6/mo Droplet), Hetzner (€4/mo — excellent value), Vultr, Linode. For the UK, Hetzner's Falkenstein or Helsinki regions are solid choices.

💡 Tip: Hetzner's CX22 (2 vCPU, 4 GB RAM, €4.35/mo) is excellent value and more than enough for OpenClaw with n8n alongside it.

Step 2: Initial Server Setup

SSH into your fresh server as root (or a sudo user):

ssh root@YOUR_SERVER_IP

Update the system and install basics:

apt update && apt upgrade -y
apt install -y curl git build-essential ufw

Set up a basic firewall:

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

⚠️ Important: Enable the firewall before installing anything that opens ports. If you accidentally lock yourself out, most VPS providers have a web console you can use to recover.

Step 3: Install Node.js

OpenClaw requires Node.js 20 or higher. Use the NodeSource installer for the cleanest result:

curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt install -y nodejs
node --version   # should print v22.x.x
npm --version

That's it — no manual PATH fiddling needed with this method.

Step 4: Install OpenClaw

Install OpenClaw globally via npm:

npm install -g openclaw

Verify the install:

openclaw --version

Now run the setup wizard:

openclaw setup

This creates the workspace at ~/.openclaw/workspace, generates default config files, and walks you through the initial configuration interactively.

What setup does

Creating your workspace

The setup command creates ~/.openclaw/ with your workspace, secrets folder, and default config. Your conversation history, memory files, and skills all live here.

Step 5: Configure Your AI Model

OpenClaw needs an AI API key to work. It supports Claude (Anthropic), GPT (OpenAI), and local models via Ollama.

Edit the config:

nano ~/.openclaw/config.json

For Claude (recommended — best reasoning + tool use):

{
  "model": "anthropic/claude-sonnet-4-5",
  "anthropicApiKey": "sk-ant-YOUR_KEY_HERE"
}

For OpenAI:

{
  "model": "openai/gpt-4o",
  "openaiApiKey": "sk-YOUR_KEY_HERE"
}

Get your Anthropic key at console.anthropic.com. OpenAI keys are at platform.openai.com.

💡 Cost reality check: With normal usage (a few dozen messages per day), you'll typically spend $5–15/month on API costs. Claude Haiku is the cheapest option; Sonnet gives the best balance of quality and cost.

Step 6: Start the Gateway

The OpenClaw Gateway is the daemon that routes messages between your assistant and channels like Telegram:

openclaw gateway start

Check it's running:

openclaw gateway status

To keep the gateway running after a reboot, set up a systemd service:

openclaw gateway enable

This registers it as a system service that auto-starts on boot.

Step 7: Connect Telegram

This is where it gets genuinely useful. Connecting Telegram means you can message your AI assistant from your phone anywhere in the world.

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow the prompts to create a bot
  3. Copy the bot token (looks like 123456789:AAFxxx...)

Add the token to your OpenClaw config:

openclaw config set telegram.botToken YOUR_BOT_TOKEN

Then connect your Telegram account (so the bot knows who you are):

openclaw channel add telegram

Follow the on-screen prompts. Once connected, send a message to your bot in Telegram — you should get a response from your AI assistant.

Pro tip

Set up heartbeats

Once Telegram is connected, OpenClaw can send you proactive messages — calendar reminders, email alerts, scheduled content publishing. Configure these in your HEARTBEAT.md workspace file.

Step 8: Customise Your Workspace

Your workspace at ~/.openclaw/workspace/ is where the magic happens. Key files to know:

Edit these files to shape how your assistant behaves. The more context you give it, the more useful it becomes over time.

Step 9: Install Skills

Skills extend what OpenClaw can do. Install them from ClawHub:

openclaw skills list
openclaw skills install github
openclaw skills install weather

Popular first skills to install:

Step 10: Verify Everything Works

Run a quick sanity check:

openclaw status

You should see: Gateway running, model connected, channels active. Then open Telegram and send your bot a message like "what can you do?" — it should respond with a summary of its capabilities.

🎉 You're done. Your personal AI assistant is now running 24/7 on your own server, accessible via Telegram, with no monthly subscription — just API costs.

Common Issues

Gateway won't start

Check Node.js version (node --version should be 20+). Check logs with openclaw gateway logs. Make sure your config.json is valid JSON.

Telegram bot doesn't respond

Verify the bot token is correct. Make sure the gateway is running. Check that you've sent the bot a message in Telegram (not just added it to a group).

AI responses are slow

This is usually network latency to the AI API, not your server. Pick a VPS location geographically close to Anthropic/OpenAI's servers (US East or EU West).

Out of memory errors

Upgrade to a 2 GB RAM server. OpenClaw itself is lightweight, but if you're running other services (n8n, databases) alongside it, 1 GB runs tight.

What to Do Next

Once you're up and running:

The initial setup is the hard part. After that, OpenClaw gets better over time as its memory fills with context about you and your projects.

If you'd rather skip the setup entirely and get a pre-configured OpenClaw instance, reach out — we set these up as a service.

Want it done for you?

We set up OpenClaw on your VPS, configure your channels, and hand you the keys — ready to use in 24 hours.

Get It Set Up →