How to Run OpenClaw on a Raspberry Pi

A Raspberry Pi running OpenClaw is one of the best $80 investments a small business owner can make. It draws 5 watts, fits in your hand, runs silently 24/7, and gives you a persistent AI agent available from your phone at any time. This guide covers everything you need to get it running.

What You’ll Need

  • Raspberry Pi 5 (8GB model recommended — ~$80 on Amazon)
  • Quality microSD card (32GB+) or USB SSD for better performance
  • Power supply (official Pi 5 power supply recommended)
  • Case with cooling (Pi 5 runs warm under load)
  • Internet connection (wired Ethernet is more reliable than Wi-Fi)

Note on local AI models: A Raspberry Pi can run OpenClaw as a gateway (calling cloud AI APIs like Claude or Gemini), but it cannot run large local AI models at useful speeds. If you want local model inference, see our local machines guide instead.

Step 1: Set Up Raspberry Pi OS

  1. Download the Raspberry Pi Imager on your main computer
  2. Select Raspberry Pi OS Lite (64-bit) — the headless (no desktop) version is fine for a server
  3. In the imager settings, configure: hostname, username/password, Wi-Fi credentials (or skip for Ethernet), and enable SSH
  4. Flash to your SD card or USB SSD
  5. Boot the Pi and SSH in: ssh username@raspberrypi.local

Step 2: Install Node.js

OpenClaw requires Node.js 18 or higher. The Raspberry Pi OS repository often has an older version, so install via NodeSource:

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt-get install -y nodejs

Verify: node --version — should show v20.x or higher.

Step 3: Install OpenClaw

npm install -g openclaw

If you get permission errors, either use a Node version manager (nvm) or fix npm’s global directory:

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
npm install -g openclaw

Step 4: Run the Setup Wizard

openclaw setup

The wizard walks you through:

  • Creating your workspace directory
  • Adding an AI provider (Gemini free tier is the easiest starting point)
  • Connecting a messaging channel (Telegram recommended)

For the workspace, use a path on your Pi: /home/username/.openclaw/workspace is the default.

Step 5: Test the Gateway

openclaw gateway start

Message your Telegram bot. You should get a response within a few seconds. If not:

  • Check logs: openclaw logs --follow
  • Verify your bot token and API key in ~/.openclaw/openclaw.json

Step 6: Run as a System Service (Always-On)

To make OpenClaw start automatically on boot and restart if it crashes:

sudo nano /etc/systemd/system/openclaw.service

Add this content (replace username with your Pi username):

[Unit]
Description=OpenClaw Gateway
After=network.target

[Service]
Type=simple
User=username
WorkingDirectory=/home/username
ExecStart=/home/username/.npm-global/bin/openclaw gateway start
Restart=on-failure
RestartSec=10
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

Enable and start the service:

sudo systemctl daemon-reload
sudo systemctl enable openclaw
sudo systemctl start openclaw

Verify it’s running:

sudo systemctl status openclaw

OpenClaw will now start automatically every time the Pi boots, and restart automatically if it crashes.

Step 7: Keep It Updated

OpenClaw updates regularly. To update:

npm install -g openclaw
sudo systemctl restart openclaw

Or set up a weekly cron job to update automatically:

crontab -e

Add:

0 3 * * 0 npm install -g openclaw && sudo systemctl restart openclaw

Performance Tips for Pi

Use a USB SSD instead of SD card. SD cards are slow and wear out quickly with constant read/write from OpenClaw’s session logs. A $15-20 USB SSD dramatically improves performance and reliability.

Use wired Ethernet. Wi-Fi on the Pi can drop periodically. A wired connection ensures your agent stays reachable.

Set a lighter heartbeat model. Use Gemini Flash for heartbeats to keep API costs low and responses fast on the Pi:

{
  "agents": {
    "defaults": {
      "heartbeat": {
        "every": "2h",
        "model": "google/gemini-3-flash-preview"
      }
    }
  }
}

Monitor temperature. The Pi 5 runs warm. Check temperature periodically: vcgencmd measure_temp. If it’s above 70°C consistently, add active cooling.

What to Expect

With a Pi running OpenClaw 24/7:

  • Response time: 5-20 seconds (same as any cloud setup — bottleneck is the AI API, not the Pi)
  • Uptime: 99%+ with a good SD card or SSD and stable power
  • Electricity cost: ~$4/year at US average rates
  • Maintenance: Occasional updates, otherwise hands-off

Limitations

  • No local AI models: Pi 5 is too slow for useful LLM inference. You’ll call cloud APIs.
  • No browser automation: Running a full browser on a Pi is impractical — disable browser tools in config
  • SD card reliability: Use a quality card or SSD — cheap SD cards fail under constant write load

The Result

A Raspberry Pi running OpenClaw is the most cost-efficient always-on AI agent setup available. $80-140 in hardware, $4/year in electricity, and $10-20/month in API costs gives you a personal AI assistant that’s available on your phone 24/7, runs background tasks while you sleep, and costs less per month than a single SaaS subscription.

For a small business owner who wants AI automation without a monthly platform subscription, it’s hard to beat.

Frequently Asked Questions

What is OpenClaw and why run it on a Raspberry Pi?

OpenClaw is an open-source framework for solving hyperbolic PDEs. Running it on a Raspberry Pi enables portable, low-cost scientific simulations and educational exploration of parallel computing, making advanced numerical methods accessible on a small device.

Which Raspberry Pi models are best suited for running OpenClaw?

A Raspberry Pi 4 or 5 with at least 4GB of RAM is highly recommended. These models offer significantly improved processing power and memory, crucial for efficiently handling the computational demands of OpenClaw simulations.

What are the key prerequisites before I start installing OpenClaw?

You’ll need a Raspberry Pi running Raspberry Pi OS, basic Linux command-line skills, and development tools. This includes a C/C++ compiler (like GCC) and potentially MPI libraries for parallel execution, which are essential for compilation.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *