How to Run a Persistent OpenClaw Gateway on a Raspberry Pi
I hate paying monthly fees for cloud servers. It feels wrong to pay $6 every month just to keep a simple bot or personal assistant alive. I usually end up with a pile of half-finished projects because I don’t want to deal with recurring costs or the hassle of managing a remote VPS.
I found that the best way to handle this is to use a Raspberry Pi. It stays on 24/7, sits on my desk, and costs almost nothing to run after the initial purchase. If you want a personal AI assistant or a home automation hub that doesn’t disappear when you close your laptop, this is the way to go.
What You’ll Need
Section titled “What You’ll Need”- Raspberry Pi 4 or 5 (2GB+ RAM recommended)
- MicroSD card (16GB+) or a USB SSD for better performance
- Power supply (official Pi PSU recommended)
- Network connection (Ethernet or WiFi)
- ~30 minutes of time
Quick Start
Section titled “Quick Start”This path gets you up and running in about five minutes once your hardware is ready.
1. Flash the OS
Section titled “1. Flash the OS”I recommend Raspberry Pi OS Lite (64-bit). You don’t need a desktop interface for a headless server.
- Open Raspberry Pi Imager.
- Choose Raspberry Pi OS Lite (64-bit).
- Click the gear icon to set your hostname to
gateway-host, enable SSH, and configure your WiFi. - Flash it to your SD card or USB drive, then boot your Pi.
2. Connect and Update
Section titled “2. Connect and Update”SSH into your Pi from your main computer:
ssh user@gateway-host# or use the IP addressssh user@192.168.x.xOnce you’re in, update the system and install the basics:
sudo apt update && sudo apt upgrade -ysudo apt install -y git curl build-essentialsudo timedatectl set-timezone America/Chicago # Use your actual timezone3. Install Node.js 22
Section titled “3. Install Node.js 22”OpenClaw needs Node.js. Use the NodeSource script to get version 22:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -sudo apt install -y nodejs4. Add Swap
Section titled “4. Add Swap”If you have 2GB of RAM or less, you need a swap file to prevent crashes.
sudo fallocate -l 2G /swapfilesudo chmod 600 /swapfilesudo mkswap /swapfilesudo swapon /swapfileecho '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstabecho 'vm.swappiness=10' | sudo tee -a /etc/sysctl.confsudo sysctl -p5. Install and Onboard
Section titled “5. Install and Onboard”Run the automated installer:
curl -fsSL https://openclaw.ai/install.sh | bashThen start the onboarding wizard to set up your gateway and channels:
openclaw onboard --install-daemonI suggest choosing “Local” mode and using Telegram for your first channel since it’s the easiest to configure on a Pi.
6. Access the Dashboard
Section titled “6. Access the Dashboard”Since the Pi is headless, you can view the dashboard by creating an SSH tunnel from your laptop:
# Run this on your laptop/desktopssh -L 18789:localhost:18789 user@gateway-hostNow you can open http://localhost:18789 in your browser.
Troubleshooting
Section titled “Troubleshooting”Out of Memory (OOM)
Section titled “Out of Memory (OOM)”If the app crashes, check your memory with free -h. You might need to add more swap or stop other services running on the Pi.
Slow Performance
Section titled “Slow Performance”If things feel sluggish, I recommend switching from an SD card to a USB SSD. You can also disable the GPU and Bluetooth to save resources:
# Disable GPU memoryecho 'gpu_mem=16' | sudo tee -a /boot/config.txt# Disable Bluetoothsudo systemctl disable bluetoothService Won’t Start
Section titled “Service Won’t Start”Check the logs to see what went wrong:
journalctl -u openclaw --no-pager -n 100If you used the “hackable” git install, try running npm run build again.
ARM Binary Issues
Section titled “ARM Binary Issues”If you see an “exec format error,” a skill might be trying to run a tool that isn’t built for ARM64. You can try building that specific tool from source or look for an ARM64 version.
WiFi Drops
Section titled “WiFi Drops”For a headless Pi, WiFi power management can sometimes cause drops. You can turn it off with:
sudo iwconfig wlan0 power offIf you hit a wall or need help with a specific hardware error, check out the AI Setup Assistant.
What’s Next
Section titled “What’s Next”- Linux guide — General Linux setup tips
- DigitalOcean guide — If you decide you want the cloud after all
- Tailscale — For secure remote access without SSH tunnels
- Nodes — How to connect your other devices to this Pi gateway
OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.