I have been fascinated by the idea of having a personal AI assistant that I fully control. While cloud-based solutions are convenient, there’s something appealing about running your own AI assistant on hardware you own. With this idea, I co-authored a book - “Building a Virtual Assistant for Raspberry Pi”. I started writing the book in early 2025, and the book was published in the month of September, the that year.
AI moves fast. Really, fast. There are new models coming every other week, new AI apps, and new patterns to build AI agents.
Fast forward to January of 2026, OpenClaw (formerly Moltbot/Clawdbot), an open-source personal AI assistant, took over the internet. It promised a local-first approach to running AI assistants, with support for channels, skills, and multiple AI models. It feels closer to agentic systems!
As a tinkerer myself, I wanted to try it out, and I knew my Raspberry Pi 4 would finally get a worthy purpose.
In this tutorial, I will guide you through setting up OpenClaw on a Raspberry Pi 4. By the end, you’ll have an always-on AI assistant accessible from any device on your local network. In the next part of the blog, I will cover exposing it to the internet securely using Cloudflare Tunnels and Workers VPC.
What is OpenClaw?
OpenClaw is an open-source personal AI assistant that you run on your own devices. Unlike cloud-based assistants, OpenClaw gives you full control over your data and how your assistant operates. It supports multiple AI models (Anthropic Claude, OpenAI GPT) and can connect to various messaging channels like WhatsApp, Telegram, Discord, and more.
The key features that make OpenClaw interesting:
- Local-first Gateway: A control plane that runs on your hardware. The AI inferecence still uses your configured provider.
- Multi-channel support: Chat via WebChat, WhatsApp, Telegram, Slack, Discord, and more
- Extensible: Skills and tools to extend functionality
Running OpenClaw on a Raspberry Pi makes sense for several reasons. The Pi consumes very little power (around 3-5W idle), making it perfect for an always-on setup. It’s cost-effective, and it doesn’t tie up your personal computer, so you can keep your main machine free for other tasks and prevent any potential security risks.
Prerequisites
Before you begin, ensure you have the following:
- A Raspberry Pi 4 (I recommend the 4GB RAM model or higher)
- A microSD card (32GB or larger recommended. My Pi is attached to an external HDD for storage. It is not required)
- Raspberry Pi Imager installed on your computer
- An Anthropic API key or OpenAI API key (for the AI model)
Note: OpenClaw requires Node.js 22 or higher.
Connecting to Your Raspberry Pi
If you already have Raspberry Pi OS installed and can SSH into your Pi, you can continue. But if not, follow the steps in the “Installing Raspberry Pi OS” section of the Self-Hosting n8n on a Raspberry Pi with Cloudflare Tunnels blog.
After the Pi boots up (give it a minute or two), connect to it via SSH:
ssh username@openclaw-pi.localReplace username with the username you configured. If the hostname doesn’t resolve, you may need to find your Pi’s IP address from your router’s admin panel and connect using:
ssh username@192.168.x.xInstalling Node.js 22
OpenClaw requires Node.js version 22 or higher. The version in Raspberry Pi OS repositories is typically outdated, so we’ll install it using NodeSource.
- Update your system packages:
sudo apt update && sudo apt upgrade -y- Install Node.js 22 using the NodeSource setup script:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -sudo apt install -y nodejs- Verify the installation:
node --versionYou should see v22.x.x or higher.
Installing OpenClaw
With Node.js installed, you can now install the OpenClaw CLI. I tried installing it globally using npm, but it didn’t work correctly. Hence, I used the following CURL command to install:
curl -fsSL https://openclaw.ai/install.sh | bashVerify the installation:
openclaw --versionRunning the Onboarding Wizard
OpenClaw comes with an onboarding wizard that walks you through the initial setup. This is the recommended way to configure your assistant.
openclaw onboard --install-daemonThe wizard will guide you through several configuration steps. There you can either select the Quick Start option, or select the Advanced option to customize your setup. I selected the Advanced option for more control. But for most users, Quick Start is sufficient.
1. Gateway Type
Select Local when asked about gateway type. This runs the Gateway directly on your Raspberry Pi.
Gateway is the control plane that manages your assistant. It is a WebSocket server that connects the channels, nodes, sessions, etc.
If you already have a Gateway running elsewhere, you can connect to it by selecting Remote type. Since you are running everything on the Pi, you select Local.
2. Authentication
You’ll need to configure how OpenClaw authenticates with AI providers. For a headless Raspberry Pi setup, I recommend using an API key rather than OAuth (which requires a browser).
When prompted, select your preferred provider:
- Anthropic (recommended): Paste your Anthropic API key
- OpenAI: Paste your OpenAI API key
I have been trying out the MiniMax M2.1 model, and it works great. Hence, I selected minimax.io as my provider and pasted the API key.
Note: Keep your API keys secure. Never share them publicly or commit them to version control.
3. Channels
For this tutorial, we’ll use the built-in WebChat. You can skip channel configuration for now and add WhatsApp, Telegram, or other channels later.
4. Daemon Installation
When asked about installing the daemon, select Yes. This installs OpenClaw as a systemd service that starts automatically when your Pi boots.
Verifying the Installation
After the onboarding wizard completes, verify that everything is working:
- Check the Gateway status:
openclaw gateway statusYou should see that the Gateway is running.
- Run the health check:
openclaw healthThis checks connectivity to your configured AI provider.
- Run the doctor command to check for any issues:
openclaw doctorIf the doctor reports any issues, follow the suggestions to resolve them.
Accessing the Control UI
The OpenClaw Gateway serves a Control UI interface that you can access from any device on your local network.
- Find your Raspberry Pi’s IP address:
hostname -INote the first IP address (e.g., 192.168.1.100).
- Open a browser on any device connected to your local network and navigate to:
http://192.168.1.100:18789Or if mDNS is working on your network:
http://openclaw-pi.local:18789You should see the OpenClaw Control UI. If you see an error, you might need to enable the Control UI in your configuration file.
Authenticating with the Gateway
If you configured a Gateway token during onboarding (recommended for security), you’ll need to enter it:
- Click on Overview in the Control UI
- Paste your Gateway token
- The connection status should change to “Connected”
If you don’t remember your token, you can find it in your configuration:
cat ~/.openclaw/openclaw.json | grep tokenStarting a Conversation
Once connected, you can start chatting with your AI assistant directly in the browser. Type a message and press Enter. The assistant will respond using the AI model you configured.
Managing the OpenClaw Service
Since we installed OpenClaw as a systemd service, it will start automatically when your Raspberry Pi boots. Here are some useful commands for managing the service:
Check the service status:
systemctl --user status openclaw-gatewayRestart the service:
systemctl --user restart openclaw-gatewayStop the service:
systemctl --user stop openclaw-gatewayConfiguration Tips for Raspberry Pi
Here are some configuration tweaks I found helpful when running OpenClaw on a Raspberry Pi:
Binding to All Interfaces
By default, OpenClaw may bind only to localhost. To access it from other devices on your network, ensure your configuration allows LAN access. Check your ~/.openclaw/openclaw.json:
{ "gateway": { "bind": "lan" }}Note: When binding to LAN, ensure you have proper authentication (Gateway token) enabled for security.
After changing the configuration, restart the service:
systemctl --user restart openclaw-gatewayWhat’s Next?
You now have a fully functional personal AI assistant running on your Raspberry Pi. Here are some ideas for extending your setup:
- Add messaging channels: Configure WhatsApp or Telegram to chat with your assistant from your phone. See the OpenClaw channels documentation.
- Explore skills: OpenClaw supports skills that extend its capabilities. Check out ClawHub for available skills.
Conclusion
You have successfully set up OpenClaw on your Raspberry Pi as an always-on personal AI assistant. The setup is local-first, privacy-respecting, and accessible from any device on your network. The best part? Your Raspberry Pi sips power while providing you with a capable AI assistant 24/7. In the next part of this blog, I will cover how to expose your OpenClaw assistant to the internet securely using Cloudflare Tunnels and Workers VPC.
I’m excited to continue exploring what’s possible with this setup. If you run into any issues or have questions, feel free to reach out on LinkedIn or X (Twitter).