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
- Raspberry Pi 4B (8GB recommended, 4GB minimum)
- USB-C power supply (official 3A recommended)
- 32GB+ microSD card (Class 10 / A2)
- Ethernet cable (more reliable than WiFi for 24/7)
- Case with heatsinks (passive cooling is fine for agent workloads)
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
- Tailscale — Zero-config VPN. Easiest option for personal use.
- Cloudflare Tunnels — Free, no inbound ports needed.
- Tailscale + Caddy reverse proxy — For HTTPS + custom domain.
Cost Breakdown
- Hardware (one-time): ~S$120 (Pi 4B 8GB + accessories)
- Power: ~S$3/month (5W continuous)
- LLM API (Ollama Cloud): ~S$22-57/month
- Total: S$25-60/month — no per-seat SaaS fees