Why Run OpenClaw on a Raspberry Pi?
A Raspberry Pi sitting on your desk can become a private, always-on AI assistant that you fully control. No cloud services, no monthly hosting fees, and no data leaving your home network unless you want it to. For privacy enthusiasts, tinkerers, and anyone who wants to learn about self-hosting, running OpenClaw on a Raspberry Pi is a rewarding project.
In this guide, we will walk through everything you need to get OpenClaw running on a Raspberry Pi, from hardware requirements to connecting your AI assistant to Telegram.
Hardware Requirements
Before you start, make sure you have the right hardware:
- Raspberry Pi 4 or 5 with at least 4 GB of RAM (8 GB recommended for better performance)
- MicroSD card — 32 GB or larger, Class 10 or better for reasonable read/write speeds
- Power supply — Official USB-C power supply recommended (5V, 3A for Pi 4; 5V, 5A for Pi 5)
- Stable internet connection — Ethernet preferred over WiFi for reliability
- Heat sink or case with cooling — OpenClaw with Docker will keep the CPU warm, especially during longer conversations
A Raspberry Pi 3 can technically run Docker and OpenClaw, but with only 1 GB of RAM on most models, you will quickly run into memory issues. The Pi 4 with 4 GB is the practical minimum.
Step 1: Install Raspberry Pi OS
Start with a fresh installation of Raspberry Pi OS (64-bit) using the official Raspberry Pi Imager:
- Download and install Raspberry Pi Imager on your computer
- Insert your microSD card and select Raspberry Pi OS (64-bit) as the operating system
- In the advanced settings, enable SSH, set your username and password, and configure WiFi if needed
- Write the image to the SD card and boot your Pi
- SSH into your Pi or connect a keyboard and monitor
Once booted, update your system:
Run: sudo apt update && sudo apt upgrade -y
Step 2: Install Docker
Docker is the easiest way to run OpenClaw on a Raspberry Pi. Install it with the official convenience script:
- Install Docker:
curl -fsSL https://get.docker.com | sh - Add your user to the Docker group:
sudo usermod -aG docker $USER - Log out and back in for the group change to take effect
- Verify installation:
docker --version
Docker on ARM64 (which the Pi 4 and 5 use) is well-supported, and the OpenClaw Docker image includes ARM64 builds.
Step 3: Create Your OpenClaw Configuration
Before starting the container, you need to create a configuration file. Create a directory for your OpenClaw data:
Run: mkdir -p ~/.openclaw && chmod 777 ~/.openclaw
Then create your configuration file at ~/.openclaw/openclaw.json. Your configuration should include:
- Gateway auth token — A random string that secures your OpenClaw gateway
- AI model provider — Your OpenRouter API key and preferred model
- Telegram bot token — From BotFather on Telegram
- Channel configuration — Telegram with dmPolicy set to pairing for security
The configuration file is a JSON document that defines how your AI assistant behaves, which model it uses, and which messaging platforms it connects to.
Step 4: Get Your Telegram Bot Token
If you do not already have a Telegram bot:
- Open Telegram and search for @BotFather
- Send the command
/newbot - Choose a name and username for your bot
- Copy the API token that BotFather provides
Add this token to your OpenClaw configuration under the Telegram channel settings.
Step 5: Start the OpenClaw Container
Pull the OpenClaw image and start your container:
Run: docker run -d --name openclaw --restart unless-stopped --memory=2g --memory-swap=3g -v ~/.openclaw:/home/node/.openclaw -p 18789:18789 ghcr.io/openclaw/openclaw:latest node openclaw.mjs gateway --allow-unconfigured
Key flags explained:
- --restart unless-stopped ensures the container starts automatically after a reboot
- --memory=2g --memory-swap=3g sets appropriate memory limits for the Pi
- -v ~/.openclaw:/home/node/.openclaw mounts your config directory into the container
- -p 18789:18789 exposes the gateway port for the web interface
Step 6: Verify Everything Is Working
Check that your container is running:
- Check container status:
docker ps— You should see your openclaw container running - Check logs:
docker logs openclaw --tail 50— Look for successful startup messages - Test on Telegram: Open your bot on Telegram and send a message. You should get a response within a few seconds.
Performance Expectations
Running OpenClaw on a Raspberry Pi works well for casual, personal use. Here is what to expect:
- Response time: The bottleneck is the AI model API, not the Pi. Responses typically arrive in 2 to 10 seconds, the same as any other host.
- Startup time: Initial container startup takes 60 to 120 seconds as the gateway initializes.
- Memory usage: OpenClaw uses about 300 to 500 MB of RAM during normal operation. With 4 GB on the Pi, you have plenty of headroom.
- Concurrent users: The Pi can handle a few simultaneous conversations without issues. It is not designed for heavy multi-user workloads.
- Long conversations: Extended conversations with large context windows may slow down slightly as the payload to the AI model grows.
Raspberry Pi vs. Managed Hosting
Self-hosting on a Pi is great for learning and privacy, but it comes with trade-offs. Here is an honest comparison:
- Cost: A Raspberry Pi 4 costs about $35 to $75 one-time, plus electricity (roughly $5 per year). Managed hosting on OpenClaw Launch starts at $3 per month.
- Setup: Self-hosting takes 30 to 60 minutes. Managed hosting takes under a minute.
- Maintenance: You handle updates, Docker, and troubleshooting on the Pi. Managed hosting is fully maintained.
- Reliability: A Pi depends on your home internet and power. Managed hosting runs in a professional data center with redundancy.
- Privacy: The Pi keeps everything on your local network. Managed hosting runs on a dedicated server that only you access.
Who Should Self-Host?
Self-hosting OpenClaw on a Raspberry Pi is ideal for:
- Privacy enthusiasts who want complete control over their data and infrastructure
- Tinkerers and hobbyists who enjoy setting up and maintaining systems
- Learners who want to understand Docker, networking, and self-hosting fundamentals
- Developers who want to experiment with OpenClaw configurations locally
It is less ideal for teams, heavy usage, or anyone who prefers a set-and-forget experience. For those cases, managed hosting is the better choice.
Next Steps
Once your OpenClaw instance is running on the Pi, you can:
- Add more messaging channels like Discord
- Enable skills like web search to give your AI internet access
- Set up a dynamic DNS service to access the gateway remotely
- Create a backup script for your configuration and conversation data
Your Raspberry Pi is now a private AI assistant that runs around the clock on your home network. Enjoy the satisfaction of knowing that every conversation stays under your roof.