{"slug": "ports-names-every-dev-server-running-on-your-machine", "title": "Ports – names every dev server running on your machine", "summary": "A developer tool called ports, published by pyjeebz on GitHub, scans a machine for every listening dev server and assigns each one a stable project-based name such as http://shop.localhost instead of http://localhost:3000, without wrapping or reconfiguring the servers. The tool lists each port with its framework, project directory and uptime, and its ports proxy command routes *.localhost names on port 80 as a systemd user unit started at login, while ports hosts sync writes the names into /etc/hosts for Node, Python and Go resolvers that do not handle *.localhost natively. The tool is aimed at both developers and coding agents, addressing the common \"Port 3000 is already in use\" conflict where existing utilities like lsof, kill-port and fkill identify only a PID, not the framework or project behind it.", "body_md": "**Every dev server on your machine, by name.**\n\n[**ports.tools**](https://ports.tools) · [Docs](https://ports.tools/docs/commands) · [Releases](https://github.com/pyjeebz/ports/releases)\n\n`ports` finds every dev server on your machine and gives it a name — `http://shop.localhost` instead of `http://localhost:3000`. Start servers the way you already do, from a terminal, an editor, `docker compose` or a coding agent: there's nothing to wrap and nothing to declare. See what's running, reach it by name, stop it safely. For people and coding agents.\n\n``` bash\n$ ports\nPORT   PROCESS      PROJECT           UPTIME   URL\n3000   Next.js      shop              14m      http://localhost:3000\n8000   FastAPI      shop              14m      http://localhost:8000\n5432   PostgreSQL   docker: shop-db   2d\n5173   Vite         admin             3h       http://localhost:5173\n\n$ ports proxy start\n✓ routing *.localhost on :80 — a systemd user unit, started at login\n\n$ ports\nPORT   PROCESS      PROJECT           UPTIME   URL\n3000   Next.js      shop              14m      http://shop.localhost\n8000   FastAPI      shop              14m      http://api.shop.localhost\n5432   PostgreSQL   docker: shop-db   2d\n5173   Vite         admin             3h       http://admin.localhost\n\n$ ports stop shop\n✓ stopped Next.js (:3000)\n✓ stopped FastAPI (:8000)\n```\n\nNone of those servers were started by ports, and none of them restarted: ports found them, and the router gave each one a name.\n\nEvery developer knows this dance:\n\n``` bash\nError: Port 3000 is already in use.\n\n$ lsof -i :3000\nCOMMAND   PID\nnode      48391\n\n$ kill -9 48391\n```\n\nAnd still nobody knows what PID 48391 *was*. React? Next.js? A dev server from\nyesterday? The database you actually needed? Ports and PIDs are how the\noperating system sees your machine — they are not how *you* see it. You see\nprojects: a frontend, an API, a database that belong together.\n\nExisting tools (`lsof`, `kill-port`, `fkill`) stop at the PID layer — they can\nkill a number, but they can't tell you what the number is. `ports` exists to\nadd the missing context: which framework a process is, which project directory\nit belongs to, which container is really behind `docker-proxy`, how long it has\nbeen running. That context is what turns \"kill a random PID and hope\" into\n\"stop yesterday's dev server, keep the database.\"\n\nThe tools that do give servers names — local proxies, process managers — only\nknow the servers you start through them or declare in a config. `ports` starts\nfrom the machine instead: it names what's already running, however it got\nthere.\n\n- **Finds** every dev server, however it was started — a terminal, an editor,`docker compose` , a coding agent — and lists every listening port with the framework, project directory, and uptime, not just a PID; grouped by project by default, or ordered with`--sort port|uptime|process|project`\n- **Names what it finds** —`ports proxy` (or`ports proxy start` , in the background from login on) puts each web dev server at`http://<name>.localhost` , whether ports started it or not:`shop.localhost` for a project's app,`api.shop.localhost` for the one in`apps/api` ,`ui.shop.localhost` for the same app in a git worktree on`fix/ui` ,`web.shop.localhost` for the`web` service of a compose project started there (a`db` service is`db.shop` to stop and wait on, with no URL — it doesn't speak HTTP). A name comes from the project, never the port, so it survives a restart on another port. The router listens on loopback only and refuses any host that isn't one of its names.`ports url api.shop` prints a URL for scripts. Browsers and curl resolve`*.localhost` on their own; for Node, Python and Go on a system whose resolver doesn't,`ports hosts sync` writes the names into`/etc/hosts` (one marked block, via sudo) and`ports doctor` says when that's needed.\n- **Picks the port, when you want it to** — you never need it for a name, but`ports run -- npm run dev` picks a free port, hands it to the server the way its framework takes one (`PORT` , or`--port` for Vite, Astro and Angular), and names it for as long as it runs. If the project is already running, it says where instead of starting a second copy.`ports alias stripe 4242` names a port ports can't name on its own.\n- **Groups** processes into the applications they belong to, so`frontend :3000` ,`api :8000` , and`db :5432` read as one project\n- **Unwraps Docker** , naming the real container and compose service instead of`docker-proxy`\n- **Stops things safely by name** —`ports stop shop` ,`ports stop 3000` — with graceful termination before force. Add`--expect nextjs` and a stop only happens if that's really what holds the port — the guard for scripts and agents, which`PORTS_REQUIRE_EXPECT=1` makes mandatory;`--json` reports each stop as a result object.\n- **Finds things** —`ports find postgres` →`5432`\n- **Knows your project** —`ports here` shows what's running for the directory you're in, so you (or your coding agent) reuse the dev server that's up instead of starting a second on :3001. Exit 1 when nothing is, so`ports here --port 3000 || npm run dev` just works.\n- **Waits for readiness** —`ports wait 3000 --http` blocks until the server actually answers, then prints its row;`--gone` waits until it's free. No sleep-and-retry loops.\n- **Opens the page** —`ports open 3000` opens a running server in your browser, after asking it whether it speaks HTTPS or HTTP;`ports open shop` asks which when a project serves more than one\n- **Diagnoses** —`ports doctor 3000` explains why a port won't free or a row looks odd: uninterruptible sleep, a zombie, TIME_WAIT sockets, a Windows-side listener — findings and the command that fixes each, never an action taken on its own. Bare`ports doctor` checks the whole machine.\n- **Watches** —`ports --watch` redraws the table live until you interrupt it (still a foreground loop: it dies with its terminal, never a daemon)\n- **Speaks JSON** (`--json` ) so scripts and coding agents can ask what's running\n- **Serves coding agents over MCP** —`ports mcp` gives an agent`list` ,`here` ,`find` ,`url` ,`wait` ,`stop` and`doctor` as tools, each the CLI's own JSON and exit code.`stop` always needs`expect` , and the MCP server starts nothing: agents start servers with`ports run` .\n\n- **Routes, and runs only what you ask it to** — ports gives your dev servers names and routes to them, but it never starts a server on its own and never installs anything without asking. It runs a command only when you hand it one, and the router listens on loopback only. It doesn't restart crashed servers, collect logs or supervise anything: there are plenty of process managers, and this is not one.\n- **Zero config** — no manifest, nothing to declare. All context, names included, is inferred from the machine itself. Useful sixty seconds after install, on a machine in whatever state it's in. (An optional`ports-config.yaml` can extend detection with your own framework rules and project markers — an extension layer, never a requirement.)\n- **Local-first** — a single static binary. No cloud, no accounts, no telemetry.\n\n**curl** (macOS, Linux):\n\n```\ncurl -fsSL https://ports.tools/install | sh\n```\n\n**npm** (macOS, Linux, Windows):\n\n```\nnpm i -g @pyjeebz/ports\n```\n\n**Homebrew** (macOS):\n\n```\nbrew install pyjeebz/tap/ports\n```\n\n**Scoop** (Windows):\n\n```\nscoop bucket add pyjeebz https://github.com/pyjeebz/scoop-bucket\nscoop install ports\n```\n\nOr grab a binary from the [releases page](https://github.com/pyjeebz/ports/releases), or `go install github.com/pyjeebz/ports@latest`. Every release archive also carries man(1) pages for the whole command tree — the curl installer puts them on your `MANPATH` when it can.\n\nFull documentation lives at [ports.tools](https://ports.tools).", "url": "https://wpnews.pro/news/ports-names-every-dev-server-running-on-your-machine", "canonical_source": "https://github.com/pyjeebz/ports", "published_at": "2026-11-27 05:05:35+00:00", "updated_at": "2026-11-27 05:46:23.195552+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents"], "entities": ["ports", "pyjeebz", "GitHub", "Next.js", "FastAPI", "PostgreSQL", "Vite", "docker compose"], "also_reported_by": [], "takeaway": "ports names already-running dev servers by project (shop.localhost, api.shop.localhost) rather than port, so a name survives a restart on a different port, and ports hosts sync writes those names into /etc/hosts for Node, Python and Go resolvers that don't resolve *.localhost.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/ports-names-every-dev-server-running-on-your-machine", "markdown": "https://wpnews.pro/news/ports-names-every-dev-server-running-on-your-machine.md", "text": "https://wpnews.pro/news/ports-names-every-dev-server-running-on-your-machine.txt", "jsonld": "https://wpnews.pro/news/ports-names-every-dev-server-running-on-your-machine.jsonld"}}