· NGSRV Team

How to expose localhost:9000 to the internet

You have something listening on port 9000 and need a link you can paste into Slack, a webhook dashboard, or your phone. This is the copy-paste path.

PHP's built-in server and a few other tools pick 9000 when 8000 is busy. The tunnel does not care what framework you run. It forwards HTTPS to whatever is bound on 9000.

Quick start

curl -fsSL https://get.ngsrv.com | bash
ngsrv token <YOUR_TOKEN>
ngsrv http 9000

You get a public URL like https://furry-otter-1842.tnl.ngsrv.com that routes to http://localhost:9000.

What usually runs on 9000

  • PHP built-in server
  • SonarQube local
  • misc services

Typical dev command: php -S localhost:9000

Install the CLI

# macOS (Homebrew)
brew install ngsrv/tap/ngsrv

# macOS / Linux
curl -fsSL https://get.ngsrv.com | bash

# Windows (PowerShell)
irm https://get.ngsrv.com/windows | iex

Sign up at ngsrv.com/register if you need a token. Free tier, no card.

Run the tunnel

With your server already up on port 9000:

ngsrv http 9000

Sample output:

forwarding  https://furry-otter-1842.tnl.ngsrv.com -> http://localhost:9000
status      online

Stable subdomain (optional)

Random names change when you restart. For webhooks or client previews, reserve one:

ngsrv http 9000 --subdomain php-dev
# -> https://php-dev.tnl.ngsrv.com

When it breaks

connection refused — Nothing is listening on 9000. Confirm with lsof -i :9000 (macOS/Linux) or netstat -ano | findstr :9000 (Windows).

401 invalid token — Re-run ngsrv token <YOUR_TOKEN> from the dashboard.

Tunnel drops — ngsrv reconnects on its own. Persistent drops usually mean VPN or proxy interference.