mobile phone
Articles » How to access localhost on a mobile device.

How to access localhost on a mobile device.

1 February, 2022

In this guide we will follow the steps below that will allow us to view our website running on our localhost server on a mobile device, or any device that is not physically connected to our localhost machine as long as we are on the same network.

  1. Start up your website/app on your localhost server.
  2. Get your localhost IP address.
  3. Configure the firewall to open any required ports.
  4. Test localhost access on your mobile device.

Start up your website on your localhost server

In my case, I am running a local VueJS app on localhost which shows me that my app/website is running and accessible on http://localhost:8081/ or

IP and port screen shot

In your case, this could be a php website, a React JS app, etc. The main thing is to ensure that your website or app is accessible through http://localhost.

Get your localhost IP address

Now we need to find the IP address of our localhost. As shown above, this is already provided to us by the Vue JS CLI which is

However, if this is not the case for you, a quick way to obtain the localhost IP address is the following.

  1. Open the Command Prompt.
  2. Type in “ipconfig” and press Enter.
  3. Look for the Wireless LAN adapter Wi-Fi which will show you the IPv4 Address.


Configure the firewall to open any required ports - Windows 10

Next, we have to open the required firewall ports to access our website or app on a mobile device.

  1. Go to “Control Panel” -> “Windows Defender Firewall”.
  2. Click “Advanced Settings”.
  3. Select “Inbound Rules”.
  4. Click “New Rule…” on the right side of the window.
  5. Select “Port” and click “Next”.
  6. Select “TCP or UDP” and choose “Specific local ports”. Usually TCP is fine for the ports we want to open to access our localhost such as port 8080.
  7. Enter the ports you want to open and click “Next”. In my case, my app is served on so I will enter 8081.
  8. Select “Allow the connection” and click “Next”.
  9. Check the connection settings you see fit such as Domain, Private, or Public and click “Next”.
  10. Give a name and description to the new rule and click “Finish”.

Test localhost access on your mobile device

On your mobile device, open your browser and navigate to your localhost IP address and include the port as well if required.

You should now be able to see your website or app on your mobile device.

Post your comment


No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments