Home / Localhost / Open from your phone

Open localhost from your phone or another computer

localhost only means “this device”. Use your computer’s IP address and start the server on all network addresses.

A phone and a computer on the same Wi-Fi: the phone opens the computer’s IP address and port

On your phone, localhost means the phone itself, so your computer's site will not open there. Use your computer's IP address instead, and make sure the server accepts outside connections.

Steps to open it on your phone

  1. Connect both devices to the same Wi-Fi.
  2. Find your computer’s IP address (commands below). It looks like 192.168.1.25.
  3. Start your server so it accepts outside connections (examples below).
  4. On the phone, open http://192.168.1.25:PORT with your own IP and port.
  5. If it hangs, allow the program through the firewall. On Windows, choose Private networks when asked.

Commands you can copy

Windows: find your IP
ipconfig
macOS: find your IP (Wi-Fi)
ipconfig getifaddr en0
Linux: find your IP
hostname -I
Vite
npm run dev -- --host
Next.js
npm run dev -- -H 0.0.0.0
Django
python manage.py runserver 0.0.0.0:8000
Flask
flask run --host=0.0.0.0

If it still does not work

Phone cannot reach it on guest Wi-Fi
Guest networks often block devices from talking to each other. Use the main network.
Works for you, not others
Only do this on trusted networks. Opening a dev server to the network exposes it to everyone on that Wi-Fi.

Questions about Open from your phone

Why does localhost not work on my phone?
On your phone, localhost means the phone itself, not your computer. Use your computer's IP address.
What is 0.0.0.0 for?
Starting a server on 0.0.0.0 makes it accept connections from other devices on your network, not only from your own computer.

Updated 2026-10-02

Free tools that help

Config generators for this

Related pages