Skip to content

Offer: your first month of web hosting is free on monthly plans. Order by 30 Nov. See plans

HostEthical
All guides

VPS 12 min read ·

OpenClaw on a VPS: Setup, Security and Cost in India

Set up OpenClaw on a VPS with Ubuntu 24.04 from the official docs, keep the gateway private and add Telegram. See the real monthly cost in rupees.

To run OpenClaw on a VPS, you install it on a Linux server (Ubuntu 24.04 LTS is the best-tested choice), run its onboarding as a non-root user and let it install itself as a service, so your assistant keeps answering on Telegram or WhatsApp around the clock. OpenClaw's docs put the minimum at 1 vCPU and 1 GB RAM, recommend 2 GB or more, and say to keep the Gateway private: reach its dashboard through an SSH tunnel or Tailscale, never an open port. Your monthly bill is the server plus the AI model's API usage.

The short version:

  1. Order a VPS with Ubuntu 24.04 and turn on a firewall that allows only SSH.
  2. Install Node.js 24 and OpenClaw, create an openclaw user and run openclaw onboard --install-daemon as that user.
  3. Connect a Telegram bot, approve your own account, and leave everyone else blocked.
  4. Run openclaw security audit, then keep OpenClaw updated and backed up.

What OpenClaw is and its requirements

OpenClaw is an open-source, self-hosted AI assistant. One background process, the Gateway, runs on your machine, connects to chat apps such as Telegram, WhatsApp, Slack, Discord and Signal, and passes your messages to an AI model that can use tools: run commands, read files, browse the web and schedule jobs. You may know it by its earlier names, Clawdbot and Moltbot; the US National Vulnerability Database lists all three.

Facts from the official GitHub repository and install docs, as of October 2026:

  • Licence: MIT. The project is run by the OpenClaw Foundation, an independent non-profit with no paid tier or hosted service, according to its FAQ.
  • Current version: 2026.10.5, released on 18 October 2026. New versions come out every few days.
  • Node.js: Node 24 or Node 26, with Node 26 recommended. The Node.js page lists 24.22.1 or 26.12.1 as the current minimums; the install script sets up Node 24 LTS on Linux if Node is missing.
  • Server size: at least 1 vCPU, 1 GB RAM and about 500 MB of disk; 2 GB of RAM or more is recommended for several channels or browser automation (hosting FAQ).
  • AI model: an API key from a provider such as Anthropic, OpenAI or Google, or an existing ChatGPT/Codex or Claude Code sign-in, which onboarding can reuse. The docs advise against small local models for an agent with tools, because they are easier to hijack.

VPS for OpenClaw vs a laptop, Mac mini or shared hosting

The Gateway has to stay running to answer messages and run scheduled jobs. OpenClaw's FAQ puts it simply: for 24/7 reliability, use a VPS; for the lowest friction, run it locally and accept that it stops when the machine sleeps or restarts.

WhereGood forDrawbacks
Your laptopTrying it out; local files and a visible browserStops when the lid closes, Wi-Fi drops or Windows updates
Mac mini or home PCAlways on; needed for iMessage, which requires a MacPower cuts, home internet outages, and the agent sits on your home network
VPSAlways on, stable network, isolated from your personal devicesNo screen (headless browser only), SSH needed for updates, a monthly bill
Shared hostingNot suitableNo root access, no long-running background service, often an old Node.js

A VPS also keeps the agent away from your personal accounts. The Linux server guide says a shared business agent should run on a dedicated machine that is never signed into personal Google or Apple accounts. If you are new to servers, read what a VPS is and managed vs unmanaged VPS first: on an unmanaged server, security and updates are your job.

Room for OpenClaw and more. 4 vCPUs, 8 GB RAM and 100 GB SSD with full root access, in Germany or Mumbai. It is unmanaged with no one-click OpenClaw image, so you install it with the steps below. See Cloud VPS →

OpenClaw VPS setup: install OpenClaw on Ubuntu 24.04

These commands come from OpenClaw's own DigitalOcean and Hetzner guides, which work on any Ubuntu 24.04 VPS. The docs warn against third-party one-click images whose startup scripts and firewall defaults you haven't reviewed, so start from a clean Ubuntu image. Our VPS setup guide covers SSH keys if you haven't used them before.

Step 1: Log in, update and switch on the firewall

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

apt-get install -y ufw
ufw allow OpenSSH
ufw enable
ufw status verbose

Allow SSH before enabling UFW, or you lock yourself out. Do not open port 18789, the Gateway's port: you will reach it through SSH instead.

Step 2: Install Node.js 24 and OpenClaw

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

curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard

--no-onboard installs the program without starting setup, because setup should run as an ordinary user, not root.

Step 3: Create the non-root user

adduser openclaw
usermod -aG sudo openclaw
loginctl enable-linger openclaw

su - openclaw
openclaw --version

enable-linger lets this user's services start at boot without anyone logged in, which is what keeps OpenClaw running after a reboot. OpenClaw's data then lives in /home/openclaw/.openclaw/.

Step 4: Run onboarding and install the service

openclaw onboard --install-daemon

The wizard asks for your AI provider, offers to connect a chat channel, generates a Gateway token and installs a systemd user service. Save the token somewhere safe. Then check it:

openclaw status
systemctl --user status openclaw-gateway.service
journalctl --user -u openclaw-gateway.service -f

Reboot the server once and check again; it should come back on its own.

Step 5: Open the dashboard through an SSH tunnel

The Gateway listens only on the server's localhost. From your own computer's terminal (PowerShell works on Windows), run:

ssh -N -L 18789:127.0.0.1:18789 openclaw@YOUR_SERVER_IP

Replace openclaw with whichever user you normally log in as. Then open http://localhost:18789 in your browser. If the dashboard asks for authentication, paste the Gateway token into its settings.

Connect OpenClaw to Telegram or WhatsApp

OpenClaw's channels page says to start with Telegram: it needs only a bot token and no plugin. Following the Telegram setup page:

  1. In Telegram, chat with @BotFather (check the handle is exactly that), send /newbot, follow the prompts and copy the token.
  2. On the server, as the openclaw user:
    openclaw channels add --channel telegram --token <bot-token>
    openclaw channels status --probe
  3. Message your bot. You get a pairing code instead of a reply. Approve it on the server; codes expire after an hour:
    openclaw pairing list telegram
    openclaw pairing approve telegram <CODE>

Telegram uses long polling by default: OpenClaw fetches new messages itself, so you don't need to open any port. Strangers who find your bot get a pairing code and never reach the AI.

WhatsApp works through a linked WhatsApp Web session, set up with openclaw channels login --channel whatsapp and a QR code. The WhatsApp page recommends a separate number for the assistant, and warns that on a headless server you need a quick way to get the live QR code to your phone before it expires. If you link your personal number, every message you receive becomes input for the agent.

OpenClaw security on a VPS: keep the gateway private

An OpenClaw agent can run commands and send messages for you, so a mistake here costs more than on an ordinary website. OpenClaw's defaults are sensible: on a normal install the Gateway listens only on localhost, needs a token, and unknown senders must be paired. Your job is not to undo them.

What has gone wrong before

  • Exposed dashboards. CVE-2026-25253 (rated 8.8, high) affected versions before 2026.1.29: a crafted link could make the dashboard connect to another server and send it your Gateway token. In February 2026, Hunt.io counted more than 17,500 internet-facing instances, under the OpenClaw, Clawdbot and Moltbot names, that it judged vulnerable.
  • Malicious skills. In February 2026, Koi Security found 341 malicious skills among 2,857 on ClawHub, OpenClaw's skill marketplace, most of them installing Atomic Stealer, malware that steals passwords from Macs (The Hacker News).
  • A steady stream of fixes. The project's GitHub security advisories list 722 published advisories between January and September 2026, 14 of them critical. That reflects active patching, and it means an outdated install is a risk.

The checklist

  • Keep the Gateway on loopback. Reach it by SSH tunnel or Tailscale Serve. The network exposure page says never to expose it unauthenticated on 0.0.0.0. To use Tailscale instead of a tunnel:
    curl -fsSL https://tailscale.com/install.sh | sudo sh
    sudo tailscale up
    openclaw config set gateway.tailscale.mode serve
    openclaw gateway restart
  • Check open ports from outside. From your own computer, nmap -p- YOUR_SERVER_IP should show only port 22.
  • Run the audit after every config change: openclaw security audit, or --deep for a live check and --fix for safe repairs such as file permissions (audit docs).
  • Limit tools. If the agent reads web pages, emails or documents, that content can carry hidden instructions (prompt injection). The tool permissions page suggests denying the control tools for such agents in ~/.openclaw/openclaw.json:
    {
      tools: {
        deny: ["gateway", "cron", "sessions_spawn", "sessions_send"],
      },
    }
    The hardened baseline goes further, switching off shell commands and keeping file access inside the workspace.
  • Guard your keys. Everything under ~/.openclaw/ can contain API keys, bot tokens and chat history. Keep it readable by the openclaw user only (openclaw doctor offers to tighten permissions), and set a spending limit in your AI provider's console if it has one.
  • Install skills and plugins sparingly. The docs say to treat them as code you choose to trust: read them first and prefer known authors.

Keep OpenClaw updated and backed up

Automatic Gateway updates are off by default, according to the automatic updates page. Take a verified backup, then update, as the openclaw user:

openclaw backup create --output ~/Backups/openclaw --verify
openclaw update

openclaw update checks the new version while the old one keeps serving, then switches over. Run it at least weekly given the pace of security fixes, and keep Ubuntu itself patched with sudo apt update && sudo apt upgrade -y.

The backup guide has two warnings. Never copy the live .sqlite database files, because copies made while the Gateway runs can be corrupt; use the backup command. And backups contain your credentials, so store them encrypted and copy them off the server, since a backup on the same VPS won't help if the VPS is lost.

OpenClaw hosting cost in India: VPS plus API usage

You pay for two things: the server, at a fixed monthly price, and the AI model, billed per token. OpenClaw itself is free.

API usage varies widely, so here is a worked example with a stated assumption, not a measurement: 30 messages a day (900 a month), each sending about 20,000 input tokens (OpenClaw's system prompt, workspace files and recent chat history) and getting 1,000 tokens back, with no prompt caching. Prices are from Anthropic, OpenAI and Google as of 22 October 2026, in US dollars before any tax on your invoice, pay-as-you-go. Rupees use the ECB reference rates for 21 October 2026 ($1 = about ₹94.47), rounded to the nearest ₹10.

ModelPer million tokens (input / output)Example month
Claude Haiku 5.5 (Anthropic)$0.10 / $0.50About $2.25 (₹210)
gpt-6-luna (OpenAI)$0.10 / $0.50About $2.25 (₹210)
Gemini 3.8 Flash (Google, paid tier)$0.75 / $3.75 until 31 December 2026, then $1.50 / $7.50About $16.90 (₹1,590)
Claude Sonnet 5.5 (Anthropic)$2 / $10About $45 (₹4,250)
gpt-6.1-sol (OpenAI)$2 / $10About $45 (₹4,250)
HostEthical Cloud VPS (4 vCPU, 8 GB RAM)₹860 a month, or about ₹774.17 a month when billed yearly, in Germany; Mumbai adds a monthly location fee

Real bills can be lower, because prompt caching charges far less for repeated context (Anthropic bills cache hits on Sonnet 5.5 at a twentieth of the input price), or higher, because one request can trigger several model calls when the agent uses tools. Check your real spend with /usage cost in chat or the Usage tab in the dashboard.

Three ways to spend less:

  • Reuse a subscription. Onboarding can sign in with a ChatGPT/Codex plan or reuse a Claude Code login, which counts against that plan's limits instead of per-token billing.
  • Gemini's free tier has no token charge, but Google's pricing page says free-tier content is used to improve its products.
  • A cheaper model for chat, with tight tool limits, since the docs warn that smaller models are more easily misled.

OpenClaw needs far less than our smallest plan's 8 GB of RAM. The headroom is for browser automation, Docker sandboxes, or self-hosted n8n on the same server. If you only want a chat assistant, a 2 GB server elsewhere will do.

Mumbai or Germany: where to host OpenClaw

For a personal assistant, location matters less than for a website. Most of the wait for a reply is usually the AI model working, not the trip between India and your server, so Germany, with no location fee, is fine for most people.

Choose Mumbai if you want your chat history and files stored in India for client or compliance reasons, if the agent will work with Indian websites and APIs, or if you will spend a lot of time in SSH, where a nearby server feels quicker. Our guide to VPS hosting in Mumbai explains latency and shows how to measure it, and the best Linux OS for a VPS explains why Ubuntu LTS is the safe default here.

n8n vs OpenClaw: which one do you need?

Both are free to self-host and both talk to AI models, but they solve different problems.

  • n8n runs workflows you design on a visual canvas: when a form is submitted, add a row to a sheet and send a WhatsApp message. Each run follows the path you designed. Its AI features let you add an LLM as one step, but the workflow around it stays fixed and predictable.
  • OpenClaw is an assistant you talk to. You ask in plain language, and the agent decides which tools to use. That is more flexible and less predictable, and it costs tokens on every message.

For business processes that must run the same way every time, such as order alerts, lead capture and invoice reminders, n8n is the better tool. For research, drafting, reminders and one-off jobs from your phone, OpenClaw fits better. You can run both on one VPS. Our n8n pricing guide covers installing n8n with Docker.

If you would rather not manage a server at all, OpenClaw's docs list managed options, including Hostinger's one-click OpenClaw and templates on Railway and Northflank. That is the better choice if you don't want to handle updates and security yourself.

Run your own AI assistant 24/7. A Cloud VPS with root access, a dedicated IPv4 address and rupee billing by UPI, card or netbanking. You install and secure OpenClaw yourself; if you’d rather not, a managed host is the better fit. See Cloud VPS →

Frequently asked questions

How do I set up a VPS server for OpenClaw?

Order a VPS with Ubuntu 24.04, log in over SSH and update it, then switch on the UFW firewall allowing only SSH. Install Node.js 24 and OpenClaw with the official install script, create a non-root openclaw user and run openclaw onboard --install-daemon as that user. Onboarding connects your AI provider and installs a service that restarts after reboots. Open the dashboard through an SSH tunnel rather than an open port.

Can OpenClaw be used on Windows?

Yes. OpenClaw's recommended Windows option is its Windows Hub app for Windows 10 20H2 or later and Windows 11, and a PowerShell installer and WSL2 are also supported. A Windows PC only answers messages while it is switched on and awake, though. For an assistant that replies 24/7, run the Gateway on an always-on machine such as a Linux VPS and manage it from Windows over SSH.

Can I set up my own VPS server for OpenClaw?

Yes. An unmanaged VPS gives you root access, so you can install OpenClaw yourself by following the official docs, usually in about 20 minutes. In return you are responsible for the firewall, operating system updates, OpenClaw updates and backups. If you would rather not handle that, OpenClaw's docs list managed one-click hosts, which cost more but look after the server for you.

Can I get a free VPS server for OpenClaw?

Yes, with limits. Oracle Cloud's Always Free tier includes Arm compute equal to 2 OCPUs and 12 GB of memory plus 200 GB of block storage, and OpenClaw has an Oracle Cloud guide. Free capacity is often unavailable, and Oracle may reclaim instances it considers idle. You still pay for AI model usage unless you use a free tier such as Gemini's, whose content Google uses to improve its products.