ClawTank
DocsTipsBlogDeploy now
All posts
Running OpenClaw on Raspberry Pi: The Complete Hardware and Setup Guide

Running OpenClaw on Raspberry Pi: The Complete Hardware and Setup Guide

February 6, 2026|8 min read
Table of Contents
  • Why Raspberry Pi?
  • Hardware Requirements
  • Storage: SD Card vs. SSD
  • Operating System Setup
  • Installing Node.js and OpenClaw
  • Gateway Configuration
  • systemd for Always-On Operation
  • Performance Benchmarks
  • SD Card Longevity
  • Exposing OpenClaw to the Internet
  • Cloudflare Tunnel (Recommended)
  • Tailscale
  • Raspberry Pi vs. VPS vs. Hosted
  • Troubleshooting
  • Gateway fails after reboot
  • High memory usage
  • Thermal throttling
  • SD card corruption
  • Summary
  • References

Haven't installed OpenClaw yet?

curl -fsSL https://openclaw.ai/install.sh | bash
iwr -useb https://openclaw.ai/install.ps1 | iex
curl -fsSL https://openclaw.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Worried it'll affect your machine? ClawTank — cloud deploy in 60s, zero risk to your files.

Running OpenClaw on Raspberry Pi: The Complete Hardware and Setup Guide

Most people run AI agents on cloud servers or powerful desktops. But there is a quieter option sitting on your desk: a Raspberry Pi. Drawing under 10 watts at full load, a Raspberry Pi 5 can run OpenClaw around the clock for pennies a month in electricity, giving you a private, always-on AI agent that you fully control.

This guide covers everything from choosing the right hardware to systemd auto-start and performance tuning.

Why Raspberry Pi?

Running an AI agent on a VPS typically costs $5--$20/month. A Raspberry Pi costs roughly $0.50--$1.00/month in electricity after the initial hardware purchase[1]. Beyond cost savings, a Pi on your home network gives you physical control over the hardware, local network access to home automation systems and NAS devices, zero latency for local integrations, and no monthly bills beyond your API provider.

If you would rather skip the setup, hosted platforms like ClawTank handle all of this for you. But for tinkerers who want local network access, a Raspberry Pi is hard to beat.

Hardware Requirements

The Raspberry Pi 5 with 8 GB RAM is the recommended choice. The Node.js runtime, gateway process, and concurrent tool executions all benefit from headroom.

Board RAM Verdict
Raspberry Pi 5 (8 GB) 8 GB Recommended
Raspberry Pi 5 (4 GB) 4 GB Workable with limits
Raspberry Pi 4 (8 GB) 8 GB Functional but slower
Raspberry Pi 4 (4 GB) 4 GB Minimum viable

Cooling is essential. Without it, the Pi 5 will thermal-throttle within minutes of sustained use. Use the official active cooler or a passive aluminum case like the Argon ONE[2].

Storage: SD Card vs. SSD

This matters more than most people expect. Random 4K IOPS -- the metric that matters for databases and logs -- is roughly 30x better on an NVMe SSD compared to a typical A2-rated SD card. OpenClaw writes logs, updates its SQLite memory database, and performs frequent small file reads during skill execution. An SSD with the official Raspberry Pi M.2 HAT makes all of these dramatically faster.

Power supply: Use the official Raspberry Pi 27W USB-C supply. Third-party chargers frequently cause under-voltage warnings when an SSD and cooler are attached.

Optional UPS: For truly always-on operation, a PiSugar 3 or Waveshare UPS HAT provides battery backup through brief outages and clean shutdown during longer ones.

Operating System Setup

Flash Raspberry Pi OS Lite (64-bit) using the Raspberry Pi Imager. The Lite version omits the desktop, saving roughly 600 MB of RAM for headless server use.

# Verify you are running 64-bit
uname -m
# Expected: aarch64

# Update everything
sudo apt update && sudo apt full-upgrade -y
sudo reboot

Set a static IP for reliable access:

sudo nmcli con mod "Wired connection 1" \
  ipv4.addresses 192.168.1.50/24 \
  ipv4.gateway 192.168.1.1 \
  ipv4.dns "1.1.1.1,8.8.8.8" \
  ipv4.method manual

sudo nmcli con up "Wired connection 1"

Installing Node.js and OpenClaw

OpenClaw requires Node.js 22 or later. Install from the NodeSource repository:

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install -y nodejs

node --version   # v22.x.x
npm --version    # 10.x.x

Install and onboard OpenClaw:

Deploy your own AI assistant

ClawTank deploys OpenClaw for you — no servers, no Docker, no SSH. Free 14-day trial included.

Start my free trial
npm install -g openclaw
openclaw onboard

The wizard walks you through choosing an LLM provider, entering your API key, setting up the workspace, and configuring your first messaging integration.

Gateway Configuration

Edit ~/.openclaw/openclaw.json for Raspberry Pi:

{
  "gateway": {
    "port": 3700,
    "maxConcurrentTasks": 2,
    "taskTimeout": 120,
    "logLevel": "info"
  },
  "providers": {
    "anthropic": { "apiKey": "sk-ant-..." }
  },
  "defaultModel": "claude-sonnet-4-20250514"
}

Key settings: maxConcurrentTasks: 2 keeps memory pressure manageable, and taskTimeout: 120 prevents runaway tasks.

systemd for Always-On Operation

Create the service file:

sudo tee /etc/systemd/system/openclaw.service > /dev/null <<'EOF'
[Unit]
Description=OpenClaw AI Agent Gateway
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi
ExecStart=/usr/bin/openclaw gateway start
Restart=always
RestartSec=10
Environment=NODE_ENV=production
MemoryMax=2G
CPUQuota=80%
StandardOutput=journal
StandardError=journal
SyslogIdentifier=openclaw

[Install]
WantedBy=multi-user.target
EOF

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

The Restart=always directive ensures automatic recovery after crashes or reboots. MemoryMax=2G prevents runaway memory consumption.

Performance Benchmarks

Measurements from a Pi 5 (8 GB) with NVMe SSD, using the Anthropic provider:

Operation Pi 5 (SSD) Pi 5 (SD Card) VPS (2 vCPU)
Simple query (no tools) 1.2s 1.4s 0.9s
Skill execution (file read) 1.8s 3.1s 1.3s
Multi-step task (5 tools) 8.5s 12.3s 6.8s
Gateway cold start 4.2s 7.8s 3.1s

Memory usage is roughly 180 MB idle, 280 MB during active conversation, and up to 450 MB at peak. CPU usage is under 5% while waiting on API responses and 15--40% during tool execution. The Pi 5 handles this comfortably.

SD Card Longevity

If you must use an SD card, reduce write amplification:

echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

echo 'tmpfs /tmp tmpfs defaults,noatime,nosuid,size=256m 0 0' | \
  sudo tee -a /etc/fstab

sudo sed -i 's/#SystemMaxUse=/SystemMaxUse=50M/' /etc/systemd/journald.conf
sudo systemctl restart systemd-journald

These changes significantly extend SD card lifespan[3].

Exposing OpenClaw to the Internet

Cloudflare Tunnel (Recommended)

No open ports needed, TLS handled automatically:

curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64.deb -o cloudflared.deb
sudo dpkg -i cloudflared.deb
cloudflared tunnel login
cloudflared tunnel create openclaw-pi
# ~/.cloudflared/config.yml
tunnel: <TUNNEL_ID>
credentials-file: /home/pi/.cloudflared/<TUNNEL_ID>.json
ingress:
  - hostname: openclaw.yourdomain.com
    service: http://localhost:3700
  - service: http_status:404

Tailscale

For private access from your own devices without exposing anything publicly:

curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up

Raspberry Pi vs. VPS vs. Hosted

Factor Raspberry Pi 5 VPS ($10/mo) ClawTank (Hosted)
Monthly cost ~$1 electricity $10--$20 Varies by plan
Setup time 1--2 hours 30 minutes 5 minutes
Maintenance You handle it You handle it Managed
Local network access Yes No No
Data location Your home Data center Cloud
Uptime Depends on power/internet 99.9%+ 99.9%+

For zero maintenance, ClawTank provides managed instances. For hobbyists and home automation enthusiasts, the Pi is excellent.

Troubleshooting

Gateway fails after reboot

Check journalctl -u openclaw --since "5 minutes ago". Common causes include network not ready (ensure After=network-online.target), Node.js not in PATH, or permission issues on ~/.openclaw/.

# Fix PATH issue by using absolute path in service
ExecStart=/usr/local/bin/openclaw gateway start

# Fix permissions
sudo chown -R pi:pi /home/pi/.openclaw
chmod 700 /home/pi/.openclaw
chmod 600 /home/pi/.openclaw/credentials/*

High memory usage

If the gateway approaches the memory limit:

systemctl status openclaw | grep Memory

Reduce maxConcurrentTasks to 1 in openclaw.json and restart the service.

Thermal throttling

Monitor temperature continuously:

vcgencmd measure_temp
# Or watch continuously
watch -n 1 vcgencmd measure_temp

If temperatures regularly exceed 80 degrees Celsius, upgrade your cooling solution. The official active cooler keeps the Pi 5 under 60 degrees Celsius during sustained OpenClaw workloads.

SD card corruption

Signs include random read errors and the filesystem going read-only:

sudo fsck -y /dev/mmcblk0p2

If corruption recurs, invest in an SSD. The reliability improvement alone justifies the cost.

Summary

A Raspberry Pi 5 makes a capable platform for OpenClaw. The initial hardware investment of $100--$150 pays for itself within a year compared to VPS hosting. The key decisions: get the 8 GB model, use an NVMe SSD, set up systemd for reliability, and use Cloudflare Tunnel or Tailscale for remote access.

References

  1. Raspberry Pi 5 power consumption measurements - Jeff Geerling
  2. Raspberry Pi 5 thermal analysis - Tom's Hardware
  3. SD card wear leveling and longevity - Raspberry Pi Documentation
  4. OpenClaw documentation - Installation Guide
  5. Cloudflare Tunnel documentation
  6. Node.js on ARM64 - NodeSource

Enjoyed this article?

Get notified when we publish new guides and tutorials.

Ready to deploy OpenClaw?

No Docker, no SSH, no DevOps. Deploy in under 1 minute.

Start my free trial
ClawTank
TermsPrivacy