OpenClaw on Raspberry Pi: Always-On AI Agent
Run OpenClaw and DenchClaw on a Raspberry Pi 4/5 for an always-on, local AI agent that costs pennies per day to operate. Full setup and optimization guide.
You can run OpenClaw on a Raspberry Pi — and it's more capable than you might expect. A Raspberry Pi 5 makes a surprisingly capable always-on AI agent host for DenchClaw: it runs 24/7 for a few watts of power, costs under $100, and gives you a dedicated CRM agent server that's always available on your home or office network.
This guide covers the full setup: from flashing the SD card to running your first CRM query on Pi hardware.
Why Run DenchClaw on a Raspberry Pi?#
The use case isn't about raw performance — a Pi won't run large local models well. The value is in always-on availability with a cloud model backend:
- Always accessible: Pi runs 24/7 at ~5-10 watts. No need to keep your laptop open.
- Home network server: Access your DenchClaw instance from any device on your network
- Self-contained: All your CRM data (DuckDB) lives on the Pi, on your property
- Cheap to run: ~$1-3/month in electricity vs cloud hosting costs
- OpenClaw automations: Schedule Skills to run at specific times (daily lead reviews, weekly reports)
- Remote access: Combine with Tailscale for secure access from anywhere
For DenchClaw's local-first philosophy, a Pi is the ultimate expression: your AI agent runs on hardware you physically own, in your building.
Hardware Requirements#
Minimum: Raspberry Pi 4 with 4GB RAM Recommended: Raspberry Pi 5 with 8GB RAM
The Pi 5 has roughly 2-3x the performance of Pi 4 for the same power draw. For DenchClaw with a cloud model backend, either works. If you want to experiment with very small local models (Phi-4 at 3.8B, Llama 3.2 3B), you need the Pi 5's faster CPU.
Additional hardware:
- 32GB+ microSD card (Class 10 / A2 rating)
- USB-C power supply (5.1V/5A for Pi 5)
- Optional: SSD over USB for better durability and speed
Step 1: Flash Raspberry Pi OS#
-
Download Raspberry Pi Imager
-
Choose Raspberry Pi OS Lite (64-bit) — no desktop needed for a server
-
Before writing, click the gear icon and:
- Set hostname:
denchclaw-pi - Enable SSH with password or public key authentication
- Set your WiFi credentials (or use Ethernet)
- Set username/password
- Set hostname:
-
Flash to your SD card, insert into Pi, and power on
Connect via SSH after ~60 seconds:
ssh pi@denchclaw-pi.localStep 2: Update and Install Node.js#
# Update system
sudo apt update && sudo apt upgrade -y
# Install Node.js 20 LTS via NodeSource
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Verify
node --version # Should show v20.x.x
npm --versionStep 3: Install DenchClaw#
# Install globally
sudo npm install -g denchclaw
# Or run without installing
npx denchclawOn first run, DenchClaw will initialize your workspace at ~/.openclaw-dench/workspace and set up the DuckDB database.
Step 4: Configure Your Model#
Since the Pi has limited RAM (4-8GB), running a local LLM is constrained. You have two options:
Option A: Cloud Model (Recommended for Pi)#
Use a cloud model like Claude Haiku or Gemini Flash — these are fast, cheap, and don't require local inference:
openclaw config set apiKeys.anthropic YOUR_KEY
openclaw config set model anthropic/claude-haiku-3-5Claude Haiku and Gemini Flash are both very fast, low-cost models that work well for DenchClaw agent tasks. This is the recommended approach for Pi deployments.
Option B: Tiny Local Model (Pi 5 with 8GB only)#
If you insist on fully local inference, Ollama can run 1-3B models on Pi 5:
# Install Ollama (Linux ARM)
curl -fsSL https://ollama.com/install.sh | sh
# Pull a small model that fits in 8GB RAM
ollama pull phi4:3.8b
# or
ollama pull llama3.2:3bExpect slow generation (~2-5 tokens/second). Workable for occasional queries, not great for interactive use.
Step 5: Set Up as a Persistent Service#
You want DenchClaw's gateway to restart automatically after Pi reboots. Use systemd:
sudo nano /etc/systemd/system/openclaw.service[Unit]
Description=OpenClaw Gateway
After=network.target
[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi
ExecStart=/usr/bin/openclaw gateway start --foreground
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl enable openclaw
sudo systemctl start openclaw
sudo systemctl status openclaw # Verify it's runningStep 6: Set Up Remote Access with Tailscale#
Access your Pi's DenchClaw instance from anywhere with Tailscale:
# Install Tailscale on Pi
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up
# Install Tailscale on your other devices and join the same networkOnce Tailscale is set up, your Pi is reachable at its Tailscale IP from any of your devices, regardless of whether you're on the same local network. This gives you your own private CRM server, accessible from phone, laptop, or anywhere.
Step 7: Connect DenchClaw Web UI to Your Pi#
DenchClaw's web UI can connect to a remote OpenClaw gateway. Once your Pi is running:
- On your laptop, open DenchClaw
- Go to Settings → Gateway
- Point it at your Pi's Tailscale address:
http://100.x.x.x:PORT
All CRM data and agent operations happen on the Pi. Your laptop is just a display terminal.
Automating Tasks with Scheduled Skills#
The Pi setup really shines for scheduled automation. Use OpenClaw's cron-style scheduling to run Skills automatically:
# Daily morning CRM summary at 8 AM
openclaw schedule add "0 8 * * *" "Summarize new leads and pipeline activity from yesterday"
# Weekly report every Monday
openclaw schedule add "0 9 * * 1" "Generate weekly pipeline report and save to docs"
# Check for stale deals every afternoon
openclaw schedule add "0 14 * * *" "Flag deals with no activity in 7+ days"These run on the Pi regardless of whether your laptop is on. You check in to see completed reports rather than manually triggering them.
Performance on Raspberry Pi#
Realistic performance expectations for Pi deployments:
| Operation | Pi 4 (4GB) | Pi 5 (8GB) | vs MacBook |
|---|---|---|---|
| DuckDB query | ~200ms | ~100ms | ~20ms |
| Cloud model query | 1-3s | 1-3s | 1-3s |
| Local model (3B) | 10-30s | 5-15s | 1-3s |
| Skill execution | 3-10s | 2-6s | 1-4s |
Cloud model latency is network-bound, so Pi vs MacBook is nearly identical. Database operations are slower but still fast enough for practical use.
Using an SSD for Better Performance#
SD cards are slow and wear out with constant write operations. For a production Pi setup, use a USB SSD:
# After attaching SSD and identifying device (usually /dev/sda1)
sudo mkdir /data
sudo mount /dev/sda1 /data
# Move DenchClaw workspace to SSD
mv ~/.openclaw-dench /data/openclaw-dench
ln -s /data/openclaw-dench ~/.openclaw-denchThis dramatically improves DuckDB performance and extends the life of your Pi.
Backup Your CRM Data#
Your Pi holds your CRM database. Back it up:
# Simple rsync backup to another machine
rsync -avz ~/.openclaw-dench/workspace/workspace.duckdb backup-server:/backups/
# Or to cloud storage via rclone
rclone copy ~/.openclaw-dench/workspace/workspace.duckdb remote:backups/denchclaw/Schedule this with cron:
crontab -e
# Add: 0 3 * * * rsync -avz ~/.openclaw-dench/workspace/workspace.duckdb backup-server:/backups/Troubleshooting#
Pi runs out of memory during model inference
Lower the model size or switch to a cloud model. Check memory pressure:
free -hIf available memory drops near zero, you're swapping to SD card, which is very slow. Reduce model size or add a swap file on the SSD.
OpenClaw gateway won't start
Check the service logs:
sudo journalctl -u openclaw -fCommon issues: wrong Node.js version (need 18+), port conflict, or permissions issue.
SD card I/O slowing things down
Add ionice -c3 to lower priority of background writes, and move the DuckDB database to a USB SSD as described above.
Connection timeout from remote devices
Verify Tailscale is running on both devices (tailscale status) and that the OpenClaw gateway is bound to 0.0.0.0, not just localhost.
FAQ#
What's the power consumption of a Pi running DenchClaw 24/7?
A Pi 5 under typical DenchClaw load consumes 5-10 watts. At $0.15/kWh, that's about $0.65-$1.30/month in electricity. A Pi 4 uses slightly less. Either way, it's negligible.
Can I run DenchClaw on a Pi Zero 2 W?
Technically yes, but it's quite slow — the Zero 2 W has 512MB RAM and a much slower CPU. Even with cloud models, DuckDB operations and the Node.js runtime will be sluggish. Pi 4 4GB is the practical minimum.
How many simultaneous users can a Pi serve?
For personal use or a small team (2-5 people), a Pi 5 handles DenchClaw load fine when using cloud models. Heavy concurrent agent workloads will bottleneck. If you have a larger team, consider a more powerful ARM server (like a used Mac Mini or a small NUC).
Is this safe to expose to the internet?
Don't expose DenchClaw directly to the internet without proper authentication. Use Tailscale's private network instead — it's designed exactly for this use case and requires zero port forwarding.
Can I use the Pi as a DenchClaw node while keeping my MacBook as the primary?
Yes. DenchClaw supports multiple node configurations where different machines can serve as agents in your workspace. The Pi can handle scheduled tasks while your MacBook remains the interactive interface.
Ready to try DenchClaw? Install in one command: npx denchclaw. Full setup guide →
