VPSGauge

How to Install OpenClaw on a VPS: Ubuntu 24.04, Step by Step

Updated Nov 14, 2026 · by Kane · how we check

Part of VPS for AI agents, our guide to this topic

Short answer

How to install OpenClaw on an Ubuntu 24.04 VPS: run the official installer as a normal sudo user, then openclaw onboard --install-daemon. Turn on lingering so the gateway service keeps running after you log out and after a reboot. Open the dashboard through an SSH tunnel; port 18789 never needs to face the internet.

Time
30 min
Steps
8
Works on
Ubuntu
24.04 LTS · OpenClaw 2026.11.3
On this page
  1. Before you start
  2. 8 steps
    1. 1Check memory and add swap on small plans
    2. 2Run the official installer
    3. 3Run onboarding
    4. 4Keep it running after logout and reboot
    5. 5Keep the gateway off the public internet
    6. 6Open the dashboard through an SSH tunnel
    7. 7Connect Telegram
    8. 8Back up, then update
  3. Key takeaways
  4. A VPS for this guide
  5. Common OpenClaw install problems
  6. After you install OpenClaw: going further
  7. Questions

This guide has no affiliate links in the steps.

Do the boring part first. If the server is brand new, secure a new VPS first: SSH keys, no root login, a firewall. OpenClaw runs an AI agent with access to your server, so a weak box becomes a weak agent. If you haven’t bought a server yet, our page on which VPS to pick for OpenClaw covers sizing and prices. This guide follows OpenClaw 2026.11.3, the latest stable release on npm (published November 10, 2026), with the Node 24 LTS that the installer sets up.

Before you start

OpenClaw is one Node.js process, the Gateway, plus a CLI. Before you install OpenClaw, check the server against the official requirements:

  • Memory: 1 vCPU and 1 GB RAM is the absolute minimum, with about 500 MB of disk. The docs recommend 2 GB or more for logs, media and several chat channels. Browser automation needs more again.
  • OS: Ubuntu LTS is the best-tested Linux path. ARMv7 boards are not supported.
  • Node.js: 24.16.0+ on the 24 line, or 26.1.0+. Node 22, 23 and 25 are not supported. You don’t have to install it yourself: the installer adds Node 24 LTS from NodeSource when Node is missing.
  • AI access: an API key from a model provider, or an existing Claude Code or Codex CLI login. On a headless server the docs recommend API keys over OAuth.
  • A sudo user that isn’t root, and SSH access from your own computer.

OpenClaw install docs, requirements list: Node 24.16.0+ on 24.x, or 26.1.0+, with 24.22.1+/26.12.1+ strongly recommended for security; the installer provisions Node 24 LTS on Linux when Node is missing. Node 24.16.0+ or 26.1.0+, and the Linux installer adds Node 24 LTS for you. Source: docs.openclaw.ai, captured Nov 20, 2026.

A local model won’t fit in 1 GB, so plan on a hosted API. If the agent will also browse the web or run heavier jobs, our guide to the best VPS for AI agents explains what those workloads add.

YOUR COMPUTER browser: dashboard YOUR VPS Ubuntu 24.04 openclaw gateway systemd user service 127.0.0.1:18789 loopback only SSH :22 tunnel internet → :18789 no public port MODEL API your API key TELEGRAM you chat from a phone outbound only
YOUR COMPUTER browser: dashboard SSH :22 tunnel YOUR VPS Ubuntu 24.04 openclaw gateway systemd user service 127.0.0.1:18789 no public port outbound only MODEL API your API key TELEGRAM chat from a phone

Nothing in this setup listens on a public port except SSH. The gateway calls out to your model provider and to Telegram; nobody calls in.

How to install OpenClaw: 8 steps

Run every server command as your normal sudo user over SSH. Replace YOUR_SERVER_IP and yourname with your own values.

1

Check memory and add swap on small plans

See what you’re working with, and patch the system before adding anything:

serverfree -h
sudo apt update && sudo apt full-upgrade -y

On a 1 GB or 2 GB plan, add swap. OpenClaw’s own DigitalOcean guide recommends a 2 GB swap file for 1 GB servers, so a memory spike slows the agent down instead of killing it:

serversudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Check: Run free -h again; the Swap row now shows about 2.0Gi.

OpenClaw’s DigitalOcean guide, tips for the 1 GB Droplet: prefer API-based models over local ones, because local LLM inference does not fit in 1 GB. On 1 GB, swap helps but a local model still won’t fit: use a hosted API. Source: docs.openclaw.ai, captured Nov 20, 2026.

2

Run the official installer

Stay logged in as your sudo user, not root. The official VPS guides have you run OpenClaw as a non-root account, so its state lives under that user’s home and the gateway installs as that user’s service.

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

The script checks your OS, installs Node and Git if they’re missing, and installs OpenClaw as a global npm package. It may ask for your sudo password. --no-onboard stops it before the setup wizard, so you run that yourself in step 3. Then check both versions:

serveropenclaw --version
node --version

If it fails: openclaw: command not found. The docs say this is almost always PATH: npm’s global bin directory isn’t on it yet. Log out, SSH back in, and try again. Still missing? Compare npm prefix -g with echo "$PATH".

3

Run onboarding

serveropenclaw onboard --install-daemon

A fresh install offers Quick start or Custom setup. Quick start looks for AI access it can reuse: API-key environment variables, or a Claude Code or Codex CLI login. You pick a connection, and OpenClaw checks it with a real completion before saving anything. If nothing is detected, it opens manual provider setup, where you paste your API key.

Know what Quick start picks for you: an agent named main with full access. Choose Custom setup if you want to set the access mode yourself. Either way the wizard creates a gateway token, and --install-daemon installs the gateway as a systemd user service.

Your settings land in ~/.openclaw/openclaw.json; the agent’s workspace is ~/.openclaw/workspace/. Change settings later with openclaw configure. The wizard ends by trying to open the dashboard. On a server there’s no browser to open, so that waits for step 6.

4

Keep it running after logout and reboot

Onboarding already installed the service. If you skipped that part, install and start it now:

serveropenclaw gateway install
openclaw gateway start

That creates openclaw-gateway.service, a systemd user unit with Restart=always. The catch: Linux stops a user’s services when that user logs out. Turn on lingering so it starts at boot and keeps running with nobody logged in:

serversudo loginctl enable-linger $(whoami)
WITHOUT LINGER you log in gateway runs you log out gateway stops WITH LINGER server boots gateway runs you log out: still running sudo loginctl enable-linger $(whoami)
WITHOUT LINGER you log in gateway runs you log out gateway stops WITH LINGER server boots gateway runs, logged in or not

Now check it:

serversystemctl --user status openclaw-gateway.service
openclaw gateway status

Check: active (running) from systemctl, and the gateway listening on port 18789. To watch the logs, run journalctl --user -u openclaw-gateway.service -f.

If it fails: systemctl --user commands fail on a headless server. Run export XDG_RUNTIME_DIR=/run/user/$(id -u) and try again.

5

Keep the gateway off the public internet

The gateway listens on 127.0.0.1 by default (gateway.bind is loopback). Leave it there. The dashboard it serves is an admin panel: chat, config, and approvals for commands the agent runs on your server. OpenClaw’s security guide says not to expose it publicly.

Let the firewall admit SSH and nothing for OpenClaw. If you followed the setup guide, this is already done:

serversudo ufw allow OpenSSH
sudo ufw enable
sudo ufw status verbose

Don’t add a rule for 18789, in ufw or in your provider’s cloud firewall. Then run OpenClaw’s own audit:

serveropenclaw security audit

It reads your config and flags common mistakes; --deep adds live checks against the running gateway. Want to reach the dashboard from a phone without a tunnel? The docs’ answer is Tailscale Serve, which keeps the gateway on loopback. Binding to 0.0.0.0 without auth is the one thing never to do.

6

Open the dashboard through an SSH tunnel

On your own computer, open the tunnel and leave that terminal running:

your computerssh -N -L 18789:127.0.0.1:18789 yourname@YOUR_SERVER_IP
YOUR COMPUTER UFW YOUR VPS browser 127.0.0.1:18789 gateway 127.0.0.1:18789 inside SSH, port 22 anyone → YOUR_SERVER_IP:18789 dropped: no rule for 18789, and the gateway only listens on loopback anyway
YOUR COMPUTER browser → 127.0.0.1:18789 inside SSH, port 22 UFW YOUR VPS gateway on 127.0.0.1:18789 anyone → :18789 dropped no rule for 18789; loopback bind

In a second terminal on your computer, ask the server for a dashboard link:

your computerssh yourname@YOUR_SERVER_IP 'openclaw dashboard --no-open'

Open the printed link in your browser. It points at http://127.0.0.1:18789/, which the tunnel carries to the server.

If it fails: The page asks for a gateway secret. Paste the token; openclaw gateway auth-token --show prints it in an interactive SSH session. If the tunnel itself fails with administratively prohibited, your SSH server blocks forwarding. Set AllowTcpForwarding local in /etc/ssh/sshd_config, then:

serversudo sshd -t
sudo systemctl restart ssh
7

Connect Telegram

OpenClaw supports Discord, Slack, WhatsApp, Signal, Matrix and more. The docs name Telegram the fastest to set up: it needs only a bot token. In Telegram, open a chat with @BotFather (check the handle is exactly that), send /newbot, follow the prompts, and save the token.

1 BOTFATHER /newbot → bot token 2 SERVER channels add token saved 3 YOUR PHONE message the bot → pairing code 4 SERVER pairing approve within 1 hour Until step 4, the bot does not process that sender's messages: the default DM policy is pairing.
1 BOTFATHER /newbot → bot token 2 SERVER openclaw channels add 3 YOUR PHONE message the bot → pairing code 4 SERVER pairing approve, within 1 hour default DM policy: pairing

On the server:

serveropenclaw channels add --channel telegram --token YOUR_BOT_TOKEN
openclaw channels status --probe

Telegram uses long polling by default: the gateway asks Telegram for new messages, so no inbound port is needed. Now send your bot any message from your phone. With the default DM policy, pairing, an unknown sender gets a short code and the message isn’t processed until you approve it:

serveropenclaw pairing list telegram
openclaw pairing approve telegram YOUR_PAIRING_CODE

If it fails: Nothing to approve, or the approval fails. Pairing codes expire after one hour. Message the bot again and approve the new code.

8

Back up, then update

OpenClaw ships often; 2026.11.5 was already in beta when we wrote this. Make an archive of your state first, then update:

serveropenclaw backup create
openclaw update

openclaw update works out how you installed (npm, pnpm, Bun or git). It checks the new version while the old gateway keeps serving, then switches over, restarts the service and verifies it.

1 BACK UP backup create 2 CHECK NEW old gateway serves 3 SWITCH restart service 4 VERIFY gateway status steps 2 to 4: one command, openclaw update
1 BACK UP openclaw backup create 2 CHECK NEW VERSION old gateway keeps serving 3 SWITCH restart the service 4 VERIFY openclaw gateway status steps 2 to 4: one command, openclaw update

To confirm afterwards:

serveropenclaw gateway status
openclaw health

If it fails: You update with a bare npm install -g openclaw@… under a different Node. The docs warn this can install a second copy and leave the service on the old one. Stick to openclaw update, and run openclaw doctor if the versions disagree.

Key takeaways

  1. How to install OpenClaw on a VPS, in short: the official installer as a sudo user, then openclaw onboard --install-daemon.
  2. sudo loginctl enable-linger $(whoami) is what keeps the gateway alive after logout and reboot.
  3. Leave the gateway on loopback. Reach the dashboard through ssh -L 18789:127.0.0.1:18789, never an open port.
  4. Telegram needs no open port either: long polling plus a pairing code you approve within an hour.
  5. Back up with openclaw backup create before every openclaw update.
  6. Still choosing a server? Our best VPS for OpenClaw page compares plans with 2 GB or more; to look wider, compare VPS prices by real monthly cost.

A VPS for this guide

Everything above runs on a VPS with 2 GB of RAM or more. The cheapest 2 GB+ plan at each provider whose prices we read every day, IPv4 included:

Plan · providervCPU · RAM · diskYou payVisit
1 slice
InterServer · New York +2
1 vCPU·2 GB·40 GB$3.00/mo
KVM VPS Special 2 GB
RackNerd · New York +3
2 vCPU·2 GB·35 GB$3.00/mo
VPS nano G11.5s
netcup · Nuremberg
2 vCPU·2 GB·60 GB$3.36/mo
SSD VPS 2
CloudCone · USA
4 vCPU·2 GB·60 GB$3.83/mo
NVMe 2 GB
HostHatch · Amsterdam +15
1 vCPU·2 GB·10 GB$4.00/mo

Prices read Dec 4, 2026. gets that provider's deals on Telegram. Compare every 2 GB plan →

Common OpenClaw install problems

You don’t know what’s broken.Run openclaw triage. It runs read-only health checks and writes up what it found. openclaw doctor shows the findings directly.

The gateway won’t start.Run openclaw doctor --non-interactive, then read the last 50 log lines: journalctl --user -u openclaw-gateway.service -n 50.

Port 18789 is already in use.Find the process with sudo ss -ltnp | grep 18789 and stop it, for example a gateway you started by hand in another terminal.

A process is Killed, or exits with code 137.The server ran out of memory. Check swap with free -h, stay on hosted models, or move to a 2 GB plan.

The gateway stops when you close SSH.Lingering is off. Run sudo loginctl enable-linger $(whoami) and check the service again.

openclaw doctor warns about a short stop timeout.Ubuntu 24.04 gives user services only five seconds to stop at shutdown, which can cut the gateway’s drain short. The Linux platform docs show a drop-in that raises it to 90 seconds. It’s optional.

After you install OpenClaw: going further

  • Back up off the server. openclaw backup create makes the archive; copy it somewhere else, as step 8 of the new VPS setup checklist explains.
  • Add more channels with openclaw channels add once Telegram works.
  • Rerun openclaw security audit after any config change.
  • Running other automation? Our guide to self-host n8n follows the same pattern: a loopback service, a tunnel, no public port.
  • New to servers? Start with what a VPS actually is.

The full list of install methods (Docker, Nix, pnpm, from source) is in OpenClaw’s install docs.

Questions

Do I need root to install OpenClaw?

You need sudo for the installer to add Node and Git, but run everything as a normal user. The official VPS guides keep OpenClaw’s state and service under a non-root account.

Which Node version does OpenClaw need?

Node 24.16.0 or newer on the 24 line, or 26.1.0 or newer. The docs recommend 24.22.1+ or 26.12.1+ for security fixes. On Ubuntu the installer adds Node 24 LTS if Node is missing.

Can I open port 18789 instead of using a tunnel?

You can bind beyond loopback, but only with gateway auth and a firewall limited to your own IPs, and the docs advise against it. An SSH tunnel or Tailscale Serve keeps the gateway on loopback.

Will OpenClaw run on a 1 GB VPS?

It meets the documented minimum. Add swap and use a hosted model API. For several channels or browser automation, the docs recommend 2 GB or more.

How do I update OpenClaw later?

Run openclaw backup create, then openclaw update. It checks the new version while the old gateway serves, then restarts and verifies the service.

How we checked: The steps, requirements and commands come from OpenClaw’s official docs (install, Linux server, DigitalOcean, security, Telegram and update pages) and the npm registry entry for OpenClaw 2026.11.3, read on Nov 14, 2026; the doc screenshots were captured on Nov 20, 2026. Provider images can differ in small ways, such as the default user or firewall. How we check.

Keep reading