Platform setup

How to Set Up OpenClaw on Raspberry Pi 5

4 min read

Browse more in Platform setup.

All platform setup guides →

This guide walks you through setting up an always-on OpenClaw Gateway on a Raspberry Pi 5 using Raspberry Pi OS Lite (64-bit). js 24 and OpenClaw, and wire it up as a user service.

By the end, you can manage your OpenClaw gateway remotely from your laptop via SSH and the Control UI.

Setup flow

Prerequisites

  • Raspberry Pi 4 or 5 with 2 GB+ RAM (4 GB recommended).
  • MicroSD card (16 GB+) or a USB SSD for better performance.
  • Official Raspberry Pi power supply.
  • Network connection via Ethernet or WiFi.
  • 64-bit Raspberry Pi OS (required — do not use 32-bit).
  • About 30 minutes to complete the setup.

Steps

  1. 1

    Flash Raspberry Pi OS Lite (64-bit) to your boot drive

    Set up a clean, headless Raspberry Pi OS Lite (64-bit) image so your Pi runs as a small server without desktop overhead. Configure SSH, hostname, and WiFi up front so you do not need a monitor or keyboard later.

    text
    1.   Download [Raspberry Pi Imager](https://www.raspberrypi.com/software/).
    2.   Choose OS: **Raspberry Pi OS Lite (64-bit)**.
    3.   In the settings dialog, pre-configure:
        *   Hostname: `gateway-host`
        *   Enable SSH
        *   Set username and password
        *   Configure WiFi (if not using Ethernet)
    
    4.   Flash to your SD card or USB drive, insert it, and boot the Pi.
  2. 2

    Connect to the Raspberry Pi over SSH

    Once the Pi boots, connect over SSH so you can do the rest of the setup from your main machine. Use the hostname you configured in the imager settings and the user you created there.

    bash
    ssh user@gateway-host
  3. 3

    Update the system and install base packages

    js rely on, like git and build-essential. Set the timezone so cron jobs and reminders behave correctly.

    bash
    sudo apt update && sudo apt upgrade -y
    sudo apt install -y git curl build-essential
    
    # Set timezone (important for cron and reminders)
    sudo timedatectl set-timezone America/Chicago
  4. 4

    Install Node.js 24 from NodeSource

    js 24, so you add the NodeSource repo and install nodejs from there. Verify the version so you know the install worked before moving on.

    bash
    curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
    sudo apt install -y nodejs
    node --version
  5. 5

    Add swap space for low-RAM Raspberry Pi boards

    js spikes. You create a 2G swapfile, enable it at boot, and tune swappiness for better behavior on constrained hardware.

    bash
    sudo fallocate -l 2G /swapfile
    sudo chmod 600 /swapfile
    sudo mkswap /swapfile
    sudo swapon /swapfile
    echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
    
    # Reduce swappiness for low-RAM devices
    echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
    sudo sysctl -p
  6. 6

    Install OpenClaw using the official installer

    Use the official OpenClaw install script so the gateway, CLI, and user services are wired up correctly for your Pi. This script handles the platform-specific bits for you.

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

    Run the OpenClaw onboarding wizard and install the daemon

    The onboarding command walks you through connecting models and channels, and `--install-daemon` sets up the gateway as a persistent user service. On a headless Pi, API keys work better than OAuth flows, and Telegram is a quick first channel.

    bash
    openclaw onboard --install-daemon
  8. 8

    Verify the OpenClaw gateway service is healthy

    Before you depend on the Pi, confirm the gateway is running and inspect logs for any startup issues. These commands show the high-level OpenClaw status, the systemd user service state, and live logs.

    bash
    openclaw status
    systemctl --user status openclaw-gateway.service
    journalctl --user -u openclaw-gateway.service -f
  9. 9

    Access the OpenClaw Control UI through an SSH tunnel

    For configuration and monitoring, you can open the Control UI in your local browser while the gateway stays bound to localhost on the Pi. First, ask the Pi for a dashboard URL, then forward the port over SSH and open the printed URL.

    bash
    ssh user@gateway-host 'openclaw dashboard --no-open'
    
    ssh -N -L 18789:127.0.0.1:18789 user@gateway-host
  10. 10

    Apply performance tweaks for Raspberry Pi 5

    On Pi hardware, disk and memory tuning makes a big difference for OpenClaw responsiveness. js compile cache, and trim GPU and unused services to free RAM.

    bash
    grep -q 'NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache' ~/.bashrc || cat >> ~/.bashrc <<'EOF' # pragma: allowlist secret
    export NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache
    mkdir -p /var/tmp/openclaw-compile-cache
    export OPENCLAW_NO_RESPAWN=1
    EOF
    source ~/.bashrc
    
    echo 'gpu_mem=16' | sudo tee -a /boot/config.txt
    sudo systemctl disable bluetooth

Configuration

OptionDescriptionExample
NODE_COMPILE_CACHEEnables the Node.js module compile cache to speed up repeated CLI invocations on lower-power Raspberry Pi hosts./var/tmp/openclaw-compile-cache
OPENCLAW_NO_RESPAWNDisables automatic respawn behavior for OpenClaw processes when using the compile cache setup on Raspberry Pi.1

Troubleshooting

Out of memory

When the Pi runs out of memory, confirm swap is active and shut down services you do not need. Stick to API-based models so the heavy lifting stays in the cloud.

bash
free -h
sudo systemctl disable cups bluetooth avahi-daemon

Slow performance

If the gateway feels sluggish, move OpenClaw to a USB SSD and check for CPU throttling. A non-zero `vcgencmd get_throttled` output means the Pi is heat or power throttled and you should improve cooling or power.

bash
vcgencmd get_throttled

Service will not start

When the OpenClaw gateway service fails, inspect the user service logs and run the built-in doctor. On headless Pis, also ensure systemd lingering is enabled for your user so the service can run without an active login session.

bash
journalctl --user -u openclaw-gateway.service --no-pager -n 100
openclaw doctor --non-interactive
sudo loginctl enable-linger "$(whoami)"

Skill fails with “exec format error” on Raspberry Pi

This usually means the skill binary is not built for ARM64. Check the Pi architecture and make sure any external binaries you call have an ARM64 build.

bash
uname -m

WiFi drops on Raspberry Pi

If your Pi loses WiFi periodically, disable WiFi power management so the interface stays up under load.

bash
sudo iwconfig wlan0 power off

Frequently asked questions

Powered by Mem0

Add persistent memory to OpenClaw

Official Mem0 plugin for OpenClaw keeps context across chats and tools. Smaller prompts, lower cost, better continuity for your agents.

More in Platform setup