How to Flash Raspberry Pi OS for OpenClaw with Raspberry Pi Imager
Raspberry Pi shipped 7.6 million boards in fiscal year 2025, and OpenClaw turns any of them into a 24/7 AI agent gateway that costs under $1/month to run. This guide walks through Raspberry Pi Imager v2.0.8's advanced settings to pre-configure SSH, WiFi, and hostname so you can go from a blank storage device to a running OpenClaw agent without ever plugging in a monitor.
Why Pre-Boot Configuration Matters for OpenClaw Deployments
Raspberry Pi shipped 7.6 million boards in fiscal year 2025, up 9% over the prior year (Raspberry Pi Holdings FY2025 Annual Report). A growing share of those boards run headless, operating without a monitor or keyboard, managed entirely over the network. For OpenClaw agent deployments, headless is the default. Your Pi sits on a shelf or tucked behind a router, running 24/7 as an AI gateway that manages tool calls, messaging integrations, and workflow automation.
Raspberry Pi Imager is the official utility for flashing operating system images to SD cards and USB drives. Starting with version 2.0, it includes a built-in customization screen that lets you pre-configure SSH access, WiFi credentials, hostname, and user accounts before writing the image. This eliminates the old workflow of flashing a generic image, connecting a monitor and keyboard to run first-boot setup, then disconnecting everything and switching to SSH.
For OpenClaw, this matters because the agent does not need a desktop environment. You flash Pi OS Lite (the terminal-only variant), set your network credentials in Imager, write the image, plug in the Pi, and SSH in. The entire process from download to a running agent takes about 15 minutes, and you never touch an HDMI cable.
A Raspberry Pi 5 running an OpenClaw gateway draws roughly 3W at idle and 5 to 7W under load. At US average electricity prices, that works out to about $0.50/month. The Pi does not run large language models locally. It acts as an orchestration layer, routing requests to cloud APIs like Anthropic or OpenAI while handling tool execution, scheduling, and integrations on the device.
Download and Install Raspberry Pi Imager
Raspberry Pi Imager v2.0.8 is the current stable release as of April 2026. Download it from raspberrypi.com/software for your operating system.
Windows:
Download and run the .exe installer. It adds Imager to your Start menu and desktop.
macOS:
Download the .dmg file, drag Raspberry Pi Imager to your Applications folder, and launch it from Launchpad or Spotlight.
Linux:
Download the AppImage from the Raspberry Pi website, mark it executable with chmod +x, and run it directly. On Raspberry Pi OS itself, you can also install via terminal:
sudo apt install rpi-imager
After launching, the interface presents three choices in sequence: Device, Operating System, and Storage. Pick your Pi model first, which filters the OS list to compatible images. Then select the OS. Finally, choose the target drive (your SD card or USB SSD).
The v2.0 rewrite brought a cleaner interface, faster download and write speeds, and improved device detection. Version 2.0.8 specifically added better USB handling and a write watchdog that avoids false stalls on slower SD cards, which is relevant if you are flashing to a budget microSD rather than an SSD.
What OS Should You Flash for OpenClaw on Raspberry Pi?
When Imager asks you to choose an operating system, navigate to Raspberry Pi OS (other) and select Raspberry Pi OS Lite (64-bit). This is the bookworm-based release without a desktop environment.
Three reasons this specific image is the right choice for OpenClaw:
64-bit is required. OpenClaw does not support 32-bit operating systems. The installer will fail on a 32-bit image. Pi OS Lite 64-bit runs on Pi 4 (all RAM variants) and Pi 5.
Lite saves RAM. The desktop version of Pi OS loads a full graphical environment that consumes roughly 600 MB of RAM on boot. Since your Pi will run headless, those resources are wasted. On a 4 GB Pi 5, reclaiming that memory gives OpenClaw more room for concurrent tool calls and Node.js processes.
OpenClaw's official docs recommend it. The Raspberry Pi installation guide at docs.openclaw.ai lists Raspberry Pi OS Lite 64-bit as the supported image flashed via Imager. Minimum hardware requirements are 1 GB RAM and 500 MB free disk, but the docs recommend 2 GB or more of RAM and a large storage device for practical deployments.
If you already have a Pi running the desktop variant, OpenClaw will still install and function. But for new deployments, starting with Lite avoids carrying unnecessary packages and reduces the attack surface of a device that will run network-accessible agent services.
How to Configure Imager Settings for a Headless OpenClaw Agent
After selecting your OS and storage device, click Next. Imager prompts you to apply OS customization. Select Edit Settings to open the configuration panel. On older versions, you can also reach this screen with Ctrl+Shift+X (Cmd+Shift+X on macOS).
Hostname Set a hostname like openclaw-gateway or agent-pi. This becomes the device's network name, accessible at openclaw-gateway.local from other devices on the same LAN. Pick something descriptive, especially if you plan to run multiple Pis for different agent tasks.
User Credentials Create a username and strong password. Raspberry Pi OS no longer ships with a default pi user for security reasons, so you must set credentials here. This is the account you will SSH into and use to install OpenClaw.
WiFi Configuration Enter your network's SSID and password. Select your country code under "Wireless LAN country" so the Pi uses the correct radio channels for your region. If you are using Ethernet, you can skip this, but configuring WiFi as a backup is useful if you later move the Pi to a different room or want a fallback connection.
Enable SSH
Toggle SSH on and choose password authentication. If you have a public key configured on your workstation, you can paste it here for key-based auth instead. SSH is the only way you interact with a headless Pi, so this setting is non-negotiable. Without it, you would need to physically connect a monitor and keyboard after first boot just to enable remote access.
Locale Settings Set your timezone and keyboard layout. The timezone affects OpenClaw's scheduled automations and log timestamps. Getting this right at flash time avoids debugging timezone-related issues in cron jobs or gateway logs later.
These five settings together mean the Pi will boot, join your network, and accept SSH connections on its first power-on. No monitor, no keyboard, no manual first-boot wizard.
Give your OpenClaw agent persistent cloud storage
50 GB free workspace with MCP access, built-in RAG, and ownership transfer. No credit card, no expiration.
Flash, Boot, and Install OpenClaw
Choose Your Storage Device
SD cards work for quick tests, but a USB SSD or NVMe drive on the official Raspberry Pi M.2 HAT is a better choice for anything beyond experimentation. OpenClaw's gateway writes frequently to a SQLite database, and SD cards degrade under sustained small writes. A budget NVMe drive on the M.2 HAT costs under $30 and eliminates the single biggest reliability concern for long-running Pi deployments.
Insert your SD card or connect your SSD, select it in Imager, and click Write. Imager downloads the image (if not cached locally), writes it to the device, and verifies the data. The process takes 3 to 10 minutes depending on your internet speed and the write performance of your storage device.
First Boot and SSH Connection Remove the storage device from your computer, install it in your Pi, and power on. Wait about 60 seconds for the first boot to finish. Then connect from your workstation:
ssh youruser@openclaw-gateway.local
Replace youruser with the username you configured in Imager. If .local resolution does not work on your network, find the Pi's IP address from your router's admin panel and connect directly to that.
Update and Install OpenClaw
Once connected over SSH, update the system and run the OpenClaw installer:
sudo apt update && sudo apt upgrade -y
curl -fsSL https://openclaw.ai/install.sh | bash
The installer handles Node.js 22+ and other dependencies automatically. After it finishes, run the onboarding wizard to configure the daemon for headless operation:
openclaw onboard --install-daemon
The wizard asks you to choose a model provider and enter an API key. The official docs recommend anthropic/claude-sonnet-4-6 as the primary model and openai/gpt-5.4-mini as a fallback. The Pi only handles gateway orchestration, so all inference runs in the cloud.
Verify the Service
Confirm the daemon is running:
systemctl --user status openclaw-gateway.service
You should see "active (running)" in the output. The daemon starts automatically on boot, so your agent survives power cycles and network interruptions without manual restarts.
Optimize for Pi Hardware Three optional tweaks from the OpenClaw docs improve performance on constrained hardware:
Reduce GPU memory. Add
gpu_mem=16to/boot/firmware/config.txtto free RAM. A headless Pi does not need GPU allocation.Enable compile caching. Set
NODE_COMPILE_CACHE=/var/tmp/openclaw-compile-cachein your shell profile or systemd service file to speed up Node.js startup times.Disable unused services. Turn off Bluetooth with
sudo systemctl disable bluetoothand disable the CUPS print service if it is running. Every freed megabyte of RAM helps on 4 GB boards running multiple concurrent tool calls.
Store Agent Output in a Persistent Workspace
An OpenClaw agent running on a Pi generates files, logs, and structured data that need to outlast the current session. Local storage on the Pi is the simplest option, but it comes with real downsides: SD cards fail, SSDs fill up, and nothing is accessible to collaborators without additional file sharing setup.
Cloud storage like S3 or Google Drive solves the durability problem but adds complexity. You need API credentials, sync logic, and a separate mechanism for sharing outputs with team members or clients.
Fast.io offers a workspace where your OpenClaw agent writes files via MCP or REST API, and humans access the same content through a browser. The free plan includes 50 GB of storage, 5,000 credits per month, and 5 workspaces with no credit card and no expiration. Once files land in a workspace, they are automatically indexed for semantic search and AI chat through Intelligence Mode, so teammates can ask questions about agent-generated reports without downloading anything.
The practical workflow: OpenClaw runs a scheduled task on your Pi, generates a report or dataset, and uploads it to a Fast.io workspace. A colleague opens the workspace, finds the file already indexed, and queries it through the built-in RAG layer. No downloads, no email threads, no "where did the agent save that" messages in Slack.
When the agent's work is complete, you can transfer ownership of the workspace to a client or team lead. The agent retains admin access for future runs, but the human recipient owns the output. This separation between maker and owner is useful for consultants, agencies, and anyone building automations on behalf of someone else.
Fast.io exposes its workspace operations through a MCP server with Streamable HTTP at /mcp. Your OpenClaw agent can create workspaces, upload files, set permissions, and trigger Intelligence features without leaving the MCP protocol it already uses for other tool calls. Setup details are in the MCP skill docs.
Frequently Asked Questions
How do I use Raspberry Pi Imager to set up a headless Pi?
Download Raspberry Pi Imager from raspberrypi.com/software, select your Pi model and OS (Pi OS Lite 64-bit for headless), then click Next and choose Edit Settings. Configure a hostname, create a user account, enter your WiFi credentials, and enable SSH. Flash the image to your storage device and power on the Pi. It joins your network and accepts SSH connections on its first boot without a monitor or keyboard.
What OS should I flash for OpenClaw on Raspberry Pi?
Raspberry Pi OS Lite 64-bit, based on Debian bookworm or later. The 64-bit variant is required because OpenClaw does not support 32-bit. The Lite edition omits the desktop environment, which frees roughly 600 MB of RAM for agent workloads. This is the specific image recommended in OpenClaw's official Raspberry Pi installation documentation.
Can I pre-configure WiFi and SSH in Raspberry Pi Imager?
Yes. After selecting your OS and storage device in Imager, click Next and choose Edit Settings. The customization panel has fields for WiFi SSID, password, and country code, plus a toggle to enable SSH with password or public key authentication. These settings are baked into the image before flashing, so the Pi connects to your network and enables remote access automatically on its first boot.
What is the best SD card size for Raspberry Pi with OpenClaw?
16 GB is the minimum recommended storage, but a USB SSD or NVMe drive is a better investment for deployments beyond short-term testing. OpenClaw's gateway writes frequently to a SQLite database, and SD cards wear out under sustained small writes. A budget NVMe on the Raspberry Pi M.2 HAT adds about $30 and improves both performance and longevity.
How much electricity does a Raspberry Pi 5 running OpenClaw cost per month?
A Pi 5 draws roughly 3W at idle and 5 to 7W during active tool calls. Since an OpenClaw gateway spends most of its time waiting on cloud API responses, average consumption hovers around 3 to 4W. At typical US electricity rates, that works out to approximately $0.50 per month.
Related Resources
Give your OpenClaw agent persistent cloud storage
50 GB free workspace with MCP access, built-in RAG, and ownership transfer. No credit card, no expiration.