How to access Localhost on your mobile device?

featured Image

This article is about how to access Localhost on your mobile browsers and view the website running on your Localhost from your mobile in real-time.

So, if you are working on a website or a web application and want to view the pages on your mobile, this article will help you do that easily.

Generally when we develop a website and want to check its responsiveness, we usually open our Chrome inspect tools and check the mobile view in our desktop browser itself.

However, sometimes we need to check the touch event or other events which is only possible on a real mobile device. So for that accessing Localhost from our mobile device becomes important.

Access Localhost on your mobile browsers.

To access your localhost from your mobile follow the steps below:

Step 1: Connect your Phone to the same Network

First, make sure that your computer and your mobile device are connected to the same Wifi Network. This is very important.

Step 2: Start your Development Server

Start your application on your local machine first. Once it opens in your browser, you will get the URL as localhost:3000, now write down the post number which is 3000 in this case.

access localhost in mobile device

Step 3: Find your computer’s local IP Address

Open the command prompt, type this command, ipconfig and press Enter. You will get lots of information on the screen but we only need the IPv4 address. The IPv4 address looks like 192.164.45.1.

IPv4 address will different in your PC.

cmd ipconfig

If you are thinking about “How to find my local IP address in Linux and Mac”, see the instructions below.

In Linux, run this in your terminal: hostname -I or ifconfig command.

In Mac, Open System Preferences > Network. Then in the Wi-Fi tab, under the status, you will see your IP address.

Step 4: Open Mobile device Browser

Once you have the Port Number and the IPv4 address.

Open your mobile or tablet browser and type IPv4 Address: PORT. For example 192.164.45.1:3000

That’s it, now you can test your web application on your mobile device in real-time.

Related Posts

git commands with example

Top 40 Git commands with Examples

GitHub has become an essential tool for developers to manage, store, and collaborate with other developers on software projects. With its simple powerful git-based version control system, GitHub allows users…

Read more
Check GitHub Account in the Terminal

Check GitHub Account in the Terminal

GitHub is an integral tool for developers to store, manage, and collaborate on software projects with other developers. And as we work more and more in the command line it…

Read more
featured Image

How to make list of objects in Netlify CMS using list and object Widget

Here in this Netlify CMS tutorial we will how easily we can make a list of objects using list and object widgets. This will allow us to add multiple objects…

Read more