· NGSRV Team

How to expose localhost:5000 to the internet

Most guides assume port 3000. Flask listens on 5000 out of the box. A few Node starters use it too. This page is for 5000 specifically.

Flask listens on 5000 out of the box. A few Node starters use it too. The tunnel does not care what framework you run. It forwards HTTPS to whatever is bound on 5000.

Quick start

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

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

What usually runs on 5000

  • Flask
  • some Express templates

Typical dev command: flask run

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 5000:

ngsrv http 5000

Sample output:

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

Stable subdomain (optional)

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

ngsrv http 5000 --subdomain flask-app
# -> https://flask-app.tnl.ngsrv.com

When it breaks

connection refused — Nothing is listening on 5000. Confirm with lsof -i :5000 (macOS/Linux) or netstat -ano | findstr :5000 (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.