Go back

Forget localhost:3000: meet Portless πŸ”Œ

Portless replaces local ports with stable .localhost domains and supports HTTPS and Git Worktrees.

Forget localhost:3000: meet Portless πŸ”Œ

Ever started a project only to find that port 3000 is already occupied by another process? Or spun up the frontend, backend and microservices until local development turned into a game of β€œremember which port the API is running on”?

To solve that pain, Vercel Labs has released Portless.

The idea is simple: Portless acts as a local proxy and replaces numeric ports with clear, stable, named .localhost domains.

What it does and why it’s useful:

  • Names instead of ports: rather than localhost:3000 and localhost:8080, you get URLs such as myapp.localhost or api.myapp.localhost.
  • No chaos after restarts: the URL stays the same.
  • Local HTTPS out of the box: it can pick up local TLS certificates. This makes life much easier when testing OAuth authentication, Service Workers, cookies with the Secure attribute, or APIs that require a secure context.
  • Git Worktrees support: if you develop on several branches in parallel, Portless can automatically isolate domains by branch (for example, fix-ui.myapp.localhost).

How to use it:

It takes literally one line through the CLI or integration into npm scripts:

// package.json
"scripts": {
  "- dev": "next dev",
  "+ dev": "portless run next dev"
}

The tool runs locally, does not expose open ports to the outside world, and sends nothing to the internet.

If you frequently run several services at once or constantly struggle to find free ports, it is definitely worth trying.

Website and documentation

Copied