Installation Guide

How to Run OpenClaw on Raspberry Pi

Set up OpenClaw on a Raspberry Pi with simple steps, system requirements, and limitations.

8 min read
Mar 16, 2026
Ampere Team

The Raspberry Pi is the perfect platform for a personal AI agent. Low power, always-on, and completely under your control. If you want to self-host OpenClaw without a power-hungry server, the Pi is your answer.

This guide walks you through installing and optimizing OpenClaw on a Raspberry Pi 4. By the end, you'll have a fully functional AI agent running on $50 hardware.

What You'll Need

  • Raspberry Pi 4 (4GB or 8GB RAM)
  • MicroSD card (32GB+) or USB SSD
  • Power supply (USB-C, 3A+)
  • Internet connection (WiFi or Ethernet)
  • OpenAI API key

Note: Raspberry Pi 3 will work but is noticeably slower. Pi Zero and Pi 2 are not recommended due to insufficient RAM.

Why Run on Raspberry Pi?

Low Power

5-7 watts vs 50-100W for a desktop. Perfect for 24/7 operation.

Affordable

$50-100 total cost vs $500+ for a server or ongoing cloud fees.

Private

Your data stays on your hardware. No cloud dependencies.

Always-On

No sleep mode. Your agent is ready whenever you need it.

Step 1: Prepare Your Pi

Start with a fresh Raspberry Pi OS (64-bit) installation:

  1. Download Raspberry Pi Imager
  2. Install Raspberry Pi OS (64-bit) on your SD card/SSD
  3. Boot the Pi and complete initial setup
  4. Enable SSH: sudo raspi-config → Interface Options → SSH
  5. Update system: sudo apt update && sudo apt upgrade -y

Step 2: Install OpenClaw

Install Node.js and OpenClaw:

# Install Node.js 20.x curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt install -y nodejs # Verify installation node --version # Should show v20.x.x npm --version # Install OpenClaw globally sudo npm install -g openclaw # Verify installation openclaw --version

Step 3: Configure OpenClaw

Set up your agent configuration:

# Create agent directory mkdir ~/my-agent cd ~/my-agent # Initialize OpenClaw openclaw init # Set your OpenAI API key export OPENAI_API_KEY=your-api-key-here # Edit configuration nano openclaw.yaml

Add your API key to ~/.bashrc for persistence:

echo 'export OPENAI_API_KEY=your-api-key-here' >> ~/.bashrc source ~/.bashrc

Step 4: Optimize for Pi

Raspberry Pi has limited resources. Optimize OpenClaw for better performance. See our memory optimization guide for detailed tips.

# openclaw.yaml optimizations for Pi memory: conversation: max_messages: 10 # Reduce for Pi's limited RAM max_tokens: 2000 model: default: gpt-3.5-turbo # Faster, cheaper than GPT-4 timeout: request: 30000 # 30 second timeout

Step 5: Run Your Agent

Start your agent:

# Run in foreground openclaw run # Or run with PM2 for auto-restart sudo npm install -g pm2 pm2 start openclaw --name my-agent pm2 save pm2 startup

Connect to your Pi agent via Telegram or Discord to control it from anywhere.

Troubleshooting

Slow Performance?

  • Switch to USB SSD if using SD card
  • Use GPT-3.5 instead of GPT-4
  • Reduce conversation history limits
  • Check CPU temperature: vcgencmd measure_temp

Out of Memory?

  • Increase swap: sudo dphys-swapfile swapoff && sudo nano /etc/dphys-swapfile
  • Run fewer agents simultaneously
  • Close unnecessary system services

FAQ

Frequently Asked Questions

Which Raspberry Pi models work?
Raspberry Pi 4 (4GB or 8GB) is recommended. Pi 3 can work but will be slower. Pi Zero and older models lack sufficient RAM and CPU power.
How much power does it use?
OpenClaw on a Pi 4 uses approximately 5-7 watts under normal load. This is significantly more efficient than running on a desktop or cloud VM for 24/7 operation.
Can I run multiple agents?
Yes, but monitor RAM usage. Each agent process uses 200-400MB. On a 4GB Pi, you can comfortably run 2-3 agents. On 8GB, 4-5 agents.
Is it fast enough?
Response times are 2-4 seconds for typical queries. Slower than desktop but acceptable for many use cases. The Pi handles the orchestration; LLM calls still go to APIs.
Should I use SD card or SSD?
SSD strongly recommended. SD cards are slow and wear out quickly with frequent writes. A USB SSD dramatically improves performance and reliability.

Final Thoughts

Running OpenClaw on a Raspberry Pi is a practical way to self-host your AI agent. It's not as fast as a desktop or cloud server, but for $50 you get a private, always-on assistant that uses minimal power.

The Pi shines for personal use, home automation integrations, and learning. For production workloads with many users, consider managed hosting or a more powerful server.

Ready to Build Your Pi Agent?

Deploy OpenClaw on your Raspberry Pi and start building today.

Get Started →