Install openclaw.ai on Raspberry Pi 4/5

Intermediate ⏱ 45 minutes 📅 Updated Feb 2026

Run openclaw.ai on your Raspberry Pi! This guide covers everything from OS installation to running your first agent.

Raspberry Pi

Pi 5 Recommended

Raspberry Pi 5 with 8GB RAM provides the best experience. Pi 4 with 4GB+ also works well.

📋 Hardware Requirements

1

Install Raspberry Pi OS

Download Raspberry Pi Imager

Download from raspberrypi.com/software

Flash the OS

  1. Open Raspberry Pi Imager
  2. Choose OS → Raspberry Pi OS (64-bit)
  3. Choose Storage → Your microSD card
  4. Click ⚙️ Settings:
    • Enable SSH
    • Set username/password
    • Configure WiFi (if needed)
  5. Click Write and wait ~10 minutes

First Boot

Insert the microSD card, connect power, and wait for boot (~2 minutes). Then SSH in:

bash
ssh pi@raspberrypi.local
# Or use the IP address: ssh pi@192.168.1.xxx
2

Install openclaw.ai

Update System

bash
sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl

Install openclaw

bash
curl -fsSL https://openclaw.ai/install.sh | bash
openclaw onboard --install-daemon

Configure & Run

bash
openclaw init
export OPENAI_API_KEY="your-api-key"
openclaw run
3

Optimize for Raspberry Pi

Increase Swap (Recommended for Pi 4 4GB)

bash
sudo dphys-swapfile swapoff
sudo nano /etc/dphys-swapfile
# Change CONF_SWAPSIZE=100 to CONF_SWAPSIZE=2048
sudo dphys-swapfile setup
sudo dphys-swapfile swapon

Run on Boot (systemd)

bash
sudo nano /etc/systemd/system/openclaw.service
ini
[Unit]
Description=openclaw.ai Agent
After=network.target

[Service]
Type=simple
User=pi
WorkingDirectory=/home/pi
Environment="OPENAI_API_KEY=your-api-key"
ExecStart=/usr/local/bin/openclaw gateway --port 18789
Restart=always

[Install]
WantedBy=multi-user.target
bash
sudo systemctl enable openclaw
sudo systemctl start openclaw
🎉

Success!

openclaw.ai will now start automatically when your Pi boots!