Running OpenClaw on Raspberry Pi: The Complete Hardware and Setup Guide
|8 min read
Table of Contents
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.
The wizard walks you through choosing an LLM provider, entering your API key, setting up the workspace, and configuring your first messaging integration.
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].
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.
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.