Install OpenClaw on Linux: Ubuntu, Debian, Fedora + VPS Production Deploy

15/04/2026
Thuận
install-openclaw-linux

Linux is OpenClaw’s most natural home — the same environment where most AI infrastructure runs. Whether you’re installing on a local Ubuntu desktop or deploying to a VPS for 24/7 operation, Linux gives you the most control and the most stable long-term setup.

This guide covers two scenarios:

  • Part 1: Desktop installation — local Linux machine, development use, personal AI assistant
  • Part 2: VPS production deploy — server running 24/7, full security hardening, remote access

Looking for the full installation overview? The How to Install OpenClaw: Complete A-Z Guide covers all 4 methods. This article focuses specifically on Linux.


System requirements

ComponentRequirementNotes
OSUbuntu 22.04+, Debian 11+, Fedora 38+, or any modern LinuxArch and other distros supported — see sections below
Node.jsVersion 24 (recommended) or 22.16+Installed via nvm in this guide
RAM2 GB minimum, 4 GB recommended1 GB VPS possible with swap — see VPS section
Disk5 GB freeSSD preferred
InternetRequiredFor AI model API calls

Part 1: Install on Linux Desktop

Step 1: Update the system and install build tools

Before installing OpenClaw, make sure your system packages are up to date and the essential build tools are available (needed for native Node.js modules):

Ubuntu / Debian:

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

Fedora:

sudo dnf update -y
sudo dnf install -y gcc gcc-c++ make curl git

Verify: gcc --version and git --version both return version numbers.

Step 2: Install Node.js 24

Use nvm (Node Version Manager) — it’s the most reliable way to manage Node.js on Linux:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

Close your terminal, reopen it, then:

nvm install 24
nvm use 24
nvm alias default 24

Verify: node -v shows v24.x.x and npm -v returns a version number.

Step 3: Install OpenClaw

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

The script downloads and installs OpenClaw automatically.

Verify: openclaw --version shows a version number (e.g. v2026.4.8).

Step 4: Run the Onboard Wizard + install the daemon

openclaw onboard --install-daemon

The wizard guides you through 4 steps:

1. Install the systemd daemon — creates a systemd user service that keeps the Gateway running continuously, even after you close the terminal. The service starts automatically on login.

Check daemon status anytime:

systemctl --user status openclaw-gateway

Start / stop the daemon manually:

systemctl --user start openclaw-gateway
systemctl --user stop openclaw-gateway

2. Choose your AI model — enter the API key for Claude, GPT, Gemini, or another model. No key yet? OpenClaw API Key Configuration Guide walks through each provider step by step.

3. Connect a channel — Telegram, Slack, Discord, WhatsApp, or any of the 20+ supported channels. The wizard provides the exact steps for each.

4. Configure Workspace — creates ~/.openclaw/workspace with:

  • AGENTS.md — agent behavior and task handling instructions
  • SOUL.md — agent personality and communication style
  • TOOLS.md — which tools and integrations the agent can use

Verify everything works:

openclaw doctor

All components should show OK or green checkmarks.

Step 5: Keep the daemon running after logout

By default, systemd user services stop when you log out. To make OpenClaw persist even when you’re not logged in (important for servers or shared machines):

loginctl enable-linger $USER

This tells systemd to keep your user services running at all times, regardless of login state.

Verify:

loginctl show-user $USER | grep Linger

Should return Linger=yes.

Step 6: Access WebChat

OpenClaw’s built-in web interface is available at:

http://localhost:18789

Open this in your browser to use WebChat — a clean interface for chatting with OpenClaw directly from the browser, without a messaging app.


Part 2: Deploy on a VPS for Production

What VPS should you get?

Minimum recommended specs for a production OpenClaw instance:

SpecMinimumRecommended
CPU1 vCPU2 vCPU
RAM1 GB (with swap)2–4 GB
Disk20 GB SSD40 GB SSD
OSUbuntu 22.04 LTSUbuntu 24.04 LTS
ProviderAny (Vultr, DigitalOcean, Hetzner, Linode)Hetzner (best value for EU/US)

Follow Steps 1–5 from Part 1 above on your VPS. The process is identical — SSH into your server and run the same commands.

Optimize startup for small VPS / ARM servers

On 1 GB RAM VPS, add swap to prevent out-of-memory crashes:

sudo 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

For ARM servers (Oracle Free Tier, Ampere), the install script works as-is — no architecture-specific changes needed.

Remote access via SSH tunnel

To access OpenClaw’s WebChat (port 18789) from your local machine without exposing it to the internet:

ssh -L 18789:localhost:18789 user@your-server-ip

Now open http://localhost:18789 on your local machine — traffic is securely tunneled over SSH.

Add a shortcut to ~/.ssh/config for convenience:

Host openclaw-server
  HostName your-server-ip
  User your-username
  LocalForward 18789 localhost:18789

Then just run: ssh openclaw-server

Remote access via Tailscale (alternative)

Tailscale creates a private mesh network between your devices — a cleaner alternative to SSH tunneling for permanent setups:

curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up

After connecting both your server and laptop to the same Tailscale network, access WebChat at http://[tailscale-ip]:18789 from your laptop — no open ports needed.

Basic VPS security

Before going live, harden your server:

Firewall setup (UFW):

sudo ufw allow ssh
sudo ufw allow 443/tcp   # if exposing HTTPS
sudo ufw enable

Do not open port 18789 to the public internet — use SSH tunnel or Tailscale instead.

Disable password SSH login (use keys only):

sudo sed -i 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo systemctl restart sshd

Make sure your SSH key is already authorized before doing this.

Run OpenClaw as a dedicated user:

sudo useradd -m -s /bin/bash openclaw
sudo su - openclaw
# Install Node and OpenClaw as this user

This limits the blast radius if anything goes wrong.


Advanced configuration

Config file location

OpenClaw’s main config is at ~/.openclaw/openclaw.json. Open it with any text editor to change model, channel settings, logging level, and more:

nano ~/.openclaw/openclaw.json

After editing, restart the Gateway:

systemctl --user restart openclaw-gateway

Manage the daemon

# View logs
journalctl --user -u openclaw-gateway -f

# Restart
systemctl --user restart openclaw-gateway

# Disable auto-start
systemctl --user disable openclaw-gateway

Update OpenClaw

openclaw update

The daemon restarts automatically after the update completes. To pin to a specific channel:

openclaw update --channel stable   # stable
openclaw update --channel beta     # new features
openclaw update --channel dev      # latest development build

Install on Fedora / CentOS / RHEL

The steps are the same as Ubuntu/Debian, with different package manager commands:

# Install build tools
sudo dnf install -y gcc gcc-c++ make curl git

# Install nvm, Node.js 24 (same as above)
# Install OpenClaw (same as above)

For RHEL/CentOS 7, the default Node.js is too old. Make sure to use nvm to install Node 24 explicitly — don’t use the system Node.


Install on Arch Linux

# Install build tools and Node.js
sudo pacman -S base-devel nodejs npm git

# Install OpenClaw
curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard --install-daemon

For systemd user service support, ensure you’re running systemd (standard on most Arch setups).


Common Linux errors and fixes

EACCES: permission denied when installing npm global packages

Caused by npm trying to write to a system directory. Fix — change npm’s prefix to a user-owned location:

mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

Then re-run the OpenClaw install.

openclaw: command not found

nvm wasn’t loaded into the current shell. Fix:

source ~/.bashrc

Or close the terminal and reopen.

OpenClaw crashes after a while (OOM on small VPS)

The VPS is running out of memory. Fix: add swap (see VPS section above). Then check if any other processes are consuming RAM:

free -h
ps aux --sort=-%mem | head -10

node-gyp or sharp build errors

Missing build tools. Fix:

sudo apt install -y build-essential python3

Then reinstall OpenClaw.

systemd service won’t start

Check logs for the specific error:

journalctl --user -u openclaw-gateway --no-pager -n 50

Common causes: wrong Node.js version in PATH, missing API key config, port already in use.

Full troubleshooting reference: OpenClaw Troubleshooting Guide


Uninstall

# Stop and disable the daemon
systemctl --user stop openclaw-gateway
systemctl --user disable openclaw-gateway

# Uninstall OpenClaw
npm uninstall -g openclaw

# Remove config data (optional)
rm -rf ~/.openclaw

Self-hosted Linux vs TryOpenClaw Cloud

CriteriaSelf-hosted LinuxTryOpenClaw Cloud
Setup time15–30 minutes2 minutes
CostVPS ~$5–20/monthFrom $4/month
SecurityYou manage firewall, SSH, updatesManaged by TryOpenClaw team
UptimeDepends on your VPS + monitoring99.9% SLA
Full controlYesLimited to Dashboard
Best forDevOps, need complete controlFocus on using, not operating

Detailed comparison: OpenClaw Self-Hosted vs Cloud — Which Should You Choose?


Summary

Linux desktop (6 steps, ~10–15 minutes):

  1. Update system + install build tools
  2. Install Node.js 24 via nvm
  3. Install OpenClaw
  4. Run openclaw onboard --install-daemon
  5. Run loginctl enable-linger for persistent daemon
  6. Access WebChat at http://localhost:18789

VPS production (add ~15–20 minutes):

  1. Add swap for low-RAM servers
  2. SSH tunnel or Tailscale for remote access
  3. Basic security: firewall, disable SSH password auth, dedicated user
  4. (Optional) Automatic security updates

Next step: OpenClaw API Key Configuration Guide to connect and optimize your AI model.

Or: Sign up at TryOpenClaw.io — skip the whole setup, start in 2 minutes.

Contact Us

Have a question or need assistance? We're here to help.