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

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
| Component | Requirement | Notes |
|---|---|---|
| OS | Ubuntu 22.04+, Debian 11+, Fedora 38+, or any modern Linux | Arch and other distros supported — see sections below |
| Node.js | Version 24 (recommended) or 22.16+ | Installed via nvm in this guide |
| RAM | 2 GB minimum, 4 GB recommended | 1 GB VPS possible with swap — see VPS section |
| Disk | 5 GB free | SSD preferred |
| Internet | Required | For 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 instructionsSOUL.md— agent personality and communication styleTOOLS.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:
| Spec | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 1 GB (with swap) | 2–4 GB |
| Disk | 20 GB SSD | 40 GB SSD |
| OS | Ubuntu 22.04 LTS | Ubuntu 24.04 LTS |
| Provider | Any (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
| Criteria | Self-hosted Linux | TryOpenClaw Cloud |
|---|---|---|
| Setup time | 15–30 minutes | 2 minutes |
| Cost | VPS ~$5–20/month | From $4/month |
| Security | You manage firewall, SSH, updates | Managed by TryOpenClaw team |
| Uptime | Depends on your VPS + monitoring | 99.9% SLA |
| Full control | Yes | Limited to Dashboard |
| Best for | DevOps, need complete control | Focus on using, not operating |
Detailed comparison: OpenClaw Self-Hosted vs Cloud — Which Should You Choose?
Summary
Linux desktop (6 steps, ~10–15 minutes):
- Update system + install build tools
- Install Node.js 24 via nvm
- Install OpenClaw
- Run
openclaw onboard --install-daemon - Run
loginctl enable-lingerfor persistent daemon - Access WebChat at
http://localhost:18789
VPS production (add ~15–20 minutes):
- Add swap for low-RAM servers
- SSH tunnel or Tailscale for remote access
- Basic security: firewall, disable SSH password auth, dedicated user
- (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.
Related Posts
OpenClaw Skills Security: How to Evaluate, Install Safely, and Harden Your Setup
Best OpenClaw Skills: 25 Must-Have Skills by Category (2026)