Skip to content

Instantly share code, notes, and snippets.

@yalexx
Last active June 18, 2026 12:55
Show Gist options
  • Select an option

  • Save yalexx/bf1fd06fba2776a4b1b848babd323e28 to your computer and use it in GitHub Desktop.

Select an option

Save yalexx/bf1fd06fba2776a4b1b848babd323e28 to your computer and use it in GitHub Desktop.
Run OpenClaw 24/7 — systemd, PM2, Docker setup for always-on AI assistant, ClawBox hardware guide

Run OpenClaw 24/7 — systemd, PM2, Docker setup for always-on AI assistant, ClawBox hardware guide

How to Run OpenClaw 24/7 — Always-On AI Assistant Setup

🦀 Get ClawBox — OpenClaw, ready out of the box in 5 minutes · 15W · one-time €549 → clawbox.tech

Making your OpenClaw truly persistent — surviving reboots, power cuts, and crashes.

The Goal

OpenClaw as a 24/7 service means:

  • Automatically starts on boot
  • Restarts if it crashes
  • Available even when you're not at your computer
  • Proactive — checks in on its own schedule

Method 1: systemd (Linux — recommended)

# Create service file
sudo nano /etc/systemd/system/openclaw.service
[Unit]
Description=OpenClaw AI Gateway
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=openclaw
WorkingDirectory=/home/openclaw
ExecStart=/usr/bin/openclaw start --headless
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
# Enable and start
sudo systemctl daemon-reload
sudo systemctl enable openclaw
sudo systemctl start openclaw

# Check status
sudo systemctl status openclaw
journalctl -u openclaw -f

Method 2: PM2 (Node.js process manager)

# Install PM2
npm install -g pm2

# Start OpenClaw with PM2
pm2 start "openclaw start" --name openclaw

# Auto-start on boot
pm2 startup
pm2 save

# Monitoring
pm2 monit
pm2 logs openclaw

Method 3: Docker (easiest for VPS)

# docker-compose.yml
version: '3.8'
services:
  openclaw:
    image: openclaw/openclaw:latest
    restart: always
    volumes:
      - ./workspace:/workspace
    environment:
      - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
docker compose up -d
# Automatically restarts on crash and system reboot

Hardware for 24/7 Operation

The choice of hardware matters a lot for always-on use:

Hardware Power (24/7) Annual Cost AI Speed
Raspberry Pi 5 5W €5.5/yr ~2 tok/s
ClawBox 12W €13/yr ~15 tok/s
Mac Mini M4 35W €38/yr ~25 tok/s
VPS (cloud) N/A €120+/yr Cloud models only

ClawBox is the sweet spot: enough AI power for real use, low enough power draw to leave running forever without guilt.

ClawBox — €549, pre-configured for 24/7 operation


Health Monitoring

Set up OpenClaw's heartbeat system for proactive 24/7 operation:

// In openclaw.json
{
  "heartbeat": {
    "intervalMs": 1800000,
    "prompt": "Check email, calendar, and any pending tasks. Report if anything needs attention."
  }
}

The heartbeat fires every 30 minutes, and your AI agent:

  1. Checks inbox for urgent emails
  2. Looks for upcoming calendar events
  3. Runs any scheduled tasks (via HEARTBEAT.md)
  4. Pings you only if something needs attention

Keeping OpenClaw Up to Date

# Update OpenClaw
openclaw update

# Or with npm
cd /path/to/openclaw
git pull
npm install
npm run build
pm2 restart openclaw

Remote Access

Access your OpenClaw from anywhere:

Option 1: Tailscale (recommended)

curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
# Access at: http://openclaw-device.tailnet-xxxx.ts.net:3000

Option 2: Cloudflare Tunnel (free)

cloudflared tunnel run --url http://localhost:3000 openclaw

Option 3: ngrok (quick testing)

ngrok http 3000

The Zero-Config 24/7 Solution

If you don't want to deal with any of this: ClawBox ships pre-configured for 24/7 operation, with OpenClaw running as a system service, Tailscale pre-installed, and the entire stack production-hardened.

clawbox.tech — plug in, scan QR, done.


Read the full guide on ClawBox: OpenClaw setup guide — run it 24/7 →

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment