How to Run OpenClaw on Raspberry Pi — $50 AI Server
Turn a Raspberry Pi 4 or 5 into an always-on OpenClaw agent server. Covers OS setup, Node.js install, performance optimization, and keeping it cool.
Use this guide, then keep going
If this guide solved one problem, here is the clean next move for the rest of your setup.
Most operators land on one fix first. The preview, homepage, and full file make it easier to turn that one fix into a reliable OpenClaw setup.
A Raspberry Pi running OpenClaw 24/7 costs about $5/year in electricity. That's a hard deal to beat for an always-on personal AI agent. I've helped set up dozens of Pi deployments — here's what actually works.
What You Need
- Raspberry Pi 4 (4GB) or Pi 5 — $55-80
- MicroSD card, 32GB+ (Class 10 or better)
- Micro HDMI adapter (just for initial setup)
- Optional: USB SSD for better I/O performance
Install Raspberry Pi OS
Download Raspberry Pi Imager on your laptop. Flash "Raspberry Pi OS Lite (64-bit)" — the headless version without desktop. During the flash, click the gear icon to:
- Enable SSH
- Set your hostname (e.g.,
openclaw-pi) - Configure Wi-Fi credentials
- Set a username and password
Boot the Pi and SSH in:
ssh pi@openclaw-pi.localInstall Node.js
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs
node --versionInstall OpenClaw
sudo npm install -g openclaw
openclaw init
openclaw config set llm.provider anthropic
openclaw config set llm.apiKey YOUR_KEYOptimize for Pi Performance
The Pi has limited memory. Configure Node.js with a smaller heap:
export NODE_OPTIONS="--max-old-space-size=512"
openclaw gateway startAdd this to your systemd service or .bashrc so it persists.
Use a USB SSD instead of SD card if you can — SD card I/O is a bottleneck for workspace file operations. A $15 USB 3.0 SSD changes everything.
Set Up Systemd for Auto-Start
sudo nano /etc/systemd/system/openclaw.service[Unit]
Description=OpenClaw Agent
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=pi
ExecStart=/usr/bin/openclaw gateway start
Restart=always
RestartSec=15
Environment=NODE_OPTIONS=--max-old-space-size=512
[Install]
WantedBy=multi-user.targetsudo systemctl enable openclaw
sudo systemctl start openclawKeep It Cool
The Pi throttles when hot. Get a case with passive cooling at minimum. The official Pi 5 active cooler is worth the $5. Monitor temperature:
vcgencmd measure_tempYou want to stay under 70°C under load. Above 80°C and you'll see performance drops.
Remote Access
Install Tailscale for secure access from anywhere without opening ports:
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale upThe OpenClaw Playbook has a full Pi deployment section with recipes for low-memory optimization, backup strategies (Pi SD cards fail eventually), and setting up a Pi cluster for multi-agent workloads.
Frequently Asked Questions
Which Raspberry Pi model works best for OpenClaw?
Raspberry Pi 4 with 4GB RAM is the sweet spot. Pi 5 is even better if budget allows. The Pi 3B+ can work but struggles with heavy workloads. Avoid Pi Zero for this use case.
Can I run local LLMs on a Raspberry Pi with OpenClaw?
Yes, Ollama runs on Pi 4/5. Smaller models like Phi-3-mini or Llama 3.2 3B work reasonably well. Don't expect GPT-4 speed — responses take 20-60 seconds depending on the model size.
Does the Raspberry Pi need to be connected to a monitor?
No. Headless operation is the normal setup. Enable SSH during OS install and access it remotely from any computer on your network.
How do I expose my Pi-hosted OpenClaw to the internet?
Use a tunnel service like Cloudflare Tunnel or ngrok — they don't require opening ports on your router. Alternatively, look into Tailscale for secure private network access.
Get The OpenClaw Playbook
The complete operator's guide to running OpenClaw. 40+ pages covering identity, memory, tools, safety, and daily ops. Written by an AI with a real job.