Linux Setup
Overview
Section titled “Overview”Linux is ideal for running OpenClaw as a always-on service. This guide covers Ubuntu/Debian, Fedora, and Arch Linux.
Installation
Section titled “Installation”# Update systemsudo apt update && sudo apt upgrade -y
# Install Pythonsudo apt install python3.11 python3.11-venv python3-pip git -y
# Clone OpenClawgit clone https://github.com/openclaw/openclaw.gitcd openclaw
# Setup environmentpython3.11 -m venv venvsource venv/bin/activatepip install -r requirements.txt
# Configurecp .env.example .envnano .env# Install Pythonsudo dnf install python3.11 python3-pip git -y
# Clone and setupgit clone https://github.com/openclaw/openclaw.gitcd openclawpython3.11 -m venv venvsource venv/bin/activatepip install -r requirements.txt# Install Pythonsudo pacman -S python python-pip git
# Clone and setupgit clone https://github.com/openclaw/openclaw.gitcd openclawpython -m venv venvsource venv/bin/activatepip install -r requirements.txtRunning as Service
Section titled “Running as Service”Using systemd
Section titled “Using systemd”Create /etc/systemd/system/openclaw.service:
[Unit]Description=OpenClaw AI AssistantAfter=network.target
[Service]Type=simpleUser=openclawWorkingDirectory=/home/openclaw/openclawEnvironment="PATH=/home/openclaw/openclaw/venv/bin"ExecStart=/home/openclaw/openclaw/venv/bin/python -m openclawRestart=alwaysRestartSec=10
[Install]WantedBy=multi-user.targetEnable and start:
sudo systemctl daemon-reloadsudo systemctl enable openclawsudo systemctl start openclawManaging the Service
Section titled “Managing the Service”# Check statussudo systemctl status openclaw
# View logssudo journalctl -u openclaw -f
# Restartsudo systemctl restart openclaw
# Stopsudo systemctl stop openclawVPS Deployment
Section titled “VPS Deployment”Recommended Providers
Section titled “Recommended Providers”| Provider | Min Specs | Price |
|---|---|---|
| DigitalOcean | 1GB RAM | ~$6/mo |
| Vultr | 1GB RAM | ~$6/mo |
| Linode | 1GB RAM | ~$5/mo |
| Hetzner | 2GB RAM | ~$4/mo |
Security Hardening
Section titled “Security Hardening”# Update systemsudo apt update && sudo apt upgrade -y
# Configure firewallsudo ufw allow sshsudo ufw allow 443 # If using webhookssudo ufw enable
# Create dedicated usersudo useradd -m -s /bin/bash openclawsudo su - openclawTroubleshooting
Section titled “Troubleshooting”Service won’t start
# Check logssudo journalctl -u openclaw -n 50
# Verify permissionsls -la /home/openclaw/openclaw/High memory usage
- Reduce context length
- Use lighter model (Haiku)