< Back to list of posts

Running My Own AI Assistant on a Raspberry Pi 5 with OpenClaw

I have been wanting to run a personal AI assistant that I actually control for a while now. Not something locked behind a browser tab that disappears when I close my laptop, but something always on, always available, running on my own hardware. When I came across OpenClaw, an open source AI assistant framework created by Peter Steinberger, it checked every box. It runs locally, connects to messaging platforms like WhatsApp and Telegram, and can actually execute tasks on the machine it lives on. The Raspberry Pi 5 felt like the perfect home for it. Low power, always on, and cheap enough that I would not stress about dedicating it entirely to this purpose.

In this post I will walk through exactly how I set the whole thing up from scratch, from imaging the SD card to running the OpenClaw gateway.

What You Need

Before getting started, here is the hardware I used:

Raspberry Pi 5 (8GB RAM) which you can pick up on Amazon here.

I went with the 8GB model because RAM on the Pi cannot be upgraded later and OpenClaw benefits from the extra headroom, especially when controlling a headless browser or running multiple integrations. You will also want a USB-C power supply (the official Raspberry Pi one works great), a microSD card (32GB minimum, I used 64GB), and an ethernet cable or WiFi credentials for your network.

Flashing the Image with Raspberry Pi Imager

The first step is getting an operating system onto the microSD card. I used the Raspberry Pi Imager which you can download on your Mac or Windows machine.

Once installed, open the Imager and follow these steps:

  1. Click "Choose Device" and select Raspberry Pi 5
  2. Click "Choose OS" and select Raspberry Pi OS Lite (64-bit) under "Raspberry Pi OS (other)". I went with Lite because we do not need a desktop environment. No GUI means more RAM available for OpenClaw
  3. Click "Choose Storage" and select your microSD card
  4. Before writing, click the gear icon (or "Edit Settings") to preconfigure some important things

In the settings screen I configured the following:

  • Set a hostname (for example yourhostname)
  • Enabled SSH with password authentication
  • Set a username and password
  • Configured WiFi network name and password
  • Set the locale and timezone

This preconfiguration step saves a lot of headaches. Without it you would need to plug in a monitor and keyboard to do the initial setup. With these settings baked into the image, the Pi boots up ready to go and you can SSH right in.

Click "Write" and wait for the Imager to flash and verify the image. This takes about 5 to 8 minutes depending on your SD card speed.

Once done, eject the card, pop it into the Pi, plug in power and ethernet (or just power if you configured WiFi), and give it a minute to boot.

First Boot and SSH

Find your Pi on the network. You can check your router's DHCP client list or just try:

ssh piname@yourhostname.local

If that does not resolve, find the IP from your router and use it directly:

ssh piname@192.xxx.x.xxx

Once you are in, the first thing I did was update everything:

sudo apt update && sudo apt upgrade -y

I also fixed my locale settings because I was getting some warnings in the terminal:

sudo locale-gen en_US.UTF-8 sudo update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 sudo dpkg-reconfigure locales sudo reboot

Connecting to WiFi (If You Did Not Preconfigure It)

If you need to connect to a different WiFi network after the initial setup, you can use nmcli which comes with the newer Raspberry Pi OS:

sudo nmcli device wifi list sudo nmcli device wifi connect "YourNetworkName" password 'YourPassword'

You can verify the connection with:

nmcli connection show

Installing OpenClaw

This is where it gets fun. OpenClaw needs Node.js to run, so let us get that set up first. The version that ships with Raspberry Pi OS is usually too old, so I installed it from the package manager and supplemented with additional tooling:

sudo apt update sudo apt install -y nodejs npm git jq ripgrep curl wget build-essential

I also installed Chromium for browser automation capabilities that OpenClaw can use:

sudo apt-get install -y chromium

Now for OpenClaw itself. The easiest path is the one-line installer from the OpenClaw website:

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

After the installer runs, you need to configure it:

openclaw configure

One thing I ran into was a path issue. The default config referenced /home/node as the workspace directory, which does not exist on a standard Pi setup. I fixed this by editing the config file:

cat ~/.openclaw/openclaw.json | grep workspace sed -i 's|/home/node/.openclaw/workspace|/home/piname/.openclaw/workspace|g' ~/.openclaw/openclaw.json mkdir -p ~/.openclaw/workspace

Running the Onboarding Wizard

OpenClaw ships with an onboarding process that walks you through connecting your LLM provider, setting up messaging channels, and configuring skills. I cloned the repo to have access to the scripts directly:

git clone https://github.com/openclaw/openclaw cd openclaw

Then ran the onboarding:

node scripts/run-node.mjs onboard

The onboard script asks you to choose your LLM provider (Claude, GPT, etc.), set up your API keys, and configure which messaging channels you want to use. I connected Telegram first since the setup is straightforward: you create a bot through BotFather on Telegram, grab the token, and plug it in.

Starting the Gateway

Once configuration is done, start the gateway:

node scripts/run-node.mjs gateway

The gateway runs on port 18789 by default. If you want to access the dashboard from another machine on your network, you can SSH tunnel into it:

ssh -L 18789:127.0.0.1:18789 piname@192.xxx.x.xxx

Then open http://127.0.0.1:18789 in your browser on your main machine.

What I Learned Along the Way

I will be the first to admit this was not a perfectly clean install. My terminal history tells the story. I initially tried to run OpenClaw through Docker, got it partially working, then decided to rip it all out and go with a bare metal install instead. If you look at my command history you will see the full Docker installation and removal cycle:

curl -sSL https://get.docker.com | sh sudo usermod -aG docker $USER # ... tried docker compose, things did not work as expected ... sudo apt remove --purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo rm -rf /var/lib/docker sudo rm -rf /var/lib/containerd

I also installed Bun and tried multiple ways to start the project before landing on the node scripts/run-node.mjs approach:

curl -fsSL https://bun.sh/install | bash bun install bun start # did not work as expected pnpm start # also tried this

The lesson here is that the installer script (curl -fsSL https://openclaw.bot/install.sh | bash) combined with the onboard wizard is the cleanest path. I complicated things by trying to run from source and through Docker before settling on the recommended approach.

Security Note

This is important and I want to call it out specifically. OpenClaw has shell access to your Pi. That means it can run commands, read files, and interact with anything on the machine. This is what makes it powerful but it is also what makes it risky if you are not careful. Running it on a dedicated Raspberry Pi rather than your main computer is a smart move for exactly this reason. The Pi acts as a sandbox. If something goes sideways, it is an isolated device and not your primary workstation.

Do not expose port 18789 directly to the internet without authentication. Use Tailscale or Cloudflare Tunnels if you need remote access.

Conclusion

Having an AI assistant that runs 24/7 on a $60 device in my office, that I can message from my phone and have it actually do things on my behalf, feels like a shift in how I interact with AI. It is not a chat window I visit when I have a question. It is closer to a coworker who is always available. The Raspberry Pi 5 handles it without breaking a sweat since most of the heavy compute happens on the LLM provider side. The Pi is really just orchestrating.

If you have a Pi sitting in a drawer collecting dust, this is a great use for it.

Buy Me A Coffee