Persistent VMs are now available.Learn more

OpenClaw Hosting: Where to Run OpenClaw 24/7

Engineering
Eli Mernit12 min read
OpenClaw Hosting: Where to Run OpenClaw 24/7

OpenClaw hosting comes down to one requirement: a Linux machine that stays on, keeps its disk and lets you run a background service as root. A fixed-price VPS is a low-cost way to get that for an assistant that never sleeps. A pay-per-second VM costs more when it runs all month and less when it doesn't, and it adds pause, snapshots and a private tunnel to the dashboard.

This guide compares the options, shows the setup on a cloud VM and in Docker, and prices each one with the inputs behind the number.

sh
# On your laptop: a 2 vCPU / 4 GiB VM on the Shared CPU tier
beam vm new openclaw --cpu-tier shared --cpu 2 --memory 4096 --no-desktop
beam vm ssh openclaw

# Inside the VM: turn on systemd user services, which the Gateway service needs
apt-get update && apt-get install -y libpam-systemd dbus-user-session
loginctl enable-linger root
systemctl start user@0.service
export XDG_RUNTIME_DIR=/run/user/0

# Install OpenClaw, then onboard and install the service
curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
openclaw onboard --install-daemon
openclaw gateway status
exit

# Back on your laptop: reach the dashboard without publishing the port
beam vm port-forward openclaw 18789:18789

With the last command running, the Control UI is at http://127.0.0.1:18789/ on your own machine.

What OpenClaw needs from a host

OpenClaw is a personal AI assistant built around a Gateway, a background process that connects your model to chat channels such as WhatsApp, Telegram and Discord and serves a web dashboard called the Control UI. Hosting it means keeping that one process running, with its state intact, on a machine you control. Five things decide whether a host fits:

  • A process that stays up. The Gateway holds channel connections open, so it has to run as a service. On Linux, openclaw onboard --install-daemon installs a systemd user service, and the managed unit restarts the Gateway if it exits. Shared web hosting can't do this.
  • A supported Node version. OpenClaw's install docs ask for Node 24.16.0 or later on the 24.x line, or 26.1.0 or later. The installer script adds Node when it's missing.
  • A disk that persists. Config, channel credentials, skills and the agent's workspace live under ~/.openclaw. Lose that directory and you onboard again and re-link every channel.
  • Enough memory. The docs give no minimum for the Gateway itself. They do ask for at least 6 GB of RAM to build the Docker image from source, and they point smaller servers to the pre-built image. The examples here use 2 vCPUs and 4 GiB.
  • A private dashboard port. The Gateway listens on port 18789 and binds to loopback by default. You reach it through a tunnel, not a public URL.

A GPU isn't on the list. OpenClaw sends prompts to a model provider with an API key, or reuses an existing Claude Code or Codex login, so the server only needs CPU and memory.

OpenClaw hosting options compared

The table covers the four places people run OpenClaw, what each keeps between restarts, and what you pay when the machine is off.

OptionWhat you manageState between restartsBilling when it's off
Fixed-price VPS (Hetzner, DigitalOcean, Hostinger)OS updates, firewall, SSH hardening, backupsThe server's diskThe plan price continues while the server exists
Fly MachineA Docker image, a volume and a Fly configVolumes only; the root filesystem resetsStopped Machines pay for root filesystem storage
Beam VMThe software inside the VMRoot disk after a stop; disk, RAM and processes after a pauseNo compute charge while stopped or paused; storage isn't billed yet
A machine at home (mini PC, Raspberry Pi)Hardware, power, home networkLocal diskNothing to bill, but it's offline when the machine is

OpenClaw's own server guide lists DigitalOcean, Hetzner, Hostinger, Fly.io, Railway, Northflank and a Raspberry Pi among the places it runs, so none of these is unusual. The differences are price, how much of the machine you look after, and what happens to the bill and the state when you turn it off.

How to host OpenClaw on a cloud VM

Hosting OpenClaw on a VM takes five steps: create the machine, turn on systemd user services, install OpenClaw, run onboarding with the service flag, and open a tunnel to the dashboard. The commands below use a Beam VM, which is a CPU microVM with its own kernel, systemd, SSH and a root disk that persists. The install and onboarding steps are the same on any Ubuntu or Debian server.

1. Create the VM. The default Beam VM has 4 vCPUs, 8 GiB of RAM and a 50 GiB disk on Ubuntu 24.04. This one is smaller and opts into the Shared CPU tier:

sh
beam vm new openclaw --cpu-tier shared --cpu 2 --memory 4096 --no-desktop

A VM has no idle timeout unless you set one, so it keeps running after you close the terminal. That is what a 24/7 assistant needs, and it also means the VM bills until you stop, pause or remove it. If you do set an idle timeout, the timer counts connections such as SSH sessions and tunnels, not processes inside the VM, so the VM would go to sleep with the Gateway still running. For an assistant that should answer at any hour, leave the timeout unset. The --no-desktop flag skips the browser desktop that the CLI adds to a fresh image by default; a headless Gateway doesn't need it.

2. Turn on systemd user services. OpenClaw installs the Gateway as a systemd user service, and Beam's Ubuntu image doesn't include the PAM module that user services depend on. Connect with beam vm ssh openclaw, install it, and enable lingering so root's service manager starts at boot without anyone logging in:

sh
apt-get update && apt-get install -y libpam-systemd dbus-user-session
loginctl enable-linger root
systemctl start user@0.service
export XDG_RUNTIME_DIR=/run/user/0

Without this step, --install-daemon has no service manager to install into. On a VPS whose image already runs user services, the loginctl enable-linger line is the only one you need, and it is what keeps the Gateway running after you log out.

3. Install OpenClaw. Run the installer. The --no-onboard flag skips the automatic onboarding so you can run it yourself with the service flag in the next step:

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

4. Onboard and install the service. Onboarding asks for your model provider and channels, then installs the Gateway as a background service:

sh
openclaw onboard --install-daemon
openclaw doctor
openclaw gateway status

Everything the installer and onboarding write sits on the VM's root disk, so it survives a stop and start. With lingering on, the Gateway service starts with the machine after a stop and start, with no login needed. Run openclaw gateway status after a cold start to confirm.

5. Open the dashboard. Leave the Gateway on loopback and forward the port from your laptop:

sh
beam vm port-forward openclaw 18789:18789

The forward listens on 127.0.0.1 on your machine and travels through an authenticated tunnel. No public URL is created for the port. Open http://127.0.0.1:18789/ and you're in the Control UI. On a plain VPS the equivalent is the SSH tunnel from OpenClaw's docs, ssh -N -L 18789:127.0.0.1:18789 user@gateway-host.

How to run OpenClaw in Docker on a server

OpenClaw's Docker setup runs the Gateway in a container and keeps its state in directories on the host, so the container can be replaced without losing anything. It needs Docker Engine with Compose v2. Building the image from source needs at least 6 GB of RAM, and a smaller server should pull the pre-built image, which is what this example does.

On a Beam VM, turn the Docker daemon on when you create the machine. Prepared VM images already include Docker, Compose and Buildx:

sh
beam vm new openclaw --cpu-tier shared --cpu 2 --memory 4096 --no-desktop --docker-enabled
beam vm ssh openclaw

Inside the server, clone the repository, choose the pre-built image and run the setup script from the Docker runtime guide:

sh
git clone https://github.com/openclaw/openclaw.git
cd openclaw
export OPENCLAW_IMAGE="ghcr.io/openclaw/openclaw:latest"
./scripts/docker/setup.sh

The script creates the host directories, pulls the image, runs onboarding, generates a Gateway token, writes it to .env and starts the Gateway with Compose. Check it with:

sh
docker compose ps
curl -fsS http://127.0.0.1:18789/healthz

Three host directories hold the state: ~/.openclaw for config, credentials and skills, ~/.openclaw/workspace for the agent's files, and ~/.openclaw-auth-profile-secrets for the auth-profile key. Back up all three together. Programs you install inside a running container are gone when the container is recreated, so OpenClaw's guide has you add extra binaries to the image at build time.

On a Beam VM, Docker's images, volumes and build cache are stored on the root disk and survive a stop and start. Our post on Docker sandbox alternatives covers when a container alone is enough isolation for an agent and when it isn't.

How to keep the OpenClaw gateway private

Keep the Gateway bound to loopback and reach it through a tunnel. That is OpenClaw's default on a regular install and the setup its docs call safest. Anyone who can reach port 18789 with a valid token is talking to an assistant that can run commands, read its workspace and message your contacts, so the port should never be open to the internet.

  • Don't add a firewall rule for 18789. OpenClaw's Hetzner guide says so directly: allow SSH from your own network and leave the Gateway port closed.
  • Know that container installs bind wider. The Docker setup sets the Gateway to a LAN bind inside the container, which is why it generates a token. Keep the host port private and tunnel to it.
  • Use the token for any non-loopback bind. OpenClaw refuses a LAN or tailnet bind without a token, a password or a trusted identity-aware proxy.
  • Run the audit. openclaw security audit reports where your config has moved away from the conservative defaults.
  • Treat the state directory as a credential. OAuth tokens are stored in plaintext SQLite under the config directory, so its backups need the same care as a password file.

On a VPS you build this from parts: a provider firewall, SSH key login and the SSH tunnel. On a Beam VM a port has no public URL until you publish it, beam vm ssh and beam vm port-forward go through an authenticated tunnel, and the browser terminal is protected by default. The Gateway port stays private unless you run beam vm expose on it, and there's no reason to.

Giving the assistant its own machine is also the simplest isolation step. OpenClaw's security docs describe one Gateway as one trust boundary and recommend separate OS users or hosts when people who don't fully trust each other share it. A server that holds nothing except OpenClaw limits what a prompt injection can touch. Our guide to running Claude Code unattended goes deeper on that threat model.

What OpenClaw hosting costs per month

An always-on OpenClaw server costs between about $7 and $32 a month at list prices for roughly 2 vCPUs and 4 GB, with fixed-price VPS plans at the low end of that range. Model usage is billed separately by your model provider.

HostSize pricedHours billedMonthly price
Hostinger APP 22 vCPU, 6 GB RAM, 50 GB diskFlat, 24 months prepaid$6.99, renewing at $12.99
Hetzner CPX22, Helsinki2 vCPU, 4 GB RAM, 80 GB diskFlat€16.99 before VAT
DigitalOcean Basic Droplet2 vCPU, 4 GiB RAM, 80 GiB diskFlat$24.00
Fly Machine, shared-cpu-2x2 shared vCPU, 4GB RAM720$25.39 plus a volume
Beam VM, Shared tier2 vCPU, 4 GiB RAM720$31.68
Beam VM, Shared tier1 vCPU, 2 GiB RAM720$15.84
Beam VM, Shared tier, paused outside working hours2 vCPU, 4 GiB RAM240$10.56

The inputs: Beam's Shared tier is $0.011 per vCPU-hour plus $0.0055 per GiB-hour, for VMs up to 8 vCPUs and 16 GiB. So 2 vCPUs with 4 GiB is $0.044 an hour and 1 vCPU with 2 GiB is $0.022 an hour, billed per second while the VM runs. New accounts default to the Performance tier at $0.05 per vCPU-hour plus $0.01 per GiB-hour, which makes the same 2 vCPU, 4 GiB VM $0.14 an hour, or $100.80 for 720 hours. Pass --cpu-tier shared as the examples do. Beam storage isn't billed yet; the planned rate is $0.0001 per GB-hour for retained VM disk and snapshots, including while the VM is stopped, which is about $0.07 per GB a month. There are no egress fees.

Hostinger's OpenClaw plans are paid up front for the full term. Hetzner's price is for its Helsinki location and rises to €19.99 in Nuremberg. DigitalOcean's is the regular-CPU Basic Droplet. Fly's figure is the shared-cpu-2x preset with 2GB at $13.39 plus 2GB of extra RAM at $6.00 per GB in its lowest-priced regions, and a volume for OpenClaw's state adds $0.15 per GB a month.

For a 2 vCPU assistant that runs every hour of the month, the fixed-price plans in the table come in under the Beam VM's $31.68. The 240-hour row is the other case: an assistant you use during working hours, about 8 hours a day for 30 days, and pause the rest of the time. A paused VM keeps its RAM and running processes and has no compute charge. The Gateway is offline while paused, so channel messages wait or fail until you resume, and its outside connections have to reconnect afterwards. Automatic resume doesn't change that: it wakes a VM on SSH, an SDK call, a tunnel or a request to a published URL, not on an incoming chat message.

Choosing between a VPS and a pay-per-second VM for OpenClaw

Choose a fixed-price VPS when the assistant has to answer at any hour and you're comfortable looking after a Linux server. It's the lowest monthly price, the setup is well documented, and Hostinger sells plans with a one-click OpenClaw Docker template.

A Beam VM fits better in four cases:

  • The assistant doesn't need to run all month. Per-second billing with stop and pause turns unused hours into zero compute cost, as the 240-hour row shows.
  • You want to pause mid-task. A pause checkpoints RAM and processes along with the disk, so a long browser session or a half-finished job is there when you resume. A VPS that is shut down boots fresh.
  • You'd rather not own the network setup. The Gateway port stays unpublished unless you expose it, and the dashboard tunnel is one command.
  • You want a restore point before changing things. beam vm snapshot create openclaw --name before-upgrade captures the root disk while the VM keeps running, and a snapshot can be restored into a new VM if an upgrade or a new skill breaks the install. Snapshot names are unique across your workspace, so add a date to the name if you take more than one.

Two limits apply. Beam VMs are CPU-only, so a self-hosted open-source model has to run on GPU compute elsewhere and be called over the network. And Beam's Spot tier, the cheapest at $0.0063 per vCPU-hour plus $0.00135 per GiB-hour, can be interrupted with 30 seconds' notice and has to be restarted by hand, which rules it out for an assistant that should stay online.

If you're hosting an agent you built yourself, our guide to AI agent hosting walks through the same choice for other kinds of agents.

FAQ

What is OpenClaw hosting?

OpenClaw hosting is a server that keeps the OpenClaw Gateway running so your assistant stays connected to its chat channels when your own computer is off. In practice it's a Linux VPS or VM with root access, a persistent disk and a supported Node version, plus a private way to reach the dashboard on port 18789.

What are the server requirements for OpenClaw?

OpenClaw needs Node 24.16.0 or later on the 24.x line, or Node 26.1.0 or later, on macOS, Linux or Windows. Its docs don't state a RAM minimum for the Gateway, but building the Docker image from source needs at least 6 GB, and smaller servers should use the pre-built image.

Can I run OpenClaw on a VPS?

Yes. OpenClaw's docs list DigitalOcean, Hetzner, Hostinger, Fly.io and several other providers. Pick a plan with root access, install OpenClaw with the installer script or Docker, and keep the Gateway port closed in the firewall.

How much does it cost to host OpenClaw?

At list prices a 2 vCPU, 4 GB server costs €16.99 a month before VAT on Hetzner's CPX22 in Helsinki, $24 on a DigitalOcean Basic Droplet and $31.68 on a Beam VM on the Shared tier for 720 hours. Hostinger's 2 vCPU, 6 GB OpenClaw plan is $6.99 a month on a 24-month prepaid term. Model API usage is extra.

Can OpenClaw run in Docker?

Yes. Clone the repository, set OPENCLAW_IMAGE to the pre-built image and run ./scripts/docker/setup.sh. The script onboards, writes a Gateway token to .env and starts the Gateway with Docker Compose, with state kept in host directories outside the container.

Is it safe to expose the OpenClaw gateway port?

No. Keep the Gateway on loopback and connect through an SSH tunnel, Tailscale or, on a Beam VM, beam vm port-forward. If you bind it to a LAN or tailnet address, OpenClaw requires a token or password, and a public address should never serve port 18789 directly.

Does OpenClaw need a GPU?

No. OpenClaw calls a model provider over the network, so the host needs only CPU and memory. A GPU matters only if you also want to serve an open-source model yourself, and that model would run on separate GPU compute.

Can I pause an OpenClaw server when I'm not using it?

On a host that supports it, yes. A paused Beam VM keeps its disk, RAM and processes and stops billing compute. The assistant can't receive channel messages while it's paused, so this suits working-hours use more than an assistant that should reply overnight.

Give OpenClaw its own machine

A Beam VM gives OpenClaw a root disk that persists, systemd, Docker, a pause that keeps memory and a private tunnel to the dashboard, billed per second while it runs. Create a Beam account and run the commands at the top of this page, or read more about Beam virtual machines. Current rates are on the pricing page.

Eli MernitPublished November 20, 2026

Pay as you go
billed by the second

Give your agents their own machines

Sign up, install the CLI, and launch a sandbox, VM, or GPU from your terminal or your coding agent.