Here’s a mistake I almost made, and the rule that came out of it.
When you run your own AI stack, some of it needs to be reachable from anywhere — like the endpoint your agents call. And some of it should never be visible to the public internet at all — like the admin dashboard that controls everything. Early on, I nearly exposed the dashboard on a public address alongside the API. I caught it and pulled it back. But it taught me how easy the mistake is.
So now my setup runs on two separate lanes. The public lane uses Cloudflare tunnels — outbound-only connections, which means my server reaches out to Cloudflare rather than sitting there with open doors. The private lane uses Tailscale, a mesh network that only my own devices can join. Public APIs go on the first. Every admin screen, dashboard, and internal tool goes on the second. The rule is simple: admin dashboards never get a public port. Not behind a login, not behind a password — not exposed at all.
The reasoning is about containing the damage if something goes wrong. If the public lane is ever compromised, the attacker gets API endpoints that have their own separate authentication. They don’t get the dashboard that runs the whole show.
Two details made this actually work, and both surprised me.
Bind to the private network address, not “everywhere.” When you start a service, you tell it which address to listen on. Listening on “everywhere” (0.0.0.0) means the public internet can reach it. Listening only on your own machine (127.0.0.1) means your other devices can’t. The right middle ground is the Tailscale address — reachable from my laptop and phone, invisible to everyone else. I verify it by trying to reach the public address from outside and getting nothing.
The “private must be slower” excuse doesn’t survive testing. I assumed the secure route would cost me speed. I measured it — 120 requests, the private route was within a few milliseconds of running it locally, with zero failures. The public route was actually slower and sometimes got blocked by the firewall for looking like a bot. Private wasn’t just safer. It was faster.
The unexpected bonus: because only my devices are on the private network, some of my internal tools don’t even need a login screen. Being on the network is the permission. That’s one less password to worry about, and one less thing to misconfigure.