A Raspberry Pi running OpenClaw gives you a 24/7 personal AI assistant for under $50 in hardware. It draws about 5 watts, runs silently, and fits in a drawer. If you don’t need macOS-specific features (iMessage, Apple Shortcuts) — which are covered in the Mac Mini setup guide — a Pi is arguably the most cost-effective way to self-host your agent.
Here’s everything you need to know.
Hardware Requirements
Minimum: Raspberry Pi 4 (4GB)
Works, but you’ll feel the limits. Good for single-channel setups (one messaging app, basic skills).
Recommended: Raspberry Pi 5 (8GB)
The sweet spot. Enough RAM for OpenClaw + a few background skills, faster I/O, and USB 3.0 for external storage.
Storage
Don’t run from an SD card long-term. SD cards wear out from constant writes (logs, memory files, transcripts). Options:
| Storage | Speed | Durability | Cost |
|---|---|---|---|
| SD card | Slow | Poor (months) | $10 |
| USB SSD | Fast | Excellent (years) | $25-40 |
| NVMe via HAT | Fastest | Excellent | $40-60 |
A USB SSD is the practical choice. Boot from it directly (Pi 5 supports this natively, Pi 4 needs a one-time firmware update).
Power Supply
Use the official power supply. Underpowered Pi = random crashes. The Pi 5 needs a 27W USB-C supply; don’t reuse your phone charger.
Installation
Step 1: Flash the OS
Use Raspberry Pi Imager to flash Raspberry Pi OS Lite (64-bit) — you don’t need a desktop environment.
During setup in the imager:
- Enable SSH
- Set your username and password
- Configure Wi-Fi (or use Ethernet — more reliable)
Step 2: Install Node.js
OpenClaw requires Node.js 20+:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo bash -
sudo apt install -y nodejs
node --version # Should show v22.x
Step 3: Install OpenClaw
sudo npm install -g openclaw
openclaw init
The init wizard walks you through API keys and channel setup. Have your API key ready (Anthropic, OpenRouter, or whichever provider you use).
Step 4: Start as a Service
# Create a systemd service
sudo tee /etc/systemd/system/openclaw.service > /dev/null << 'EOF'
[Unit]
Description=OpenClaw AI Agent
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi
ExecStart=/usr/bin/openclaw gateway start --foreground
Restart=always
RestartSec=10
Environment=NODE_ENV=production
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl enable openclaw
sudo systemctl start openclaw
Now it starts on boot and restarts if it crashes.
Optimization Tips
1. Use Lightweight Models
The Pi itself doesn’t run the AI model — it sends requests to cloud APIs. But context window size and skill count affect RAM usage. Keep your config lean:
- Start with 3-5 skills, add more as needed
- Use smaller context windows if you’re on 4GB RAM
- Avoid memory-heavy skills (browser automation is rough on a Pi)
2. Swap Space
Add swap for safety — Node.js can spike memory usage:
sudo dphys-swapfile swapoff
sudo sed -i 's/CONF_SWAPSIZE=.*/CONF_SWAPSIZE=2048/' /etc/dphys-swapfile
sudo dphys-swapfile setup
sudo dphys-swapfile swapon
3. Log Rotation
OpenClaw generates transcript logs. Without rotation, they’ll fill your disk:
sudo tee /etc/logrotate.d/openclaw > /dev/null << 'EOF'
/home/pi/.openclaw/workspace/*.jsonl {
weekly
rotate 4
compress
missingok
notifempty
}
EOF
4. Temperature Management
The Pi 5 throttles at 85°C. In an enclosed space, add a small heatsink or fan case. Check temperature with:
vcgencmd measure_temp
If you’re consistently above 70°C, get a case with active cooling ($10-15).
What Works Well on Pi
- Messaging channels: Telegram, Discord, Slack, Signal — all work great
- Text-based skills: Web search, email management, calendar, notes
- Cron jobs: Morning briefings, periodic checks, reminders
- Memory system: MEMORY.md, daily notes, heartbeats
- Multi-agent setups: Works, but keep agent count reasonable (3-5)
What Doesn’t Work (or Struggles)
- Browser automation: Chromium on Pi is painfully slow. Use
web_fetchinstead - Local AI models (Ollama): Even the Pi 5 is too slow for useful local inference. Stick to cloud APIs
- Heavy file processing: Large PDF analysis, video transcription — offload these to a more powerful machine
- iMessage/Apple Notes: macOS only. Use a Mac Mini if you need Apple ecosystem integration
Pi vs Mac Mini vs Cloud VPS
| Factor | Raspberry Pi 5 | Mac Mini M4 | Cloud VPS |
|---|---|---|---|
| Cost (hardware) | $80 | $500+ | $0 |
| Monthly cost | ~$1 electricity | ~$2 electricity | $5-50/mo |
| Performance | Adequate | Excellent | Varies |
| macOS features | ❌ | ✅ | ❌ |
| Setup difficulty | Medium | Low | Medium |
| Power draw | ~5W | ~7W | N/A |
| Noise | Silent | Silent | N/A |
| Physical size | Tiny | Small | N/A |
Choose Pi if: Budget is tight, you want minimal power draw, and you don’t need macOS features.
Choose Mac Mini if: You want the best experience and Apple ecosystem integration.
Choose VPS if: You don’t want to manage hardware, or you’re frequently moving. Check out our Docker deployment guide for a containerized VPS setup.
Headless Access
You’ll manage your Pi over SSH. A few quality-of-life tips:
# From your laptop, add to ~/.ssh/config:
Host pi
HostName 192.168.1.xxx
User pi
# Now just: ssh pi
For checking logs:
# Live OpenClaw logs
journalctl -u openclaw -f
# Check status
openclaw status
Backup Strategy
Your agent’s brain lives in ~/.openclaw/workspace/. Back it up:
# Simple cron backup to USB or NAS
0 3 * * * rsync -a ~/.openclaw/workspace/ /mnt/backup/openclaw/
Or push to a private git repo — OpenClaw’s workspace is already git-friendly.
Troubleshooting
“openclaw: command not found” after reboot
Node.js path might not be in the systemd environment. Use the full path in your service file: /usr/bin/openclaw or /usr/local/bin/openclaw.
High memory usage
Check with htop. If Node.js is using >3GB on a 4GB Pi, reduce skills or add swap.
Network drops If using Wi-Fi, consider switching to Ethernet. For Wi-Fi, disable power management:
sudo iw wlan0 set power_save off
SD card corruption This is why we recommended an SSD. If you must use SD, enable read-only root filesystem or use overlayfs.
Final Thoughts
A Raspberry Pi won’t give you the fastest or most capable OpenClaw setup, but it’s the most efficient. Five watts, $50, silent, always on. For most people running a text-based AI assistant with a few messaging channels, it’s more than enough.
Start with the Pi 5 (8GB), a USB SSD, and the official power supply. Total cost: about $100. Your monthly electricity bill goes up by roughly 50 cents.
That’s a 24/7 AI assistant for the price of a nice dinner. Once you’re up and running, check out the top 10 skills every beginner should install and learn how to set up scheduled automations with cron jobs.