Skip to content

Linux Setup

Linux is ideal for running OpenClaw as a always-on service. This guide covers Ubuntu/Debian, Fedora, and Arch Linux.

Terminal window
# Update system
sudo apt update && sudo apt upgrade -y
# Install Python
sudo apt install python3.11 python3.11-venv python3-pip git -y
# Clone OpenClaw
git clone https://github.com/openclaw/openclaw.git
cd openclaw
# Setup environment
python3.11 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Configure
cp .env.example .env
nano .env

Create /etc/systemd/system/openclaw.service:

[Unit]
Description=OpenClaw AI Assistant
After=network.target
[Service]
Type=simple
User=openclaw
WorkingDirectory=/home/openclaw/openclaw
Environment="PATH=/home/openclaw/openclaw/venv/bin"
ExecStart=/home/openclaw/openclaw/venv/bin/python -m openclaw
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target

Enable and start:

Terminal window
sudo systemctl daemon-reload
sudo systemctl enable openclaw
sudo systemctl start openclaw
Terminal window
# Check status
sudo systemctl status openclaw
# View logs
sudo journalctl -u openclaw -f
# Restart
sudo systemctl restart openclaw
# Stop
sudo systemctl stop openclaw
ProviderMin SpecsPrice
DigitalOcean1GB RAM~$6/mo
Vultr1GB RAM~$6/mo
Linode1GB RAM~$5/mo
Hetzner2GB RAM~$4/mo
Terminal window
# Update system
sudo apt update && sudo apt upgrade -y
# Configure firewall
sudo ufw allow ssh
sudo ufw allow 443 # If using webhooks
sudo ufw enable
# Create dedicated user
sudo useradd -m -s /bin/bash openclaw
sudo su - openclaw

Service won’t start

Terminal window
# Check logs
sudo journalctl -u openclaw -n 50
# Verify permissions
ls -la /home/openclaw/openclaw/

High memory usage

  • Reduce context length
  • Use lighter model (Haiku)