Blog · 12 November 2026
How to open your localhost app on your phone
Your app runs on your laptop at localhost:3000. You type the same address into your phone, and it doesn't load.
Nothing is broken. localhost always means "this device", so your phone is looking for the app on itself, finds nothing and gives up. To reach your laptop, the phone needs a different address. There are three ways to give it one.
Way 1: Use your laptop's address on the same Wi-Fi
This is the quickest, and it's free. It only works while your phone and laptop are on the same Wi-Fi.
1. Find your laptop's address on the network. It looks like 192.168.1.23.
- Mac: open System Settings, then Wi-Fi, then Details next to your network. Or run
ipconfig getifaddr en0in the terminal. - Windows: run
ipconfigand look for IPv4 Address.
2. Make your app listen to the network, not just your laptop. Many tools only listen to your own computer by default.
| Your app | Start it like this |
|---|---|
| Vite or React with Vite | npm run dev -- --host |
| Next.js | npm run dev (it prints a Network address) |
| Astro | npm run dev -- --host |
| Express | Usually fine as it is |
| FastAPI | uvicorn main:app --host 0.0.0.0 --port 8000 |
| Flask | flask run --host=0.0.0.0 |
Many of these print the address to use, often labelled Network.
3. Open it on your phone. Type http://192.168.1.23:3000, with your laptop's address and your app's port. If your computer asks whether to allow incoming connections, say yes.
What usually goes wrong on the phone
The page loads, but something doesn't work. These are the usual reasons:
- The page still calls localhost. If your frontend fetches data from
http://localhost:8000/api, the phone looks for that on itself. Ask your coding agent to use a relative address like/apiinstead. It's the same problem that breaks apps once they're live, which we cover in why apps break when you deploy them. - Sign-in with Google or GitHub fails. Those services send people back to the address you registered, usually localhost.
- The camera, microphone or location don't work. Browsers only allow those on secure
httpspages, and a192.168…address isn't one. - It works at home and not at the café. Different Wi-Fi, different address. Office and public Wi-Fi often block devices from reaching each other at all.
Way 2: Use a tunnel
A tunnel gives your laptop a temporary public link, so your phone can open it from anywhere, even on mobile data. It also gives you https, which fixes the camera problem.
It's good for testing for an afternoon. It stops when your laptop sleeps, and free links often change each time. We compared tunnels with making an app live.
Way 3: Make it live
If you want to keep opening it on your phone, or send it to someone, put the app on a computer that's always on. That's what deploying means. You get a link that works on any phone, on any network, with your laptop closed.
With Toupas, paste this into your coding agent (Claude Code, Codex or Cursor):
Make this app live with Toupas. Instructions: https://toupas.com/agents.md
You get a link like yourapp.toupas.app with https included. Every new app is free for 30 days, with no card. Our guide to deploying an app from localhost explains what happens along the way.
Building a phone app?
If you're building an app for the App Store or Play Store, with React Native, Expo or Flutter, this is a different job. Those apps are published through Apple and Google. Toupas makes websites and web apps live, including the server and database a phone app talks to. A web app also works well on phones, and people can add it to their home screen.
Questions
Why does localhost not work on my phone?
localhost means the device you're using. On your phone it points to the phone, not your laptop. Use your laptop's network address on the same Wi-Fi, a tunnel, or a live link.
How do I open localhost:3000 on another device?
Find your computer's network address, such as 192.168.1.23, and make your app listen to the network (for Vite, npm run dev -- --host). Then open http://192.168.1.23:3000 on a device on the same Wi-Fi.
Why does my app open on my phone but show no data?
The page probably still fetches from a localhost address, which on your phone points to the phone. Use a relative address like /api, or the laptop's network address.
How do I test my app on my phone away from my Wi-Fi?
Use a tunnel for a quick test, or make the app live so it has a link that works anywhere.
Paste this into your coding agent
Make this app live with Toupas. Instructions: https://toupas.com/agents.md