Blogs

Raspberry Pi OpenClaw: Install a Self-Hosted AI Gateway | ShillehTek

Project Overview

Raspberry Pi + OpenClaw: In this guide, you will install OpenClaw, a self-hosted AI assistant gateway, on a Raspberry Pi so you can message an AI agent from WhatsApp or Telegram.

You will use Raspberry Pi Imager to flash the SD card, configure SSH and Wi-Fi before first boot, then install Node.js, OpenClaw, and set up the gateway as a systemd service so it runs automatically.

  • Time: 30 to 45 minutes
  • Skill level: Beginner to Intermediate
  • What you will build: A Raspberry Pi running OpenClaw 24/7, ready to pair with WhatsApp or Telegram

Parts List

From ShillehTek

  • None required for this software-only install (hardware can be sourced anywhere).

External

  • Raspberry Pi 4 or 5 (4GB RAM recommended; 8GB for heavier use)
  • MicroSD card (32GB or larger, Class 10 or better)
  • Power supply for the Pi
  • Ethernet cable or Wi-Fi connection
  • Computer with an SD card reader (for flashing)
  • Raspberry Pi Imager - free, official imaging tool
  • Node.js 24 (installed via nvm in this guide)
  • API key from OpenAI, Anthropic, or another supported provider
  • WhatsApp or Telegram account (for pairing)

Note: OpenClaw is open source and self-hosted. Your data stays on your Pi. You pay only for the AI model API (for example, OpenAI) based on usage.

Step-by-Step Guide

Step 1 - Download and install Raspberry Pi Imager

Goal: Get the official tool that flashes Raspberry Pi OS onto your SD card.

What to do: Go to raspberrypi.com/software and download Raspberry Pi Imager for your computer (Windows, macOS, or Linux). Install it and open the application.

Expected result: Raspberry Pi Imager is running and ready to write an image to your SD card.

Step 2 - Choose the OS and configure before flashing

Goal: Select Raspberry Pi OS and preconfigure SSH, Wi-Fi, and locale so you can headlessly connect after first boot.

What to do:

  1. Click Choose OS and select Raspberry Pi OS (64-bit), the recommended desktop image, or Raspberry Pi OS Lite if you prefer a minimal install (no desktop).
  2. Click Choose Storage and select your microSD card.
  3. Click the gear icon (or press Ctrl+Shift+X) to open Advanced Options.
  4. Enable Set hostname, for example openclaw-pi.
  5. Enable Enable SSH and choose Use password authentication. Set a username (for example pi) and password.
  6. If using Wi-Fi: Enable Configure WiFi, enter your SSID and password, and select your country.
  7. Enable Set locale settings (timezone, keyboard layout) if needed.
  8. Click Save, then Yes to apply the options.

Expected result: When you click Next and confirm, Imager will write the image and apply your settings. Eject the SD card when done.

Step 3 - First boot and SSH into the Pi

Goal: Connect to your Pi over the network.

What to do: Insert the SD card into the Pi, connect power and Ethernet (or rely on Wi-Fi if configured). Wait 1 to 2 minutes for the first boot, then SSH in from your computer:

ssh pi@openclaw-pi.local

Or use the Pi's IP address if .local does not resolve:

ssh pi@192.168.1.100

Enter the password you set in Step 2.

Expected result: You're at a terminal prompt on the Pi.

Step 4 - Install nvm and Node.js

Goal: Install Node.js 24 via nvm (Node Version Manager) so OpenClaw has the correct runtime.

What to do: Run these commands on the Pi:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc   # or restart the terminal
nvm install 24
nvm use 24
node -v            # should show v24.x.x

Expected result: node -v reports Node 24. You're ready to install OpenClaw.

Step 5 - Install OpenClaw globally

Goal: Install the OpenClaw CLI so you can run openclaw commands.

What to do:

npm install -g openclaw@latest

Verify the install:

openclaw --version

Expected result: OpenClaw is installed (for example, version 2026.3.x or newer).

Step 6 - Run the onboarding wizard and install the service

Goal: Configure OpenClaw, set up the gateway, and install it as a systemd user service so it runs automatically.

What to do: Run the interactive onboarding:

openclaw onboard --install-daemon

The wizard will:

  • Ask you to choose an AI provider (OpenAI, Anthropic, Ollama, etc.)
  • Prompt for your API key
  • Offer to connect a channel (WhatsApp, Telegram)
  • Install a systemd user service so the gateway starts on boot

For WhatsApp or Telegram, you will need to scan a QR code. Use a phone or a browser to complete pairing.

Expected result: The gateway service is running. You can check with:

systemctl --user status openclaw-gateway

You should see active (running).

Step 7 - Verify the gateway and chat

Goal: Confirm OpenClaw is reachable and responding.

What to do: Open WhatsApp or Telegram (depending on what you paired) and send a message to your OpenClaw bot. You should get a response from the AI.

You can also open the web dashboard locally on the Pi (if you have a desktop) or via SSH port forwarding:

openclaw dashboard

Or from your Mac, forward the port:

ssh -L 18789:127.0.0.1:18789 pi@openclaw-pi.local

Then visit http://127.0.0.1:18789 in your browser.

Expected result: You can chat with your AI assistant from your phone or the dashboard.

Step 8 - Optional: enable remote access

Goal: Access OpenClaw from outside your home network (for example, via Tailscale or an SSH tunnel).

What to do: The gateway listens on 127.0.0.1 by default, so it is not exposed to the internet. For remote access:

  • Tailscale: Install Tailscale on the Pi and your phone; the Pi gets a tailnet IP. Use openclaw configure to enable Tailscale mode.
  • SSH tunnel: From your laptop, run ssh -L 18789:127.0.0.1:18789 pi@openclaw-pi.local and use the dashboard at localhost:18789.

See OpenClaw Tailscale docs for details.

Expected result: You can reach OpenClaw from anywhere on your tailnet or through a secure tunnel.

Step 9 - Useful management commands

Goal: Start, stop, and validate your OpenClaw gateway after setup.

What to do: Run these commands on the Pi as needed:

systemctl --user start openclaw-gateway
systemctl --user stop openclaw-gateway
systemctl --user restart openclaw-gateway
openclaw doctor
openclaw cron list

Expected result: You can control the gateway service and run basic diagnostics.

Conclusion

You now have OpenClaw running on a Raspberry Pi, giving you a self-hosted AI assistant gateway you can message from WhatsApp or Telegram. The gateway runs 24/7 and stays on your hardware.

Want the exact parts used in your next Raspberry Pi build? Grab what you need from ShillehTek.com. If you want help customizing this setup or building a production-ready automation for your product, check out our IoT consulting services.