How to Set Up OpenClaw on a Raspberry Pi 400 as a Dedicated AI Agent
The Raspberry Pi 400 is a keyboard-integrated computer with a quad-core Cortex-A72 and 4GB of RAM, available for $70. It runs OpenClaw as a dedicated always-on AI agent gateway while drawing 3 to 5 watts. This guide walks through flashing 64-bit OS Lite, installing OpenClaw, tuning swap and memory, and configuring systemd for continuous headless operation.
Why the Pi 400 Works as a Dedicated OpenClaw Gateway
A documented deployment ran three OpenClaw automations on a Raspberry Pi 400 continuously for over two weeks without a single restart or memory failure. The agent handled blog monitoring, daily health checks, and weather alerts around the clock on a device that costs $70. That stability data comes from a real-world deployment, not a lab benchmark, and it points to a gap in the OpenClaw community: the official installation guide and most third-party tutorials focus on the Raspberry Pi 5, leaving Pi 400 owners to piece together instructions from scattered threads.
The Pi 400 is a full computer built into a keyboard enclosure. Inside sits a 1.8GHz quad-core Cortex-A72 processor and 4GB of LPDDR4 RAM, the same BCM2711 system-on-chip found in the Raspberry Pi 4. An integrated aluminum spreader handles heat passively under typical loads, so there is no fan noise and no thermal paste to apply.
OpenClaw does not run language models on the Pi. It acts as a gateway: scheduling tasks, routing messages to Telegram or Discord, executing browser automation, managing files, and sending API calls to cloud providers like Claude, GPT-4, or Gemini for reasoning. The Pi 400's CPU handles that coordination comfortably because inference happens off-device. This makes the 4GB RAM constraint far less limiting than it would be for local model inference.
Electricity cost makes the practical case. The Pi 400 draws 3 to 5 watts under typical OpenClaw workloads. At average US electricity rates, that works out to roughly $4 to $7 per year for nonstop 24/7 operation. Compare that to a repurposed laptop drawing 30 to 60 watts or a cloud VM charging $5 to $20 per month. The Pi 400 pays for itself in saved electricity within the first year.
At $70 for the unit (or $100 for the complete kit with mouse, power supply, and cables), the Pi 400 remains one of the most cost-effective paths to a dedicated always-on agent. Schools and home offices often already have one sitting in a drawer.
How to Flash 64-Bit OS Lite for a Headless Pi 400
OpenClaw requires 64-bit Raspberry Pi OS Lite. The official install guide lists the Pi 4 with 4GB RAM as the recommended baseline, and the Pi 400 shares the same hardware. The desktop version of Raspberry Pi OS adds a compositor, window manager, and Chromium that collectively consume 500 to 800MB of the Pi 400's 4GB RAM before OpenClaw even starts. On a Pi 5 with 8GB, that overhead is acceptable. On the Pi 400, it cuts available memory nearly in half. OS Lite strips the graphical environment entirely, booting to a terminal and leaving the full 4GB for OpenClaw's Node.js daemon and tool execution.
The 32-bit version of Raspberry Pi OS will not work. OpenClaw's dependencies require a 64-bit runtime, and the installer exits with an error on a 32-bit system.
Download the Raspberry Pi Imager on another computer and select "Raspberry Pi OS Lite (64-bit)" as the operating system. Before flashing, click the settings gear and configure:
- A hostname (e.g.,
pi400-agent) - Username and password
- WiFi credentials if not using Ethernet
- SSH enabled (required for all future access since there is no desktop)
Flash the image to a microSD card, insert it into the Pi 400's card slot on the back, and connect power. The first boot takes one to two minutes while the filesystem expands. Once SSH is available, connect from another machine:
ssh your-username@pi400-agent.local
Update the system and install the build tools that OpenClaw's Node.js dependencies require:
sudo apt update && sudo apt upgrade -y
sudo apt install -y git curl build-essential
Verify you are running a 64-bit kernel:
uname -m
The output should read aarch64. If it shows armv7l, you accidentally flashed the 32-bit image and need to start over with the 64-bit variant.
Reduce GPU memory allocation to 16MB since there is no display to drive:
sudo raspi-config nonint do_memory_split 16
If you have a USB 3.0 SSD available, consider flashing OS Lite directly to it instead of using the microSD card. SD cards handle small random writes poorly, and OpenClaw's SQLite state database writes frequently. The Pi 400 supports USB boot natively, and an SSD reduces latency noticeably over weeks of continuous operation.
Installing OpenClaw on the Pi 400
OpenClaw requires Node.js 24 or later. Install it from the NodeSource repository:
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash -
sudo apt install -y nodejs
Verify both tools are available:
node --version
npm --version
With Node.js ready, run the official OpenClaw installer:
curl -fsSL https://openclaw.ai/install.sh | bash
The installer downloads the latest release and sets up the base directory at ~/.openclaw/. Next, run the onboarding wizard:
openclaw onboard --install-daemon
Onboarding walks through three configuration decisions:
AI provider: Choose a cloud provider and enter your API key. Claude, GPT-4, Gemini, and DeepSeek are all supported. Pick whichever provider you already have an account with. You can add or switch providers later without reinstalling.
Messaging channels: Select how you will communicate with the agent. Telegram and Discord are the most common choices for personal agents. The wizard provides step-by-step instructions for creating the required bot tokens. You can also skip channels entirely and interact through the web dashboard at http://pi400-agent.local:18789/.
Daemon installation: The wizard configures a systemd service that keeps OpenClaw running in the background, restarts it automatically after crashes, and survives reboots.
After onboarding finishes, confirm the service is active:
sudo systemctl status openclaw
A green "active (running)" line means the agent is live. The ~/.openclaw/ directory now contains the agent's operating instructions (AGENTS.md), personality configuration (SOUL.md), available tools (TOOLS.md), and persistent memory. Edit these files over SSH to customize how the agent behaves.
Stick with cloud API providers rather than attempting local models. Even a small language model would saturate the Cortex-A72 cores and leave no CPU budget for tool execution, message routing, or browser automation. Cloud APIs keep the Pi 400 responsive by handling inference entirely off-device.
How to Configure Swap and Memory on 4GB Hardware
The Pi 400's 4GB of RAM handles base OpenClaw operation, but adding swap provides a safety net during peak usage. When the agent runs several tools at once (browser automation, file downloads, concurrent API calls), memory consumption can spike beyond what 4GB alone covers. A small swap file prevents the Linux OOM killer from terminating the OpenClaw process during those spikes.
Create a 2GB swap file:
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Reduce swappiness so the kernel only uses swap under genuine memory pressure rather than preemptively paging out OpenClaw's in-memory state:
sudo sysctl vm.swappiness=10
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
Two additional optimizations help on the Pi 400's constrained hardware:
Disable Bluetooth if you are not using it. The Bluetooth stack consumes a small but unnecessary share of both RAM and CPU cycles on a headless deployment:
sudo systemctl disable bluetooth
Enable Node.js compile caching to reduce startup time and memory churn when OpenClaw restarts. Add the following to your shell profile (e.g., ~/.bashrc):
export NODE_COMPILE_CACHE=~/.cache/node-compile
Monitor memory usage over the first few days with free -h and htop. If you consistently see swap usage above 500MB, consider reducing the number of concurrent tools or adding a USB SSD with a larger swap partition. On the Lifewaza deployment that ran for two weeks straight, 4GB of RAM proved sufficient for three concurrent automations with no swap pressure at all.
Running OpenClaw as a Persistent System Service
If you ran onboarding with the --install-daemon flag, systemd is already configured. The service uses a drop-in configuration with the environment variable OPENCLAW_NO_RESPAWN=1, which tells the OpenClaw process to let systemd handle restarts rather than respawning internally. The restart policy triggers after a 2-second delay, and the service allows up to 90 seconds for startup before marking itself as failed.
Enable user-level lingering so the service persists even when your SSH session disconnects:
sudo loginctl enable-linger $USER
Stream the service logs to verify everything is running correctly:
journalctl -u openclaw -f
You will see API call logs, tool execution results, incoming channel messages, and any errors. Press Ctrl+C to stop following.
For monitoring without an SSH session, the OpenClaw web dashboard at http://pi400-agent.local:18789/ shows active tasks, recent messages, and overall agent health. Access it from any device on the same network.
If the service fails to start, the most common causes on the Pi 400 are:
- Missing swap: the daemon cannot allocate enough memory during initialization. Verify swap is active with
free -h. - CPU throttling: the passive heatsink is usually sufficient, but poor ventilation can cause throttling. Check with
vcgencmd get_throttled. - Wrong Node.js version: run
node --versionand confirm it reports v24 or later.
Once the agent has been running for a day or two without issues, the Pi 400 requires minimal ongoing attention. The systemd service handles restarts automatically, and the only periodic maintenance is updating OpenClaw through the web dashboard or running openclaw update over SSH.
Keep your Pi 400 agent's files indexed and shareable
generous storage with automatic file indexing and MCP server access for your OpenClaw agent. No credit card, no expiration.
Storing and Sharing Agent Output
An always-on agent generates files over time: research documents, downloaded datasets, processed reports, automation logs. The Pi 400's microSD card stores everything locally by default, but SD cards have limited write endurance and no built-in mechanism for sharing files with other people or backing them up.
For local redundancy, schedule rsync jobs to an external USB drive or use rclone to push files to S3, Google Drive, or Dropbox on a timer. These approaches add durability but require you to configure and maintain the sync pipeline yourself.
Fastio provides a workspace designed for agent output. Create a free workspace with 50GB of storage, no credit card required, and point your agent's output directory at it. Files uploaded to Fastio are automatically indexed through Intelligence Mode, which makes the agent's entire output history searchable by meaning rather than just filename. Ask questions about your agent's accumulated research directly through the workspace chat.
The Fastio MCP server gives your OpenClaw agent a standardized interface for workspace operations: uploading files, creating branded share links, querying indexed documents, and handing off workspace ownership to collaborators. If your Pi 400 agent compiles a research report overnight, share it with a single link the next morning or transfer the entire workspace to a teammate. The agent retains admin access for future updates while the recipient gets full ownership of their copy.
For a single Pi 400 agent generating daily output, the free tier covers most workflows: 5 workspaces, included credits, and 50GB of storage with no expiration. The pricing page shows what each tier includes, but for personal agent use the free plan handles typical daily output without hitting limits.
Frequently Asked Questions
Can you run OpenClaw on a Raspberry Pi 400?
Yes. The Pi 400 uses the same BCM2711 system-on-chip as the Raspberry Pi 4, which OpenClaw's documentation lists as a supported platform with 4GB of RAM as the recommended minimum. Install 64-bit Raspberry Pi OS Lite, add Node.js 24, and run the standard OpenClaw installer. A documented deployment ran three automations on a Pi 400 for over two weeks without stability issues.
Is 4GB RAM enough for OpenClaw?
The OpenClaw documentation describes 4GB as the practical floor for comfortable operation. The Pi 400's 4GB handles the Node.js daemon, messaging channels, and tool execution without problems under normal workloads. Adding a 2GB swap file provides extra headroom during peak usage when multiple tools run simultaneously. You do not need to close other processes or limit automations to stay within 4GB on typical workloads.
How do you set up OpenClaw on a Raspberry Pi 400?
Flash 64-bit Raspberry Pi OS Lite to a microSD card, SSH into the Pi 400, install Node.js 24 from NodeSource, and run the OpenClaw curl installer. Run the onboarding wizard to configure your AI provider, messaging channels, and systemd service. The entire process takes about 30 minutes.
What is the cheapest way to run OpenClaw 24/7?
A Raspberry Pi 400 draws 3 to 5 watts running OpenClaw, which costs roughly $4 to $7 per year in electricity at average US rates. The unit itself costs $70. By comparison, a cloud VM with similar capability runs $5 to $20 per month, and a repurposed laptop draws 10 to 20 times more power. The Pi 400 is the lowest-cost option for continuous always-on operation.
Does the Pi 400 need active cooling for OpenClaw?
No. The Pi 400's integrated aluminum heatsink handles typical OpenClaw workloads without throttling. The processor runs at 1.8GHz with passive cooling and does not require a fan. If you place the Pi 400 in an enclosed space with poor airflow, check vcgencmd get_throttled periodically to confirm no thermal throttling is occurring.
Can OpenClaw run local AI models on the Pi 400?
OpenClaw supports connections to local models through tools like Ollama, but running them on the Pi 400 is not practical. Even small language models consume all available CPU and RAM, leaving nothing for the agent's orchestration, tool execution, and message handling. Use cloud API providers like Anthropic, OpenAI, or Google and let the Pi 400 handle coordination, scheduling, and gateway work.
Related Resources
Keep your Pi 400 agent's files indexed and shareable
generous storage with automatic file indexing and MCP server access for your OpenClaw agent. No credit card, no expiration.