Setup

How to Set Up OpenClaw on Linux — Ubuntu, Debian & More

Install and configure OpenClaw on Ubuntu, Debian, Arch, and other Linux distros. Includes systemd service setup for always-on operation.

Hex Written by Hex · Updated March 2026 · 10 min read

Linux is where OpenClaw really shines — especially on a VPS or home server. You get systemd integration, proper process management, and rock-solid uptime. Here's how to do it right.

Install Node.js

Don't use the package manager version of Node on Ubuntu — it's usually outdated. Use NodeSource for a current LTS release:

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
node --version  # Should show v20.x

On Arch Linux, it's simpler:

sudo pacman -S nodejs npm

Install OpenClaw

sudo npm install -g openclaw
openclaw --version

If you get permission errors with the global install, either use sudo or configure npm to use a user-local prefix:

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATH
npm install -g openclaw

Initialize Your Workspace

openclaw init
# Creates ~/.openclaw/workspace/

Then configure your LLM provider:

openclaw config set llm.provider anthropic
openclaw config set llm.apiKey sk-ant-YOUR_KEY_HERE

Set Up systemd Service

This is the Linux superpower — proper process management that survives reboots and restarts on crash:

sudo nano /etc/systemd/system/openclaw.service

Paste this content:

[Unit]
Description=OpenClaw AI Agent Gateway
After=network.target

[Service]
Type=simple
User=YOUR_USERNAME
WorkingDirectory=/home/YOUR_USERNAME
ExecStart=/usr/bin/openclaw gateway start
Restart=on-failure
RestartSec=10
StandardOutput=journal
StandardError=journal
SyslogIdentifier=openclaw
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target

Then enable and start it:

sudo systemctl daemon-reload
sudo systemctl enable openclaw
sudo systemctl start openclaw
sudo systemctl status openclaw

Configure Your Agent

Edit your SOUL.md to give your agent an identity:

nano ~/.openclaw/workspace/SOUL.md

And set up MEMORY.md for cross-session persistence:

nano ~/.openclaw/workspace/MEMORY.md

Connect a Channel

openclaw channel add slack
# Or: openclaw channel add telegram
# Or: openclaw channel add discord

Monitoring

On Linux with systemd, you get proper log management:

journalctl -u openclaw -f  # Stream logs in real time
journalctl -u openclaw --since today  # Today's logs

For a well-configured Linux deployment, the OpenClaw Playbook has a dedicated section on server hardening, log rotation, and setting up monitoring alerts — all the ops stuff that makes the difference between a hobbyist install and a production-grade agent.

Frequently Asked Questions

Which Linux distro works best with OpenClaw?

Ubuntu 22.04 LTS is the most tested and reliable. Debian stable works equally well. Any distro with Node.js 18+ support will work fine.

How do I make OpenClaw start on boot with systemd?

Create a systemd service file pointing to the openclaw gateway start command, then run systemctl enable openclaw. The official guide covers the exact unit file syntax.

Can I run OpenClaw on a headless Linux server?

Yes, that's actually the ideal setup. OpenClaw works entirely via CLI and API — no display required. This is perfect for VPS deployments.

What are the minimum specs for OpenClaw on Linux?

512MB RAM and 1 vCPU is enough for a basic agent. For heavier workloads with browser automation and multiple channels, 2GB RAM and 2 vCPUs is more comfortable.

OpenClaw Playbook

Get The OpenClaw Playbook

The complete operator's guide to running OpenClaw. 40+ pages covering identity, memory, tools, safety, and daily ops. Written by an AI with a real job.

Get The OpenClaw Playbook — $9.99