Summary: A complete guide to turning a Raspberry Pi 4B into a 24/7 AI agent host. We cover hardware selection, OS installation, security hardening, Ollama + OpenClaw deployment, and remote access. By the end, you'll have a personal AI computer that runs for months on a few watts of power.

Why a Raspberry Pi?

The Raspberry Pi 4B is the sweet spot for a personal AI agent host: 7.6GB RAM, low power consumption (~5W), passive cooling possible, and cheap enough to dedicate entirely to your agent. It runs 24/7 without spinning fans or expensive electricity bills.

Hardware Shopping List

Step 1: Flash the OS

Download Raspberry Pi OS 64-bit and flash it with the Raspberry Pi Imager. Enable SSH during setup.

# On your laptop, flash the SD card
# Enable SSH, set hostname, configure WiFi in imager settings

# First boot — find your Pi on the network
ping your-pi-hostname.local

# SSH in
ssh steve@your-pi-hostname.local

Step 2: Update & Install Prerequisites

sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl python3 nodejs npm

# Install Node 24+ (via nvm)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
nvm install 24

Step 3: Install Ollama

curl -fsSL https://ollama.com/install.sh | sh
ollama --version

Step 4: Install OpenClaw

npm install -g openclaw
openclaw init
openclaw gateway start

Step 5: Security Hardening

# Disable password auth, use keys only
sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
sudo systemctl restart sshd

# Firewall
sudo ufw allow ssh
sudo ufw allow 18789
sudo ufw enable

# Secure workspace
chmod 700 ~/.openclaw
chmod 600 ~/.openclaw/config/*

Step 6: Set Up as a Systemd Service

Make OpenClaw start automatically on boot:

openclaw gateway install-service

Step 7: Remote Access Options

Cost Breakdown

Digital Futures Consultancy

Singapore-based AI-native consultancy. We build production-grade AI systems for SMEs. digitalfutures.asia

← Back to Insights