Skip to content

Portless: Vercel Labs' Fix for the localhost Port Number Problem

Tool Spotlight Developer Tools Open Source Feb 17, 2026

Portless: Vercel Labs' Fix for the localhost Port Number Problem

A lightweight CLI tool that replaces port numbers with stable, named .localhost URLs. No more EADDRINUSE, no more memorizing port numbers, no more AI agents testing the wrong port. From the team behind Next.js.

vercel-labs / portless

Replace port numbers with stable, named .localhost URLs. For humans and agents.

TypeScript 60.5% JavaScript 22.2% Python 17.3% ★ 771 stars Apache-2.0 26 forks 10 commits

Anyone who has worked on a multi-service project or a monorepo knows the pain: port 3000 is already in use, the API is on 8080 (or was it 3001?), your browser tab from yesterday is now showing a completely different app, and the AI coding agent you're working with just hardcoded the wrong port in its test command. Port numbers are an implementation detail that developers are forced to think about far too often.

Portless is a new tool from Vercel Labs that solves this with a simple idea: instead of localhost:3000, your app runs at myapp.localhost:1355. A lightweight local proxy assigns each dev server a stable, human-readable name that doesn't change between sessions.

// The Problem in Detail

The README lays out a comprehensive list of pain points that port-based local development creates, and they're all real issues that compound in larger projects.

💥
Port Conflicts
Two projects default to the same port and you get EADDRINUSE. Common with Next.js apps all defaulting to 3000.
🤖
Agents Test Wrong Ports
AI coding agents guess or hardcode the wrong port, especially in monorepos with multiple services running simultaneously.
🍪
Cookie & Storage Clashes
Cookies set on localhost bleed across apps on different ports. localStorage is lost when ports shift between sessions.
🔗
Hardcoded Port Config
CORS allowlists, OAuth redirect URIs, and .env files all break when ports change. Named URLs stay stable.

// How It Works

portless myapp next dev Assigns random port (4000-4999) Registers with proxy myapp.localhost:1355

Portless runs a local proxy daemon on port 1355 (configurable). When you prefix your dev command with portless <name>, it assigns your app a random port in the 4000-4999 range via the PORT environment variable, registers the name-to-port mapping with the proxy, and routes all requests from <name>.localhost:1355 to the actual port. Most frameworks (Next.js, Vite, etc.) respect the PORT env var automatically.

The proxy auto-starts when you run an app, so the typical workflow is just wrapping your existing dev command. Subdomains work too: portless api.myapp pnpm start gives you api.myapp.localhost:1355, which is useful for monorepo setups where you have a frontend, API, and docs all running simultaneously.

// Usage

CommandDescription
portless <name> <cmd>Run app at http://<name>.localhost:1355
portless listShow active routes
portless proxy startStart the proxy daemon (port 1355)
portless proxy start -p 80Start on port 80 (requires sudo)
portless proxy stopStop the proxy
PORTLESS=0 pnpm devBypass proxy, use default port

Integration into existing projects is a one-line change in package.json: replace "dev": "next dev" with "dev": "portless myapp next dev". The escape hatch is equally simple: set PORTLESS=0 or PORTLESS=skip to bypass the proxy entirely.

// The Agent Angle

🤖 Built for AI-Assisted Development
The tagline is "For humans and agents." The repo includes an AGENTS.md file and bundled skills for Cursor and OpenClaw-compatible agents, signaling that Vercel is thinking about how AI coding agents interact with local dev environments. Named URLs give agents a stable, predictable way to reference running services.

This is arguably the most interesting aspect of Portless. As AI coding agents become more common in development workflows, they need a reliable way to know where services are running. An agent that can reference api.myapp.localhost:1355 instead of guessing whether the API is on port 3001 or 8080 is significantly more likely to get things right on the first try.

The repo ships with skill files for both Cursor (.cursor/skills/) and OpenClaw-compatible agents (.agents/skills/), plus a dedicated AGENTS.md file. This is Vercel signaling that developer tooling needs to be designed with AI agents as first-class consumers, not just human developers.

// Technical Details

SpecDetails
RuntimeNode.js 20+
PlatformsmacOS, Linux
Proxy Port1355 (configurable via -p or PORTLESS_PORT)
App Port Range4000-4999 (random assignment)
State (port ≥ 1024)~/.portless (user-scoped)
State (port < 1024)/tmp/portless (shared, sudo required)
LicenseApache-2.0

// Considerations

⚠️ Early Stage
Portless has 10 commits and no tagged releases yet. It's from Vercel Labs (their experimental/research arm), not the main Vercel product line. Evaluate accordingly.

No Windows support. The tool currently only supports macOS and Linux. Windows developers are out of luck for now, though WSL2 may work (untested by the project).

No HTTPS. Everything runs over plain HTTP on localhost. For most local dev this is fine, but if you're testing HTTPS-dependent features (secure cookies, service workers, WebAuthn), you'll still need a separate solution.

Framework compatibility. The tool relies on frameworks respecting the PORT environment variable. Most popular frameworks (Next.js, Vite, Express, Fastify) do this automatically, but some tools may require additional configuration to pick up the assigned port.

Vercel Labs, not Vercel. This comes from Vercel's experimental lab, not the core product team. There's no guarantee of long-term maintenance or integration into the Vercel platform, though the 771 stars in a short time suggest strong community interest.

// Bottom Line

Portless solves a small but genuinely annoying problem in local development, and it does it with minimal complexity. The one-line integration, the escape hatch, and the "it just works with most frameworks" approach are all signs of good developer tooling design. The agent-first thinking is forward-looking: as AI coding agents become standard parts of the dev workflow, the tooling around them needs to provide stable, predictable interfaces. Named localhost URLs are a simple step in that direction.

For teams running monorepos, multiple microservices, or working heavily with AI coding agents, Portless is worth trying. It's a npm install -g and a one-line package.json change to evaluate.

Latest