Install OpenClaw on a Raspberry Pi: Complete Pi 5 Setup

You have a Raspberry Pi 5 and want to run your own AI agent locally. You need a setup guide that works, respects the Pi’s constraints, and doesn’t default to expensive cloud APIs. This article is the complete setup for OpenClaw on a Raspberry Pi, specifically the Pi 5, covering everything from OS choice to running your first budget agent.

We will install OpenClaw on a fresh 64-bit OS, configure Docker, set up PostgreSQL, and connect to the community’s preferred budget model providers like DeepSeek via OpenRouter and Ollama. The total cost for the initial run is near zero, and ongoing operation can be free if you use local models. The process takes about 30 minutes if you follow the Claw instructions directly.

This setup assumes you have a Raspberry Pi 5 with at least 4GB of RAM, a power supply, and an SD card. We are using the official 64-bit Raspberry Pi OS (Debian Bookworm) as of April 2026. The instructions are agent-first: where possible, you will give commands to your OpenClaw agent to execute, not type them manually.

What You Need

Your Pi 5 is a capable machine, but it’s not a desktop PC. These prerequisites ensure your setup doesn’t fail from memory exhaustion or an incompatible OS. Getting them wrong means hours of debugging.

  • Raspberry Pi 5 with 8GB RAM: The 4GB model can technically run the core OpenClaw services, but you’ll have zero headroom for local models. 8GB is the practical minimum for a functional agent that can also run a small model via Ollama. The Pi 5’s PCIe 2.0 interface is also required for performant storage.
  • Official Raspberry Pi OS (64-bit), Bookworm or later: The 32-bit OS will not run the required Docker images. As of April 2026, the official “Raspberry Pi OS (64-bit)” release is based on Debian Bookworm. This is non-negotiable.
  • Adequate Power Supply (5V/5A USB-C PD): The Pi 5 under load can draw over 5A. An underpowered supply causes instability, SD card corruption, and failed Docker builds. Use the official Raspberry Pi 27W USB-C Power Supply or an equivalent PD-compliant one.
  • Performance Storage: Do not use a microSD card for the OpenClaw database and Docker volumes. Use either an external USB 3.0 SSD or the official Raspberry Pi M.2 HAT with an NVMe SSD. The I/O load from PostgreSQL will cripple a microSD card.
  • An OpenRouter API Key (Free Tier): This is your gateway to the community’s budget models. Sign up at openrouter.ai. The free tier gives you initial credits to use models like DeepSeek-V3. This is how you run your first agent without waiting hours to download a local model.

Setting Up Your Environment

Flash the OS and Configure the Pi

This is a manual step because your Claw doesn’t exist yet. We’ll get the Pi to a state where it can run Docker and accept SSH connections, which is the launchpad for everything else.

Use the Raspberry Pi Imager on your main computer. Insert your SSD (or microSD card if you must). In the Imager, select “Raspberry Pi OS (64-bit)”. Before writing, press Ctrl+Shift+X to open the Advanced Options.

Set these options:

  • Set hostname: openclaw-pi
  • Enable SSH: Use password authentication
  • Set username and password: (Choose something secure, not the default ‘pi’)
  • Configure wireless LAN: Enter your SSID and password
  • Set locale settings: Set your timezone and keyboard layout
  • Disable overscan

Write the image. Once done, insert the storage into your Pi 5 and power it on. Wait 2 minutes for the first boot.

Connect and Update the System

Now we connect and prepare the base system. All future steps can be done by your Claw, but this initial bootstrap is manual.

Find your Pi’s IP address from your router’s admin page or by using ping openclaw-pi.local from another computer on the same network. Then SSH in.

ssh [email protected]
# Enter your password when prompted

Once logged in, update the system packages and set a necessary kernel parameter for Docker.

sudo apt update && sudo apt full-upgrade -y
sudo sed -i '$ a cgroup_enable=memory cgroup_memory=1 swapaccount=1' /boot/firmware/cmdline.txt
echo "vm.swappiness=10" | sudo tee -a /etc/sysctl.conf
sudo reboot now

Wait for the Pi to reboot, then SSH back in. The system is now updated and configured for container memory limits.

Install Docker and Docker Compose

Docker is the only sane way to run OpenClaw’s dependencies on a Pi. The standard install script works perfectly.

You are my OpenClaw agent. I am setting up a Raspberry Pi 5. Install Docker and Docker Compose for me.

1. Install Docker using the official convenience script: `curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh`
2. Add the current user to the docker group so you can run commands without sudo: `sudo usermod -aG docker $USER`
3. Log out and back in for group changes to apply. You can simulate this by running `newgrp docker`.
4. Install Docker Compose v2 from the official GitHub releases: `sudo apt install docker-compose-plugin -y`
5. Verify both installations: `docker --version` and `docker compose version`

Report the version numbers you get.

What the Claw does: It downloads and runs the Docker install script, sets up user permissions, and installs the Compose plugin. What you see: Confirmation that Docker (likely version 26.x) and Docker Compose (v2.x) are installed. Your user can now run docker commands without sudo.

Allocate Resources and Verify

Before we pull gigabytes of container images, we ensure the Pi’s resources are correctly allocated and the storage is fast.

You are my OpenClaw agent on the Raspberry Pi. Run a system check and configure resources.

1. Check that the kernel parameters are active: `cat /proc/cmdline | grep cgroup`
2. Check available memory and swap: `free -h`
3. Check your storage device and mount point: `df -h /` and `lsblk -o NAME,SIZE,TYPE,MOUNTPOINT`
4. To improve database performance, create a dedicated Docker volume on your fast storage (this is a one-time setup): `docker volume create openclaw_postgres_data`
5. Show a final summary with: `docker volume ls` and `docker info | grep -i root`

What the Claw does: It verifies the earlier configuration took effect, confirms you have enough RAM, and identifies your storage. It creates a persistent Docker volume for PostgreSQL data. What you see: Confirmation that cgroup flags are present, your free memory, proof your storage is not a microSD card (look for `/dev/nvme0n1p2` or `/dev/sda2` on the root mount), and the new openclaw_postgres_data volume listed.


Similar Posts