Raspberry Pi
OpenClaw on Raspberry Pi
Goal
Run a persistent, always-on OpenClaw Gateway on a Raspberry Pi for ~$35-80 one-time cost (no monthly fees).
Perfect for:
- 24/7 personal AI assistant
- Home automation hub
- Low-power, always-available Telegram/WhatsApp bot
Hardware Requirements
| Pi Model | RAM | Works? | Notes |
|---|---|---|---|
| Pi 5 | 4GB/8GB | ✅ Best | Fastest, recommended |
| Pi 4 | 4GB | ✅ Good | Sweet spot for most users |
| Pi 4 | 2GB | ✅ OK | Works, add swap |
| Pi 4 | 1GB | ⚠️ Tight | Possible with swap, minimal config |
| Pi 3B+ | 1GB | ⚠️ Slow | Works but sluggish |
| Pi Zero 2 W | 512MB | ❌ | Not recommended |
Minimum specs: 1GB RAM, 1 core, 500MB disk
Recommended: 2GB+ RAM, 64-bit OS, 16GB+ SD card (or USB SSD)
What You’ll Need
- Raspberry Pi 4 or 5 (2GB+ recommended)
- MicroSD card (16GB+) or USB SSD (better performance)
- Power supply (official Pi PSU recommended)
- Network connection (Ethernet or WiFi)
- ~30 minutes
1) Flash the OS
Use Raspberry Pi OS Lite (64-bit) — no desktop needed for a headless server.
- Download Raspberry Pi Imager
- Choose OS: Raspberry Pi OS Lite (64-bit)
- Click the gear icon (⚙️) to pre-configure:
- Set hostname:
gateway-host - Enable SSH
- Set username/password
- Configure WiFi (if not using Ethernet)
- Set hostname:
- Flash to your SD card / USB drive
- Insert and boot the Pi
2) Connect via SSH
ssh user@gateway-host# or use the IP addressssh user@192.168.x.x3) System Setup
# Update systemsudo apt update && sudo apt upgrade -y
# Install essential packagessudo apt install -y git curl build-essential
# Set timezone (important for cron/reminders)sudo timedatectl set-timezone America/Chicago # Change to your timezone4) Install Node.js 22 (ARM64)
# Install Node.js via NodeSourcecurl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -sudo apt install -y nodejs
# Verifynode --version # Should show v22.x.xnpm --version5) Add Swap (Important for 2GB or less)
Swap prevents out-of-memory crashes:
# Create 2GB swap filesudo fallocate -l 2G /swapfilesudo chmod 600 /swapfilesudo mkswap /swapfilesudo swapon /swapfile
# Make permanentecho '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
# Optimize for low RAM (reduce swappiness)echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.confsudo sysctl -p6) Install OpenClaw
Option A: Standard Install (Recommended)
curl -fsSL https://openclaw.ai/install.sh | bashOption B: Hackable Install (For tinkering)
git clone https://github.com/openclaw/openclaw.gitcd openclawnpm installnpm run buildnpm linkThe hackable install gives you direct access to logs and code — useful for debugging ARM-specific issues.
7) Run Onboarding
openclaw onboard --install-daemonFollow the wizard:
- Gateway mode: Local
- Auth: API keys recommended (OAuth can be finicky on headless Pi)
- Channels: Telegram is easiest to start with
- Daemon: Yes (systemd)
8) Verify Installation
# Check statusopenclaw status
# Check servicesudo systemctl status openclaw
# View logsjournalctl -u openclaw -f9) Access the Dashboard
Since the Pi is headless, use an SSH tunnel:
# From your laptop/desktopssh -L 18789:localhost:18789 user@gateway-host
# Then open in browseropen http://localhost:18789Or use Tailscale for always-on access:
# On the Picurl -fsSL https://tailscale.com/install.sh | shsudo tailscale up
# Update configopenclaw config set gateway.bind tailnetsudo systemctl restart openclawPerformance Optimizations
Use a USB SSD (Huge Improvement)
SD cards are slow and wear out. A USB SSD dramatically improves performance:
# Check if booting from USBlsblkSee Pi USB boot guide for setup.
Reduce Memory Usage
# Disable GPU memory allocation (headless)echo 'gpu_mem=16' | sudo tee -a /boot/config.txt
# Disable Bluetooth if not neededsudo systemctl disable bluetoothMonitor Resources
# Check memoryfree -h
# Check CPU temperaturevcgencmd measure_temp
# Live monitoringhtopARM-Specific Notes
Binary Compatibility
Most OpenClaw features work on ARM64, but some external binaries may need ARM builds:
| Tool | ARM64 Status | Notes |
|---|---|---|
| Node.js | ✅ | Works great |
| WhatsApp (Baileys) | ✅ | Pure JS, no issues |
| Telegram | ✅ | Pure JS, no issues |
| gog (Gmail CLI) | ⚠️ | Check for ARM release |
| Chromium (browser) | ✅ | sudo apt install chromium-browser |
If a skill fails, check if its binary has an ARM build. Many Go/Rust tools do; some don’t.
32-bit vs 64-bit
Always use 64-bit OS. Node.js and many modern tools require it. Check with:
uname -m# Should show: aarch64 (64-bit) not armv7l (32-bit)Recommended Model Setup
Since the Pi is just the Gateway (models run in the cloud), use API-based models:
{ "agents": { "defaults": { "model": { "primary": "anthropic/claude-sonnet-4-20250514", "fallbacks": ["openai/gpt-4o-mini"] } } }}Don’t try to run local LLMs on a Pi — even small models are too slow. Let Claude/GPT do the heavy lifting.
Auto-Start on Boot
The onboarding wizard sets this up, but to verify:
# Check service is enabledsudo systemctl is-enabled openclaw
# Enable if notsudo systemctl enable openclaw
# Start on bootsudo systemctl start openclawTroubleshooting
Out of Memory (OOM)
# Check memoryfree -h
# Add more swap (see Step 5)# Or reduce services running on the PiSlow Performance
- Use USB SSD instead of SD card
- Disable unused services:
sudo systemctl disable cups bluetooth avahi-daemon - Check CPU throttling:
vcgencmd get_throttled(should return0x0)
Service Won’t Start
# Check logsjournalctl -u openclaw --no-pager -n 100
# Common fix: rebuildcd ~/openclaw # if using hackable installnpm run buildsudo systemctl restart openclawARM Binary Issues
If a skill fails with “exec format error”:
- Check if the binary has an ARM64 build
- Try building from source
- Or use a Docker container with ARM support
WiFi Drops
For headless Pis on WiFi:
# Disable WiFi power managementsudo iwconfig wlan0 power off
# Make permanentecho 'wireless-power off' | sudo tee -a /etc/network/interfacesCost Comparison
| Setup | One-Time Cost | Monthly Cost | Notes |
|---|---|---|---|
| Pi 4 (2GB) | ~$45 | $0 | + power (~$5/yr) |
| Pi 4 (4GB) | ~$55 | $0 | Recommended |
| Pi 5 (4GB) | ~$60 | $0 | Best performance |
| Pi 5 (8GB) | ~$80 | $0 | Overkill but future-proof |
| DigitalOcean | $0 | $6/mo | $72/year |
| Hetzner | $0 | €3.79/mo | ~$50/year |
Break-even: A Pi pays for itself in ~6-12 months vs cloud VPS.
See Also
- Linux guide — general Linux setup
- DigitalOcean guide — cloud alternative
- Hetzner guide — Docker setup
- Tailscale — remote access
- Nodes — pair your laptop/phone with the Pi gateway