Install OpenClaw on Raspberry Pi

Complete guide to install OpenClaw on Raspberry Pi 4/5 using Docker or native Node.js. Turn your Pi into a personal AI assistant server.

Medium ⏱️ 15 min

Prerequisites

Before you begin, ensure your Raspberry Pi meets these requirements:

  • Raspberry Pi 4 or 5 (4GB+ RAM recommended)
  • 64-bit Raspberry Pi OS (Bullseye or Bookworm)
  • At least 16GB SD card or SSD
  • Stable internet connection
  • SSH or terminal access

πŸ’‘ Tip: Pi 5 with 8GB RAM provides the best experience for running the AI gateway.


Docker provides an isolated environment and simplifies updates. This is the officially recommended method.

Step 1: Install Docker

# Update system
sudo apt update && sudo apt upgrade -y

# Install Docker using the official script
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

# Add your user to the docker group
sudo usermod -aG docker $USER

# Apply group changes (or logout and login again)
newgrp docker

# Verify installation
docker --version

Step 2: Install Docker Compose

# Install Docker Compose plugin
sudo apt install docker-compose-plugin -y

# Verify installation
docker compose version

Step 3: Deploy OpenClaw with Docker

Clone the OpenClaw repository and run the setup:

# Clone the repository
git clone https://github.com/openclaw/openclaw.git
cd openclaw

# Run the Docker setup script
./docker-setup.sh

The script will:

  • Build the gateway image for ARM64
  • Run the onboarding wizard
  • Start the gateway via Docker Compose
  • Generate a gateway token

Step 4: Access the Gateway

Open a browser and navigate to:

http://<your-pi-ip>:18789

You can find your Pi’s IP address with:

hostname -I

Method 2: Native Node.js Installation

For more control or if you prefer not to use Docker.

Step 1: Install Node.js 22

# Install Node.js using NodeSource
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs

# Verify installation
node --version
# Should display v22.x.x

Step 2: Install OpenClaw

npm install -g openclaw@latest

Step 3: Run the Setup Wizard

openclaw onboard

The wizard will guide you through:

  1. AI Provider Setup β€” Choose Claude, GPT-4, or another model
  2. API Key Configuration β€” Enter your API key
  3. Messaging Channels β€” Connect WhatsApp, Telegram, etc.

Step 4: Start the Gateway

openclaw gateway

Expected output:

🦞 OpenClaw Gateway v2026.1.24
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
βœ“ Gateway running on localhost:18789
βœ“ WebChat available at http://localhost:18789

To run OpenClaw automatically on boot:

For Docker Setup

Docker Compose is already configured to restart automatically. Just ensure Docker starts on boot:

sudo systemctl enable docker

For Native Installation

Create a systemd service:

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

Add the following content (replace pi with your username if different):

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

[Service]
Type=simple
User=pi
ExecStart=/usr/bin/openclaw gateway
Restart=on-failure
RestartSec=10
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target

Enable and start:

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

Performance Optimization

Reduce Memory Usage

For Pi with 4GB RAM, add to your ~/.openclaw/config.yaml:

agent:
  maxContextTokens: 8000

Use External SSD

For better performance, boot from an SSD instead of SD card:

# Check connected USB devices
lsusb

Enable Swap (If Low on RAM)

sudo dphys-swapfile swapoff
sudo nano /etc/dphys-swapfile
# Set CONF_SWAPSIZE=2048
sudo dphys-swapfile setup
sudo dphys-swapfile swapon

Next Steps

Your Raspberry Pi is now running OpenClaw! Continue with:


Troubleshooting

Docker Build Fails on ARM

If Docker build fails, ensure you’re using 64-bit Raspberry Pi OS:

uname -m
# Should display aarch64

Port Already in Use

# Find what's using the port
sudo lsof -i :18789

# Or start on a different port
openclaw gateway --port 18790

High CPU Usage

Reduce the model’s context window or use a lighter model in your AI provider settings.