Skip to content

OpenClaw on Raspberry Pi: Self-Host Your Agent for $35

·10 min read·By Christopher Kvamme

OpenClaw was previously known as Clawdbot and Moltbot. Configuration and commands depend on the version in use.

Run OpenClaw on a Raspberry Pi 4 or Pi 5 with Node 24 and 64-bit Raspberry Pi OS. Covers hardware selection, swap setup, and 24/7 operation on a budget.

OpenClaw on Raspberry Pi: Self-Host Your Agent for $35
Share:
On this page

Key takeaways

  • A Raspberry Pi 4 (2GB+) or Pi 5 runs OpenClaw reliably for under $60 in hardware costs. The gateway is lightweight and AI inference happens in the cloud via API.
  • RAM prices rose sharply in late 2025 due to a DRAM shortage. The Pi 4 1GB ($35) and Pi 5 1GB ($45) are price-protected, but higher-RAM models cost significantly more than a year ago.
  • You must use 64-bit Raspberry Pi OS. The 32-bit version won't run OpenClaw.
  • Add a 2GB swap file and set swappiness to 10 if you're using a 1GB or 2GB board. Without swap, the gateway can get killed under load.
  • Local LLM inference won't work well on a Pi. Use an API provider like Anthropic, OpenAI, or OpenRouter.

Which Raspberry Pi models work with OpenClaw

The Pi 4 (2GB or more) and Pi 5 both run OpenClaw without issues. The official OpenClaw Pi docs specify Pi 4 or Pi 5 with at least 2GB of RAM, with 4GB preferred for anything beyond a single-user personal agent. If you're running cron jobs, multiple channels, or regular subagent tasks, the extra RAM matters.

The Pi 4 1GB can run it with swap configured, but it's tight. If you're buying new hardware specifically for OpenClaw, the Pi 4 2GB or Pi 5 2GB gives you more headroom.

Here's the current pricing as of February 2026:

ModelRAMMSRP (Feb 2026)OpenClaw fit
Raspberry Pi 41GB$35Marginal (needs swap)
Raspberry Pi 42GB$45Good
Raspberry Pi 44GB$55Great
Raspberry Pi 51GB$45Marginal (needs swap)
Raspberry Pi 52GB$65Good
Raspberry Pi 54GB$85Great
Raspberry Pi 58GB$125Overkill for gateway-only

The $35 Pi 4 1GB and $45 Pi 5 1GB are price-protected from the DRAM-driven increases that pushed higher-RAM models up by 30-70%. If you already own a Pi 4 2GB from before the shortage, you're in good shape.

The Pi 5 is faster than the Pi 4 and handles multiple concurrent sessions better. If you plan to run skills that spawn subagents, the Pi 5 is worth the extra cost. For a basic single-user gateway, the Pi 4 4GB is plenty.

OpenClaw Raspberry Pi requirements before you start

Before flashing anything, confirm you have these:

  • A Pi 4 or Pi 5 (the Pi 3B+ can run 64-bit OS technically, but OpenClaw doesn't support it)
  • 16GB+ microSD card at minimum; USB SSD is strongly preferred
  • Ethernet cable if possible; WiFi works but it's less reliable for always-on use
  • The official Raspberry Pi power supply. A cheap third-party charger causes undervoltage, throttling, and crashes.

The OS requirement matters more than you'd think. 64-bit Raspberry Pi OS (aarch64) is required. The 32-bit version doesn't support the Node.js binaries OpenClaw needs. If you're not sure which OS you have, check with uname -m after booting. It should return aarch64.

How to install OpenClaw on Raspberry Pi step by step

Give this to your agent

Set up my Raspberry Pi for OpenClaw. It's running Raspberry Pi OS Lite 64-bit. I've already connected via SSH as the default user. Install all prerequisites including Node.js 24, configure 2GB of swap, then install OpenClaw and run the onboarding wizard. Also apply the performance optimizations for low-power hardware: set gpu_mem to 16, enable NODE_COMPILE_CACHE, and disable Bluetooth.

Always review commands your agent suggests before approving them. Don't paste prompts from sources you don't trust.

Manual installation steps

Step 1: Flash the OS

Download Raspberry Pi Imager and flash Raspberry Pi OS Lite (64-bit) to your SD card or USB SSD. In the settings dialog before flashing, enable SSH, set a username and password, configure your hostname, and add WiFi credentials if you're not using Ethernet.

Step 2: Connect and update

bash

ssh user@your-pi-hostname
bash

sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl build-essential
sudo timedatectl set-timezone America/Los_Angeles

Replace America/Los_Angeles with your actual timezone. OpenClaw uses the system timezone for cron jobs and reminders.

Step 3: Install Node.js 24

bash

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

You should see v24.x.x. Node 22.16+ also works if you prefer LTS.

Step 4: Add swap

Skip this if you have 4GB or more RAM. For 1GB and 2GB boards, this is not optional.

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
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

Setting swappiness to 10 tells the kernel to avoid swap until memory is really needed. The default of 60 causes excessive swapping on SD cards and kills performance.

Step 5: Install OpenClaw

bash

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

The install script handles everything including path setup.

Step 6: Run onboarding

bash

openclaw onboard --install-daemon

The wizard asks for your model provider API key, sets up the gateway config, and installs a systemd service that starts OpenClaw at boot. Use API key auth rather than OAuth when prompted. OAuth browser flows don't work well on headless devices.

Telegram is the fastest channel to connect first. See our Telegram setup guide for the full walkthrough.

Step 7: Verify everything works

bash

openclaw status
sudo systemctl status openclaw

The gateway should be running on port 18789. Check logs if anything looks wrong:

bash

journalctl -u openclaw -f

How to keep OpenClaw running 24/7 on Raspberry Pi

The --install-daemon flag in the onboarding step takes care of this. It creates a systemd service that starts OpenClaw at boot and restarts it if it crashes.

Check that the service is enabled:

bash

sudo systemctl is-enabled openclaw

It should print enabled. If it prints disabled, run:

bash

sudo systemctl enable openclaw

To restart the gateway after a config change:

bash

sudo systemctl restart openclaw

Unexpected shutdowns are usually power-related. Under sustained load, a Pi 4 can briefly pull enough current to trigger an undervoltage event on a weak power supply. The official Raspberry Pi power supply (27W USB-C for Pi 5, 15W for Pi 4) prevents this.

How to access OpenClaw Control UI remotely

The Control UI runs on port 18789 of the Pi. Since the Pi is a headless server with no browser, you access it from your laptop via SSH tunnel.

On your laptop, create the tunnel:

bash

ssh -N -L 18789:127.0.0.1:18789 user@your-pi-hostname

Keep that terminal open, then open http://127.0.0.1:18789 in your browser. The Control UI will load as if the Pi was local.

For permanent remote access without the tunnel, Tailscale is the cleanest option. Install it on the Pi and your laptop, and you can reach the gateway by IP from anywhere on your tailnet. The OpenClaw Tailscale docs walk through the integration.

Raspberry Pi performance, memory, and optimization

OpenClaw is a gateway, not an inference engine. It relays your messages to a cloud API provider and returns the response. The Pi only handles routing, channel connections, and session state. The actual AI work happens on Anthropic's or OpenAI's servers.

This means performance on the Pi is mostly about I/O, not compute. A Pi 4 handles this fine.

What you'll actually notice:

The first CLI invocation after boot is slow (sometimes 10-20 seconds) because Node.js compiles the module cache cold. After that, it's fast. Response latency comes from the API provider, not the Pi. Multiple simultaneous conversations work, but they do use more memory.

Speed up cold starts by enabling the module compile cache:

bash

echo 'export NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cache' >> ~/.bashrc
echo 'export OPENCLAW_NO_RESPAWN=1' >> ~/.bashrc
mkdir -p /var/tmp/openclaw-compile-cache
source ~/.bashrc

Check if the Pi is throttling due to heat or underpowering:

bash

vcgencmd get_throttled

0x0 means no throttling. Any other value means your Pi is reducing clock speed. Check cooling and the power supply if you see a non-zero result.

Memory limits and swap

Headless Raspberry Pi OS 64-bit uses roughly 196MB of RAM at idle (Phoronix benchmarks). The OpenClaw gateway process adds to that, using roughly 100-200MB more at idle based on real-world testing. On a 1GB board, that doesn't leave much room for other processes.

Without swap, the Linux OOM killer will terminate the gateway when memory gets tight. That's the crash-and-restart scenario you want to avoid.

The 2GB swap file added during setup is the safety net. With swappiness at 10, the kernel keeps data in RAM as much as possible and only hits swap when truly necessary.

Additional tricks for low-RAM boards:

Free up roughly 48MB of RAM reserved for the GPU (useless on a headless server):

bash

echo 'gpu_mem=16' | sudo tee -a /boot/firmware/config.txt
sudo reboot

Disable services you don't need:

bash

sudo systemctl disable bluetooth
sudo systemctl disable avahi-daemon
sudo systemctl disable cups

Each disabled service frees a few MB. It adds up on a 1GB board.

OpenClaw Raspberry Pi power consumption and running costs

A Pi 4 draws roughly 2.9W at idle and up to 6.4W under sustained load, based on independent hardware testing. The Pi 5 draws about 2.7W at idle and up to 7W under stress, as measured against the official 27W power supply spec.

At $0.15/kWh (average US rate), running a Pi 4 24/7 costs about $0.40-$0.60 per month in electricity. The Pi 5 comes in around $0.50-$0.90 per month.

Compare that to the cheapest cloud VPS options, which typically run $4-12 per month. After the hardware pays for itself (12-18 months depending on the model you buy), the Pi is cheaper to operate.

One honest note: Raspberry Pi hardware prices are not stable right now. The February 2026 price increases were the second round in three months. The Pi Foundation has said prices should drop once the DRAM shortage eases, but "when" is uncertain.

OpenClaw Raspberry Pi limitations you should know

These aren't reasons to avoid the Pi. They're things to plan for.

Local LLM inference won't work. Even on a Pi 5 8GB, the hardware lacks enough compute to run a useful model at a reasonable speed. This is a straightforward hardware limitation: an ARM Cortex-A76 cluster cannot compete with dedicated GPU inference hardware. Use a cloud API instead.

WiFi is unreliable for 24/7 operation. Power management on the Pi's WiFi adapter causes connections to drop. The fix is simple:

bash

sudo iwconfig wlan0 power off

Add that to /etc/rc.local or a systemd service to make it persistent. Better yet, use Ethernet.

ARM binary issues with some skills. If a skill runs a native binary that doesn't have an ARM64 build, you'll see an "exec format error." Run uname -m to confirm you're on aarch64. Most modern tools have ARM64 builds, but older or less-maintained ones don't.

SD card wear is real. OpenClaw writes logs and session state. On an SD card, this causes wear over months. A USB SSD is more durable and faster. Budget $15-30 for a small SSD if you want this to run for a year or more.

Troubleshooting OpenClaw on Raspberry Pi

Out of memory / gateway keeps crashing: Check that swap is active with free -h. If swapfile shows 0, run the swap setup steps again. Disable unused services (Bluetooth, Avahi, CUPS).

Service won't start: Read the actual error first:

bash

journalctl -u openclaw --no-pager -n 100

Then run the built-in diagnostics:

bash

openclaw doctor --non-interactive

Performance is sluggish: Check for CPU throttling with vcgencmd get_throttled. If the result isn't 0x0, check your power supply and cooling. Also verify you're running from an SSD, not an SD card.

ARM binary error (exec format error): This means a tool or skill is trying to run an x86 binary. Check uname -m returns aarch64. If a specific skill is broken, check whether the skill's underlying tool has an ARM64 release.

WiFi disconnects: Run sudo iwconfig wlan0 power off and confirm the WiFi adapter stops dropping. Make this permanent by adding it to your boot sequence.

Node.js not found after install: The install script modifies PATH in your shell config. Run source ~/.bashrc or log out and back in.

Key terms

Gateway: The OpenClaw process that bridges your chat apps to the AI provider. It's the only thing running on the Pi. Inference happens in the cloud.

aarch64: The 64-bit ARM instruction set. This is what "64-bit Raspberry Pi OS" uses. OpenClaw's Node.js binaries require it.

Swap: Disk space used as overflow when RAM is full. Slower than RAM but prevents OOM crashes on low-memory boards.

systemd: Linux's service manager. OpenClaw's daemon integrates with it, so systemctl start/stop/restart openclaw works like any other Linux service.

NODE_COMPILE_CACHE: An environment variable that tells Node.js to cache compiled module bytecode. Dramatically reduces cold-start time on repeat invocations.

Headless: A Pi setup with no monitor, keyboard, or desktop environment. SSH-only. Raspberry Pi OS Lite is headless by default.

FAQ

Can OpenClaw run on a Raspberry Pi 4 with 1GB RAM?

Yes, but it requires a 2GB swap file and careful tuning. Configure swap with sudo fallocate -l 2G /swapfile and set swappiness to 10. Also free GPU memory with gpu_mem=16 in /boot/firmware/config.txt. Without these, the gateway process can be killed by the OOM killer under load. The official OpenClaw Pi docs recommend 2GB+ RAM, with 4GB preferred, so the 1GB option is workable but not the recommended path.

Can OpenClaw use local LLM models on Raspberry Pi?

Not practically. OpenClaw routes messages to a model provider via API and AI inference happens in the cloud. You can technically point it at a local Ollama endpoint, but Pi hardware doesn't have enough compute to run a useful model at a reasonable speed. API providers like OpenRouter work reliably and are the recommended path.

How do I access the OpenClaw dashboard from another device?

Use an SSH tunnel. On your laptop, run ssh -N -L 18789:127.0.0.1:18789 user@your-pi-hostname, then open http://127.0.0.1:18789 in your browser. For always-on remote access without a tunnel, install Tailscale on both the Pi and your device. The OpenClaw Tailscale integration at docs.openclaw.ai/gateway/tailscale explains the full setup.

Will 32-bit Raspberry Pi OS work with OpenClaw?

No. OpenClaw requires a 64-bit operating system. The 32-bit Raspberry Pi OS doesn't support the Node.js binaries that OpenClaw depends on. Always use Raspberry Pi OS Lite (64-bit) and verify with uname -m after booting, which should return aarch64. If you're upgrading an older Pi OS installation, it's cleanest to reflash rather than try to convert in place.

How much does it cost per month to run OpenClaw on a Raspberry Pi?

At typical US electricity rates ($0.15/kWh), a Pi 4 running 24/7 costs roughly $0.40-$0.60 per month in electricity. The Pi 5 costs slightly more, around $0.50-$0.90. Hardware cost amortization is separate. A Pi 4 2GB at $45 plus a small USB SSD ($20) pays for itself versus a $5/month VPS in about 13 months. Actual costs vary by region and electricity rates.

Changelog

  • 2026-10-26: Pointed the Telegram walkthrough link to the dedicated setup guide.

Sources: Pricing verified against official Raspberry Pi Foundation announcements from December 2025 and February 2026. Power draw figures from raspi.tv hardware benchmarks and the official Raspberry Pi 27W power supply page. OS memory baseline from Phoronix 64-bit OS review. Setup steps verified against docs.openclaw.ai/platforms/raspberry-pi.

DateChange
2026-03-23Initial publication
Did I get something wrong? Or have any other feedback? Let me know here.

More from Stack Junkie.

Get new articles by email.

More guides in The OpenClaw Handbook