Show HN: Port Zero – how I learned to stop worrying and love PORT=0

Hacker News Top Tools

Summary

Port Zero is a free, open-source tool that assigns stable local domains to dev servers instead of port numbers, eliminating port conflicts and enabling easy multi-branch development and cloud tunneling.

Hi HN,<p>Recently I wasted several hours wrangling my dev environment only to find out that the browser frontend was talking to the wrong version of the backend. This got me thinking--why on earth are we still using simple <i>numbers</i> to describe which process to connect to? Why not use <i>names</i> instead? I thought of all the times a program wouldn&#x27;t start because of port conflicts. The more I thought about it, the crazier it seemed.<p>Modern operating systems already offer no-conflict ports: if you make your TCP server listen on port 0, the OS assigns you a random available port. But that only solves half the problem.<p>I built the other half: PortZero. It&#x27;s a GPLv3 program that watches for processes (and docker containers!) with a special PZ_TUNNEL environment variable:<p><pre><code> PZ_TUNNEL=myapp-{branch}.portzero.local:80 npm run dev </code></pre> When it sees such a process or container, PortZero does this:<p>1. Create a virtual NIC (if it hasn&#x27;t already)<p>2. Create a new virtual IP address<p>3. Create a DNS record that substitutes things like {branch} based on the working directory of the process, and points at that virtual IP address<p>4. Start listening on that virtual IP address on the port of your choice (e.g. port 80 for http, port 443 for https, port 5432 for postgresql)<p>5. Forward any TCP connections to that virtual IP address &#x2F; virtual port to the random, OS-assigned port that your process or container is actually listening on<p>The result is you don&#x27;t have to think about ports anymore, you just have to think about subdomains. You can have multiple services available on port 80 without conflicts, as long as they have different portzero.local subdomains.<p>It does some other cool stuff like:<p>- Enable HTTPS on local HTTP services by creating a local CA and registering it on your machine<p>- Enable cloud tunnels so you can access your apps on other devices (paid feature)<p>Links:<p><a href="https:&#x2F;&#x2F;portzero.net&#x2F;docs&#x2F;" rel="nofollow">https:&#x2F;&#x2F;portzero.net&#x2F;docs&#x2F;</a><p><a href="https:&#x2F;&#x2F;github.com&#x2F;PortZeroNetwork&#x2F;portzero" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;PortZeroNetwork&#x2F;portzero</a>
Original Article
View Cached Full Text

Cached at: 07/27/26, 01:42 AM

# Port Zero — stable domains for your local dev ports Source: [https://portzero.net/](https://portzero.net/) Developer networking, without port conflicts ## Eliminateport conflicts Set every port to`0`and start your dev server\. Port Zero gives each process or container a stable domain — no port to remember, no`EADDRINUSE`, ever\. bash ``` $ PZ_TUNNEL="web.myapp-feat-checkout-redesign.portzero.local" node app.ts $ PZ_TUNNEL="web.myapp-feat-dark-mode.portzero.local" node app.ts ``` web\.myapp\-feat\-checkout\-redesign\.portzero\.local git worktree feat/checkout\-redesign ``` Hello from the PortZero Node.js TypeScript process example. PZ_TUNNEL=nodejs-typescript-process.portzero.local:80 localhost_port=52431 ``` web\.myapp\-feat\-dark\-mode\.portzero\.local git worktree feat/dark\-mode ``` Hello from the PortZero Node.js TypeScript process example. PZ_TUNNEL=nodejs-typescript-process.portzero.local:80 localhost_port=52431 ``` One machine, many branches ## Run every branch at once, in git worktrees Each worktree's dev server gets its own self\-explanatory URL — no port juggling between branches, no collisions\. bash ``` $ PZ_TUNNEL="web.myapp-feat-checkout-redesign.portzero.local" node app.ts $ PZ_TUNNEL="web.myapp-feat-dark-mode.portzero.local" node app.ts ``` web\.myapp\-feat\-checkout\-redesign\.portzero\.local git worktree feat/checkout\-redesign ``` Hello from the PortZero Node.js TypeScript process example. PZ_TUNNEL=nodejs-typescript-process.portzero.local:80 localhost_port=52431 ``` web\.myapp\-feat\-dark\-mode\.portzero\.local git worktree feat/dark\-mode ``` Hello from the PortZero Node.js TypeScript process example. PZ_TUNNEL=nodejs-typescript-process.portzero.local:80 localhost_port=52431 ``` Beyond your machine ## See it on your phone Local domains stop at your machine\. A cloud tunnel takes the same app to your phone, a tablet, or anyone you choose — HTTPS included\. bash ``` $ PZ_TUNNEL="nodejs-typescript-process.acme.tunnel.portzero.cloud:80" node app.ts ``` nodejs\-typescript\-process\.portzero\.local ``` Hello from the PortZero Node.js TypeScript process example. PZ_TUNNEL=nodejs-typescript-process.portzero.local:80 localhost_port=52431 ``` nodejs\-typescript\-process\.acme\.tunnel\.portzero\.cloud ``` Hello from the PortZero Node.js TypeScript process example. PZ_TUNNEL=nodejs-typescript-process.acme.tunnel.portzero.cloud:80 localhost_port=52431 ``` What do you need? ## One tool, six jobs Port Zero starts local and free, and grows as far as you need\. Pick what brings you here — or just explore\. What brings you here? **Kill port conflicts for good**Stable local domains instead of port numbers\.Set every port to 0\. Each process and container gets a stable \*\.portzero\.local domain — no EADDRINUSE, no port map, no bookkeeping\. Free and open source\. [Download Port Zero →](https://portzero.net/#download) **Run every branch at once**One URL per worktree, however many you spin up\.AI agents and git worktrees each start their own dev server\. Every one gets a self\-explanatory URL, so N parallel builds never fight over :3000 — and your coding agent can manage it all over MCP\. [See the agent workflow →](https://portzero.net/docs/ai-agents) **See it on your phone**Local domains stop at your machine\. Tunnels don't\.\*\.portzero\.local can't reach a phone or tablet\. A cloud tunnel takes the same app across the device boundary with HTTPS — tap the URL on any device and iterate\. Works per worktree, too: every branch can get its own cloud URL\. [See cloud tunnel plans →](https://portzero.net/#pricing) **Put a local app on the internet**Webhooks, demos, previews — one command, public HTTPS\.Give any local app a public HTTPS URL — on your own domain if you like\. Flat pricing: no metered bandwidth, no per\-request pricing, no overage charges\. [Cloud bandwidth is generous and fair\-use\.](https://portzero.net/terms#fair-use) [Compare plans →](https://portzero.net/#pricing) **Get it judged by the person who knows**A named collaborator uses the real thing and comments in context\.Share a live build with the one person who can tell you it's wrong\. They sign in by name, use the actual app, and leave feedback comments right on it — no deploy, no git clone, every iteration\. [See plans →](https://portzero.net/#pricing) **Control what your team exposes**Approvals, policies, one flat bill\.Nothing goes public without an approval\. Team access policies, shared subdomains, and organization billing — one flat price, no per\-seat charges\. Audit log available on Enterprise\. [See the Team plan →](https://portzero.net/#pricing) Agent\-ready ## Ready for agentic coding Point your coding agent at Port Zero and it handles the tunnel for you — no copy\-pasting JSON, no guessing ports\. - **Easy configuration**One command wires up every AI coding agent it finds on your machine\. - **MCP**`portzero mcp`exposes live tunnel and service state as tools an agent can call directly\. - **Skill**`portzero skill install`teaches an agent to extract a production topology from your compose file\. See[the AI agents doc](https://portzero.net/docs/ai-agents)for the full MCP tool reference, or paste[the condensed reference](https://portzero.net/llms.txt)into any agent working in your repo\. ## Download Choose the Port Zero CLI installer for your platform\. Port Zero Local \(`\*\.portzero\.local`tunnels\) is free, open\-source software under the[GNU GPL v3\.0](https://github.com/PortZeroNetwork/portzero/blob/staging/LICENSE)\. Cloud features are governed by the[Terms of Service](https://portzero.net/terms)\. ## Pricing Local tunnels are always free and don't require a portzero\.cloud account\. Paid plans are flat — no meters, no overages, no per\-seat charges\. ### Free and Open Source - Unlimited local tunnels, open source - Cloud tunnels on paid plans - Community support [Download](https://portzero.net/#download) Most popular### Professional $49/mo or $490/yr billed yearly Everything inFree, plus: - Unlimited cloud tunnels - Generous cloud bandwidth & requests\* - Visitor auth & access control - Feedback comments on live tunnels [Get started](https://app.portzero.net/#/settings?checkout_plan=professional&cadence=monthly) ### Team $149/mo or $1,490/yr billed yearly Everything inProfessional, plus: - Unlimited members — no per\-seat charges - Teams & member invites - Shared team subdomains - Team naming & access policies - Cloud\-tunnel approvals - Organization billing [Get started](https://app.portzero.net/#/teams) ### Enterprise Everything inTeam, plus: - Audit log - Custom terms & higher limits - Security\-review support - Dedicated onboarding [Contact sales](https://app.portzero.net/#/contact) ### Compare all features \* Cloud bandwidth and requests are generous and subject to fair use — see our[Terms of Service](https://portzero.net/terms#fair-use)\. ## Set your ports to 0\. Port Zero handles the rest — no conflicts, ever\. Free and open source to start\.

Similar Articles

vercel-labs/portless

GitHub Trending (daily)

Portless is a developer tool that replaces port numbers with stable, named .localhost URLs for local development, providing HTTPS with HTTP/2 support and auto-configuration for frameworks like Next.js and Vite.