I bought a Raspberry Pi for one job: run an AI agent 24/7 at home and reach it from anywhere — my laptop at a coffee shop, a VM in some cloud region, or another agent that needs its help. The Pi part was easy. "Reach it from anywhere" was the actual project.
Here's the wall most people hit. The Pi sits behind the ISP's router, usually behind carrier-grade NAT, with no public IP and no inbound ports. Port forwarding either isn't available on your connection or doesn't help when your address is shared with half the street. Your IP changes whenever the modem reboots. Every remote-access tool you try works until it doesn't, and each one is another daemon to babysit.
This is a walkthrough of the setup that finally stuck: run the agent on the Pi as a first-class peer on an overlay network, with a permanent address that survives reboots and IP changes. No public IP, no port forwarding, no tunnel to keep alive. One install command, and the Pi is reachable from anywhere — by you and by other agents.
Why a Pi Is a Great Agent Host (and a Terrible Server)
A Raspberry Pi is nearly the perfect agent box: always on, low power draw, silent, ARM is plenty for what most agents do. An agent's steady state is mostly listening, thinking, and calling tools — it's not rendering frames.
The problem is networking. Agents are servers now. A server needs an address; it needs to be reachable. A residential connection gives you none of that for free: no static IP, no inbound ports, and increasingly a NAT layer you can't configure at all. So the interesting engineering problem isn't the agent — it's the network between you and it.
The Usual Options — and What They Cost
The standard toolbox, fairly stated:
- Port forwarding + dynamic DNS. Works if your ISP gives you a real public IP and lets you open ports. CGNAT kills both. And you get an IP, not an identity: your agent's address still changes with your connection.
- Reverse SSH tunnels and tunnel services. Solid and widely used. The cost is operational: keepalives, reconnect logic, and a single point of failure between you and the Pi.
- VPNs (Tailscale, WireGuard, and friends). Genuinely good products. But a VPN connects machines into one private network — you're now administering join policy and trust for every device, and your agent's reachability is tied to that network staying up.
None of these are wrong. They're just shaped around machines, not agents.
The Approach: Give the Agent an Address, Not a Tunnel
The shift that changed my setup: stop exposing the Pi's ports, and give the agent itself a permanent virtual address on an overlay network.
Pilot Protocol is the one I run — an open-source overlay network built for agents. Its docs are the reference for everything below. Every node gets a permanent address that survives restarts, IP changes, and moving across networks. Traffic runs over encrypted UDP tunnels (X25519 key exchange, AES-GCM), and NAT traversal is built in: STUN + hole punching, with a relay fallback when a network blocks direct paths. The Pi behind my router is as reachable as a VM in a datacenter — without me opening a single port.
Two details matter for a home lab specifically. First, the daemon is a static binary written in Go with zero external dependencies — nothing to install alongside it, no runtime to keep healthy, which matters on a Pi's limited disk. Second, trust is explicit: peers connect through a mutual handshake. "On the network" and "trusted by you" are separate things, so your Pi doesn't accept anything from strangers just because it's reachable.
Run an AI Agent on a Raspberry Pi and Reach It From Anywhere: The Walkthrough
Here's the whole path, end to end.
Step 1 — Install on the Pi. SSH in and run the installer. It detects the platform, pulls the pre-built binary, and sets up a systemd service, so the daemon comes back on its own after a reboot.
curl -fsSL https://pilotprotocol.network/install.sh | sh
That's the entire install. No Python environment, no Node runtime, no Docker daemon to maintain.
Step 2 — Start the daemon and claim your address.
pilotctl daemon start --hostname pi-agent
The output looks like this:
starting daemon (pid 12345).....
Daemon running (pid 12345)
Address: 0:0000.0000.xxxx
Socket: /tmp/pilot.sock
That address is the agent's permanent identity. It stays the same across reboots, IP changes, and even moving the Pi to a different network entirely.
Step 3 — Handshake from anywhere. On your laptop, or a cloud VM, or a second agent, establish trust with the Pi:
pilotctl handshake pi-agent
The Pi side approves (you control both ends, so it's a one-time pilotctl approve on the Pi). Then confirm the tunnel works:
pilotctl ping pi-agent
Step 4 — Talk to it. Messages route by name through the network's registry, so you address the Pi as pi-agent no matter where either of you is:
pilotctl send-message pi-agent --data 'check my server logs and summarize anything unusual'
The message lands in the Pi daemon's inbox; your agent code reads it, works, and replies. No public IP involved at any point.
Step 5 — Give the Pi agent real capabilities. This is the part I actually like. The Pi's agent can install agent-native apps that run locally as typed IPC services — JSON in, JSON out, signature-verified, and auto-spawned on demand. The loop is discover, install, call:
pilotctl appstore catalogue
pilotctl appstore install io.pilot.cosift
pilotctl appstore call io.pilot.cosift cosift.search '{"q":"current agent frameworks"}'
So my Pi agent has grounded web search without me maintaining a scraper, and if I ever expose it to untrusted input, AEGIS runs locally as a runtime firewall against prompt injection. One command per capability, no REST plumbing, no browser.
What You Actually Get
- A permanent address. It survives reboots, IP changes, and moving networks. You stop treating your home connection as infrastructure.
- Reachability without ports. NAT traversal with relay fallback handles CGNAT and locked-down networks; if your Pi ends up on a network that blocks outbound UDP, the daemon has a compat transport over TCP/443.
- Trust that's explicit. Every peer is handshake-approved. Your always-on Pi is reachable but not open.
- A network, not a lonely tunnel. The overlay has 243k+ agents and users on it, and your Pi can discover services and peers on it — or stay a private two-node setup. Both work.
- SDKs when you outgrow the CLI. Go, Python, Node, and Swift bindings, plus an MCP server if your agent speaks MCP instead.
When This Setup Isn't the Right Fit
Honest limits: the daemon is long-running by design, so serverless functions are out of scope. If you only need occasional shell access to the Pi, a mature VPN or tunnel product is the simpler tool. And if humans need to reach the Pi over plain HTTP, an overlay isn't a web server — there's an optional gateway binary that bridges IP traffic for that case, but a tunnel service might be the more direct answer. The overlay earns its keep when the thing being reached is an agent: something with an identity that needs to be addressable by other software, on its own terms.
The One-Command Setup
The Pi is the perfect always-on agent home once networking stops being the project. Mine has been running this way for months: boot, daemon starts, address unchanged, reachable from anywhere.
curl -fsSL https://pilotprotocol.network/install.sh | sh
If you want the full command reference, SDK guides, and the trust model explained properly, the Pilot Protocol docs are the right next stop. For the Pi itself: install, start, handshake, done. Your agent finally has a home address.
Top comments (0)