How to Expose Localhost to the Internet
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://my-application.eu.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://localport.io/install.sh | sh
This takes about 10 seconds. It downloads a single binary file, with no runtime and no dependencies.
2. Get a token#
Sign up at dashboard.localport.io and create a tunnel. Copy its token.
3. Start the tunnel#
localport http 3000 --token YOUR_TOKEN --region eu
Replace 3000 with whatever port your app runs on.
4. Share the URL#
You'll see a URL like https://my-application.eu.localport.dev. Open it in your browser and 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 answering at once. It is the same URL the next time you start the tunnel.
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 | A flat price per team. See pricing |
| Works when your computer is off | Yes | No |
Tunneling is for development and sharing. Deploying is for production.
Is it secure?
FAQ#
Does my computer need to stay on? Yes. The tunnel is active as long as the CLI is running. Close your terminal or shut down your computer, and the tunnel closes.
Does the URL change? No. The URL belongs to the tunnel and stays the same across restarts. You can choose the subdomain in the tunnel's settings or attach your own domain.