· NGSRV Team

How to expose localhost:7860 to the internet

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

Gradio ships ML demos on 7860. Common in quick Python prototype work. The tunnel does not care what framework you run. It forwards HTTPS to whatever is bound on 7860.

Quick start

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

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

What usually runs on 7860

  • Gradio
  • some ML demo UIs

Typical dev command: python app.py

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

ngsrv http 7860

Sample output:

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

Stable subdomain (optional)

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

ngsrv http 7860 --subdomain gradio-demo
# -> https://gradio-demo.tnl.ngsrv.com

When it breaks

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