OpenClaw on a VPS: What the Self-Hosted AI Agent Does and How to Run It Safely

OpenClaw is an open-source AI agent you host yourself. It links chat apps to a language model and can act on the server. Here is how it works and how to contain it on a VPS.

dns WindowsVPS Team calendar_today schedule5 min read
OpenClaw on a VPS: What the Self-Hosted AI Agent Does and How to Run It Safely
tocOn this page 7 sections
  1. What OpenClaw actually is
  2. The moving parts
  3. Why people run it on a VPS
  4. Windows or Linux?
  5. Contain it before you connect it
  6. Keeping it running
  7. Is it right for you?

What OpenClaw actually is

OpenClaw is an open-source AI assistant that you host yourself. It is not a chatbot in a browser tab. You run it as a long-lived process on a machine you control. It connects to the messaging apps you already use and to a large language model. You send it a message from your phone, and it can reply or take action on the server: run commands, read and write files, browse the web, or work through a scheduled to-do list.

The project has been renamed during its short life. Older guides and forum threads may use earlier names such as Clawdbot or Moltbot. It also shares a name with an unrelated open-source game-engine project. If your search results look odd, check which OpenClaw the page is about.

The moving parts

The project moves fast, so commands and option names change often. The architecture has stayed fairly stable, and it helps to understand it before you install anything:

  • The gateway: the always-on background process. It keeps sessions, routes messages and decides which tools the agent may call. Usually it also serves a local web control panel.
  • Channels: connectors to chat platforms. Each channel is a way in, so each one is also a way for someone to reach your server.
  • The model: either a hosted LLM API that you pay for per token, or a local model if you have the hardware.
  • Tools and skills: the actions the agent can take. Some are built in, such as shell and file access. Others are community add-ons you install separately.
  • Memory and config: plain files on disk that hold conversation history, preferences and credentials.

Taken together, OpenClaw is a remote-control interface to your server, and a language model makes the decisions. That is what makes it useful, and it is also why you need to set it up carefully.

Why people run it on a VPS

An agent that waits for messages needs to be online all the time. Leaving a laptop awake works badly, and running the agent on your personal machine gives it access to your browser profiles, documents and saved passwords. A VPS solves both problems. It stays up around the clock, it has a stable network connection, and if something goes wrong the damage stays on a box you can roll back from a snapshot. Many people also run trading helpers or scrapers next to the agent. Our Windows VPS for automation and bots page covers sizing for those always-on workloads.

Windows or Linux?

OpenClaw is built on Node.js, and Linux is the simplest home for it. On a Linux VPS you install the runtime, run the project's onboarding and register the gateway as a service. On Windows, the project's docs have generally recommended running it inside WSL2 rather than natively. Installation steps change between releases, so follow the current official instructions and not a copied command from an old post. Whichever OS you pick, take a snapshot of the VPS before you install, so you can roll back cleanly.

Contain it before you connect it

Treat the agent as a privileged user that takes orders from text it reads. These are the controls that matter most.

1. Give it its own account

Don't run the agent as Administrator or root. On Windows, create a dedicated standard user over RDP or PowerShell:

$pw = Read-Host -AsSecureString "Password for agent account"
New-LocalUser -Name "svc-agent" -Password $pw -Description "OpenClaw runtime account"
# Deliberately NOT added to Administrators

On Linux, use a normal user without passwordless sudo. If the agent needs elevated access for one specific job, write a narrow wrapper script for that job. Don't give it a general admin shell.

2. Keep the gateway off the public internet

The control panel and gateway API should listen only on localhost. After installing, check for anything listening on every interface:

Get-NetTCPConnection -State Listen |
  Where-Object { $_.LocalAddress -in '0.0.0.0','::' } |
  Sort-Object LocalPort |
  Select-Object LocalAddress, LocalPort, OwningProcess

On Linux, ss -tlnp shows the same information. Reach the panel through an SSH tunnel or a private VPN, not an open port. As a backstop, add a firewall rule that blocks the gateway's port from outside:

New-NetFirewallRule -DisplayName "Block agent gateway inbound" `
  -Direction Inbound -Protocol TCP -LocalPort <GATEWAY_PORT> -Action Block

3. Lock down who can talk to it

Use the pairing or allowlist features for every channel, so that only your own accounts can send commands. A bot that anyone can message is effectively a public shell.

4. Vet every skill

Community skills are code, and they run with the agent's permissions. Read what a skill does before you install it, prefer well-known sources, and pin versions. Any public add-on registry is a supply-chain risk.

5. Plan for prompt injection

If the agent reads email, web pages or documents, any of that text can contain instructions written for the model. Limit which tools are available in those workflows. Require confirmation before destructive actions. Our guide to hardening local LLMs against prompt injection covers patterns that apply here as well.

6. Protect keys and cap spending

Model API keys and channel tokens should be stored in environment variables or the platform's secret store, readable only by the agent account. Set a spending limit with your model provider, because an agent stuck in a loop can burn through tokens quickly.

Keeping it running

Run the gateway as a service, not in an RDP session you might log off. On Linux use a systemd unit. On Windows, a scheduled task that starts at boot under the agent account works well. See our notes on scheduled task priority so the agent doesn't take CPU from more important workloads. Back up the config and memory directory regularly, because that is where the agent's state lives. Before each upgrade, take a snapshot and read the release notes.

Is it right for you?

OpenClaw is a good fit if you want a personal assistant that can actually do work on a server and you're willing to secure it yourself. It is a poor fit for a production server that holds customer data or financial accounts. The safest setup is a separate, low-value VPS used only for the agent, where a mistake costs you a rollback and nothing more.

Run this on your own Windows VPS

Get a Windows VPS from WindowsVPS in about 60 seconds, with full Administrator access over RDP, NVMe storage and the Windows license included.

Buy a Windows VPS →

dns

Written by the WindowsVPS Team

We run Windows Server VPS hosting and write these guides from the same setups our customers use: RDP, PowerShell, trading terminals and always-on bots. Questions about a guide? Contact us.

About WindowsVPS Windows VPS guides All articles

Ready to deploy your server?

Windows or Linux VPS — up and running in under 60 seconds.