A Raspberry Pi running OpenClaw is a private, always-on AI agent for $60 in hardware and $3 a year in electricity. No cloud bills, no data leaving your home network, no vendor dependencies. Here's exactly how to set it up correctly.
Why Raspberry Pi
Three things make the Pi compelling for OpenClaw: cost, privacy, and always-on operation. Once set up, it runs indefinitely without attention. Your conversations stay on your hardware. And the total cost of ownership over two years beats any cloud VPS for a single-agent setup.
Here's what we've seen consistently: Pi-based OpenClaw deployments run for months without intervention once properly configured. The hardware is reliable; the challenge is the initial setup for ARM64.
Hardware & OS Requirements
- Hardware: Raspberry Pi 4 (4GB) or Pi 5. Pi 4 2GB works but is tight.
- Storage: 16GB+ microSD (Class 10 / A1 rating minimum). 32GB recommended.
- OS: Raspberry Pi OS Lite 64-bit (Debian 12 base) — mandatory
- Power: Official Raspberry Pi power supply — underpowered supplies cause random instability
- Cooling: Heatsink strongly recommended for 24/7 operation; fan for Pi 5
Installation & Config
# Update system
sudo apt update && sudo apt full-upgrade -y
# Install Python 3.11
sudo apt install python3.11 python3.11-venv python3-pip -y
# Create user and venv
sudo useradd -m -s /bin/bash openclaw
sudo su - openclaw
python3.11 -m venv /home/openclaw/venv
source /home/openclaw/venv/bin/activate
pip install openclaw
# Initialize
openclaw init
Create the systemd service as per the self-hosted guide. Enable it to start on boot with sudo systemctl enable openclaw.
Optimizing for Low RAM
With 4GB RAM, you have about 2.5GB available after OS overhead. OpenClaw uses ~150MB at idle. Skills and channels add RAM as they load. Three optimizations keep memory usage lean:
- Disable swap if using an SD card — swap on SD cards causes wear and is slower than RAM. Disable it:
sudo dphys-swapfile swapoff && sudo systemctl disable dphys-swapfile - Limit concurrent skill execution — set
max_concurrent_skills: 2in openclaw.yaml to prevent memory spikes from parallel skill runs - Use a USB SSD instead of SD card — USB SSDs are dramatically faster for random I/O (log writes, config reads) and far more reliable for 24/7 operation
# openclaw.yaml — Pi-optimized settings
runtime:
max_concurrent_skills: 2
skill_timeout: 60
log_level: warning # reduce log verbosity to save I/O
model:
provider: anthropic
model: claude-haiku-4-5-20251001 # fastest, lowest cost model for quick tasks
Common Mistakes
Using an SD card for 24/7 operation is the most common mistake. SD cards have limited write endurance — a heavily logging OpenClaw agent can wear out a cheap SD card in months. Use a USB SSD for the OS and data.
- 32-bit OS — causes mysterious package installation failures and memory issues. Always use 64-bit.
- Underpowered USB charger — USB chargers not rated for Pi cause brown-out reboots under CPU load. Use the official power supply.
- No thermal management — the Pi 4 throttles at 80°C. Without heatsinks, sustained OpenClaw workloads cause thermal throttling and slower responses. Add a heatsink case.
- Port forwarding without a firewall — if you're forwarding ports instead of using Cloudflare Tunnel, enable the UFW firewall and allow only 22, 80, 443 before exposing the Pi to the internet.
Frequently Asked Questions
Which Raspberry Pi models support OpenClaw?
Pi 4 (2GB minimum, 4GB recommended) and Pi 5. The Pi 3B+ is too slow for practical use.
Which AI model should I use on Raspberry Pi?
Use hosted API models — Anthropic Claude or OpenAI. Local model inference on Pi hardware produces 1-3 tokens/second, too slow for practical use.
How much RAM does OpenClaw need on Raspberry Pi?
OpenClaw itself uses ~150MB. A 2GB Pi 4 can run a basic setup; 4GB gives comfortable headroom for multiple channels and skills.
Can I run OpenClaw on Raspberry Pi OS 64-bit?
Yes — 64-bit is required. The 32-bit OS causes memory addressing issues with some Python packages.
How do I expose my Pi OpenClaw to the internet?
Use Cloudflare Tunnel (free) for HTTPS access without port forwarding or a static IP. Install cloudflared and configure a tunnel to localhost:8080.
What's the power draw running 24/7?
A Pi 4 draws 3-7W under typical load — about $3-8/year in electricity at $0.15/kWh.
A. Larsen runs OpenClaw on Raspberry Pi hardware and covers ARM-optimized AI agent deployments at aiagentsguides.com.