Local development without port friction.

port0 is a lightweight daemon that auto-assigns free ports, injects the PORT environment variable, and reverse-proxies traffic to clean hostnames like project.localhost.

Zero Configuration

No project-level config files required. Port assignment and routing are derived from your working directory automatically.

Port Injection

Automatically finds an open port and injects it into your process via environment variables. Say goodbye to port 3000 conflicts.

Clean Hostnames

Access your local apps via app.localhost or app.web instead of memorizing messy IP addresses and port numbers.

Native Proxy & DNS

Built-in reverse proxy with WebSocket support and an embedded DNS server. Works seamlessly across macOS, Linux, and Windows.

macOS / Linux curl -fsSL https://port0.bluephantom.dev/install.sh | bash
Windows (PowerShell) irm https://port0.bluephantom.dev/install.ps1 | iex

Install

One-line installer

Detects OS/arch, downloads the proper release binary, and installs to a common path (may prompt for sudo).

macOS / Linux curl -fsSL https://port0.bluephantom.dev/install.sh | bash
Windows (PowerShell) irm https://port0.bluephantom.dev/install.ps1 | iex

Build from source

macOS / Linux git clone https://github.com/blu3ph4ntom/port0.git
cd port0
go build -o port0 .
sudo mv port0 /usr/local/bin/port0
Windows (PowerShell) git clone https://github.com/blu3ph4ntom/port0.git
cd port0
go build -o port0.exe .
# move to a folder on PATH, e.g. %USERPROFILE%\bin

Quick start

Wrap your usual dev command with port0. It injects PORT and exposes the service at:

  • http://<name>.localhost (no setup required)
  • http://<name>.web (requires one-time setup)
  • http://<name>.local (requires one-time setup)
cd ~/projects/myapp
port0 npm run dev
# or
port0 go run ./cmd/server

Subdomain support

Group related projects under a shared parent domain for clean URLs in monorepos.

Quick syntax

port0 -n api.myapp npm run dev    # api.myapp.localhost
port0 -n web.myapp npm run dev    # web.myapp.localhost

Explicit syntax

port0 -n api --domain myapp npm run dev    # api.myapp.localhost
port0 -n web --domain myapp npm run dev    # web.myapp.localhost
port0 -n myapp npm run dev        # myapp.localhost
port0 npm run dev                 # uses folder name

Use this for monorepos, micro-frontends, multi-repo domains, or environment separation.

One-time system setup (optional)

Only required to enable .web / .local or to allow binding privileged ports (80/53).

  • macOS: sudo port0 setup
  • linux (systemd): sudo port0 setup
  • windows: run Administrator PowerShell, then port0 setup

Undo: sudo port0 teardown (or run port0 teardown in Administrator PowerShell on Windows).

Common commands

  • port0 <cmd...> — run command with PORT injected
  • port0 -n <name> <cmd...> — set custom name
  • port0 -d <cmd...> — run detached/background
  • port0 ls — list projects
  • port0 logs <name> — view logs (-f to follow)
  • port0 kill <name> — stop project
  • port0 setup / port0 teardown — system config
  • port0 update — download & replace binary with latest release

port0 daemon start|stop|status — manage daemon

Integration examples

package.json

{
  "scripts": {
    "dev": "port0 vite",
    "start": "port0 node server.js",
    "serve": "port0 -d npm run start"
  }
}

pnpm workspaces

{
  "scripts": {
    "dev:web": "cd packages/web && port0 pnpm dev",
    "dev:api": "cd packages/api && port0 pnpm --filter api dev"
  }
}

bun

port0 bun run dev

cargo

port0 cargo run --bin api

go

port0 go run ./cmd/server
port0 ./bin/server

python

port0 poetry run uvicorn myapp:app --host 0.0.0.0 --port $PORT
port0 python -m myapp