Skip to content
← Back

Install OpenClaw on Linux

Choose your distro, then run the commands below.

Requirements

Ubuntu / Debian

# Install dependencies
sudo apt update && sudo apt install -y git curl

# Install Node.js 20 (LTS)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

# Clone and start OpenClaw
git clone https://github.com/openclaw/openclaw.git
cd openclaw
npm install
openclaw token new
npm start

Fedora / RHEL / CentOS

# Install dependencies
sudo dnf install -y git curl

# Install Node.js 20
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -
sudo dnf install -y nodejs

# Clone and start
git clone https://github.com/openclaw/openclaw.git
cd openclaw
npm install
openclaw token new
npm start

Arch Linux

# Install dependencies & Node.js
sudo pacman -S git curl nodejs npm

# Clone and start
git clone https://github.com/openclaw/openclaw.git
cd openclaw
npm install
openclaw token new
npm start

NixOS

# Enter dev shell with Node.js
nix-shell -p nodejs git

# Clone and start
git clone https://github.com/openclaw/openclaw.git
cd openclaw
npm install
openclaw token new
npm start

Running as a Service (systemd)

To keep OpenClaw running even after logout, create a systemd service:

# Create service file
sudo tee /etc/systemd/system/openclaw.service > /dev/null <<'EOF'
[Unit]
Description=OpenClaw AI Agent
After=network.target

[Service]
Type=simple
User=$YOUR_USERNAME
WorkingDirectory=/home/$YOUR_USERNAME/openclaw
ExecStart=/usr/bin/npm start
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable openclaw
sudo systemctl start openclaw

# Check status
sudo systemctl status openclaw

Troubleshooting

❌ npm: command not found

Install Node.js using the commands above for your distro

❌ Permission denied when running openclaw

chmod +x ~/openclaw/bin/openclaw

❌ Port 8000 already in use

GATEWAY_PORT=9000 npm start

❌ Service won't stay running

Check logs: sudo journalctl -u openclaw -n 50