OpenClaw on Raspberry Pi: Low-Cost AI Agent Deployment
OpenClaw on Raspberry Pi: Low-Cost AI Agent Deployment
By Marcus Johnson | February 7, 2026
OpenClaw on Raspberry Pi: Low-Cost AI Agent Deployment
Raspberry Pi offers an affordable way to run OpenClaw 24/7 without the cost of cloud hosting or keeping your main computer on.
---
Why Raspberry Pi?
| Aspect | Benefit |
|---|---|
| Cost | Under $100 total |
| Power | ~5 watts (pennies/month) |
| Size | Credit card sized |
| Uptime | Runs 24/7 without fan noise |
| Learning | Great for tinkering |
Recommended Hardware
Minimum Setup ($55)
| Component | Price | Notes |
|---|---|---|
| Raspberry Pi 4 (2GB) | $45 | 4GB recommended for better performance |
| Power supply | $10 | Official USB-C |
| SD Card (32GB) | $8 | Class 10 recommended |
Recommended Setup ($100)
| Component | Price | Notes |
|---|---|---|
| Raspberry Pi 4 (4GB) | $55 | More RAM for better performance |
| Power supply | $10 | Official USB-C |
| SD Card (64GB) | $12 | A2 rated for apps |
| Case with fan | $15 | Active cooling |
| Ethernet cable | $8 | More reliable than WiFi |
Power Consumption
| State | Power Usage | Monthly Cost |
|---|---|---|
| Idle | 3-5 watts | ~$0.50 |
| Under load | 6-8 watts | ~$1.00 |
Initial Setup
1. Install Raspberry Pi OS
1. Download Raspberry Pi Imager 2. Flash Raspberry Pi OS Lite (64-bit) to SD card 3. Enable SSH in settings 4. Boot Pi and connect via Ethernet
2. Initial Configuration
# SSH into Pi ssh pi@raspberrypi.local password: raspberryUpdate system
sudo apt update && sudo apt upgrade -yInstall required packages
sudo apt install -y curl git python3-pipEnable Docker (optional, for container setup)
curl -fsSL https://get.docker.com | sh sudo usermod -aG docker pi ---
Installing OpenClaw
Option 1: Direct Installation
# Install Node.js 22+ curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt install -y nodejsInstall OpenClaw
npm install -g openclawVerify
openclaw --version Option 2: Docker Installation
# Create directory mkdir -p /home/pi/openclaw cd /home/pi/openclawCreate docker-compose.yml
cat > docker-compose.yml << 'EOF' version: '3.8' services: openclaw: image: openclaw/openclaw:latest container_name: openclaw restart: unless-stopped ports: - "18789:18789" volumes: - ./data:/home/openclaw/.openclaw - ./workspace:/home/openclaw/workspace stdin_open: true tty: true EOFStart container
docker-compose up -d ---
Configuration for Pi
Resource Optimization
{ "agents": { "defaults": { "model": "claude-sonnet-4-20250514", "maxTokens": 2000, "contextWindow": 32000 } }, "sandbox": { "enabled": true, "memoryLimit": "512m" } } Local Model Option (Free, but Slower)
# Install Ollama curl -fsSL https://ollama.ai/install.sh | sh ollama serve &Pull a lightweight model
ollama pull llama3.2:3bConfigure OpenClaw
openclaw config set providers.ollama.baseUrl "http://localhost:11434/v1" openclaw config set agents.defaults.model "llama3.2:3b" ---
Remote Access
Option 1: Tailscale VPN (Recommended)
# Install Tailscale curl -fsSL https://tailscale.com/install.sh | shConnect
sudo tailscale up --auth-key YOUR_AUTH_KEYAccess from anywhere via your tailnet
OpenClaw available at: http://100.x.x.x:18789
Option 2: SSH Tunnel
From your main machine:
# Create tunnel ssh -L 18789:localhost:18789 pi@raspberrypi.localAccess locally
Open browser to http://localhost:18789
Option 3: Cloudflare Tunnel
# Install cloudflared curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64 -o /usr/local/bin/cloudflared chmod +x /usr/local/bin/cloudflaredCreate tunnel
cloudflared tunnel --url http://localhost:18789 ---
Voice I/O on Pi
Text-to-Speech (TTS)
Use eSpeak for free local TTS:
# Install eSpeak sudo apt install -y espeakConfigure OpenClaw
openclaw config set tts.espeak.enabled true openclaw config set tts.espeak.voice "en-us" For better quality, use Piper TTS:
# Install Piper pip install piper-ttsConfigure
openclaw config set tts.piper.enabled true openclaw config set tts.piper.model "en_US-lessac-medium.onnx" Speech-to-Text (STT)
# Install Vosk for offline STT pip install voskConfigure
openclaw config set stt.vosk.enabled true ---
Power and Maintenance
Auto-Start on Boot
# Create systemd service sudo nano /etc/systemd/system/openclaw.service [Unit] Description=OpenClaw AI Agent After=network.target[Service] Type=simple User=pi WorkingDirectory=/home/pi/openclaw ExecStart=/usr/bin/docker-compose -f /home/pi/openclaw/docker-compose.yml up Restart=always
[Install] WantedBy=multi-user.target
# Enable service sudo systemctl enable openclaw sudo systemctl start openclaw Monitoring
# Check status sudo systemctl status openclawView logs
journalctl -u openclaw -fCheck temperature
vcgencmd measure_temp Backup
# Create backup script cat > /home/pi/backup-openclaw.sh << 'EOF' #!/bin/bash DATE=$(date +%Y%m%d) tar -czf /home/pi/backups/openclaw-$DATE.tar.gz /home/pi/openclaw/data Keep last 7 backups
ls -t /home/pi/backups/openclaw-*.tar.gz | tail -n +8 | xargs rm EOFchmod +x /home/pi/backup-openclaw.sh
Add to cron
crontab -e Add: 0 3 * /home/pi/backup-openclaw.sh
---
Troubleshooting Pi Issues
Performance Issues
# Check CPU temperature vcgencmd measure_tempCheck memory
free -hCheck disk space
df -h Fix Overheating
SD Card Corruption Prevention
---
Further Reading
---
Related Articles:
Tags: OpenClaw, AI, Tutorial
Comments
Post a Comment