How to Expose Localhost to the Internet (The Simple Way)
A beginner-friendly guide to making your local web app accessible from anywhere. No deployment, no cloud servers, no devops knowledge required.
You built something on your computer. Maybe a website, an API, or a prototype. It works at localhost:3000. Now you want someone else to see it — a friend, a client, your team. But "localhost" only works on your machine.
Here's how to give it a public URL in about 60 seconds.
What "localhost" means
When you run a web app locally, it listens on a "port" — like localhost:3000. The word "localhost" is your computer talking to itself. Nobody else on the internet can reach it because your router and firewall block all incoming connections by default.
The fix: a tunnel
A tunnel creates a path from the public internet to your computer. When someone visits a URL like https://abc123.tunnel.localport.dev, the traffic goes through Localport's servers and arrives at your localhost:3000.
You don't deploy anything. You don't change any settings. You run one command.
Step by step
1. Install Localport
curl -fsSL https://get.localport.dev | sh
This takes about 10 seconds. It downloads a single binary file — no runtime, no dependencies.
2. Get a token
Sign up at dashboard.localport.io (free, no credit card). Create a tunnel and copy the token.
3. Start the tunnel
localport tunnel --token YOUR_TOKEN --local localhost:3000
Replace 3000 with whatever port your app runs on.
4. Share the URL
You'll see a URL like https://abc123.tunnel.localport.dev. Open it in your browser — you see your local app. Send the URL to anyone and they see it too.
5. Stop when done
Press Ctrl+C. The URL stops working immediately. No cleanup needed.
When you need this
- Showing work to a client without deploying to a staging server
- Testing webhooks from Stripe, GitHub, or Slack that need a real HTTPS URL
- Testing on your phone by opening the URL on a different device
- Sharing with teammates who want to see your changes before they're merged
- Building with AI tools that need a callback URL to reach your local server
How is this different from deploying?
| Deploying | Tunneling | |
| Time to share | Minutes to hours | Seconds |
| Reflects local changes | After redeploy | Instantly (it's your live local server) |
| Needs a server | Yes | No |
| Costs money | Usually | Free tier available |
| Works when your computer is off | Yes | No |
Tunneling is for development and sharing. Deploying is for production.
Is it secure?