DEV Community

Cover image for Access Localhost from Smartphone with help of VS Code and Live Server
B Kanhu Charan
B Kanhu Charan

Posted on • Updated on

Access Localhost from Smartphone with help of VS Code and Live Server

Responsive Web design, well I know the developer console is a greater tool for debugging. and it gives you an option to check the responsiveness of your webpage. but checking it on a real device is always better.
So how to do it without too much hassle? The simple answer is with help of VS Code and Extensions called Live Server.

Before proceeding make sure your laptop and mobile device are connected to the same wifi.

For this, you need to install VS Code from here. And Live Server Extensions by Ritwick Dey from here.

After installing open your project folder on VS Code. You can do it by "drag-and-drop" or by navigating to "File > Open Folder".

Then open index.html and right-click on Editor, from the "Explorer Window" choose "Open with Live Server".


Remember the port, on which the live server is running.


Now open "Command Prompt" on windows and type ipconfig hit Enter. Check the IP Address.

Now open your favorite browser on your smartphone and on the address bar enter the IP Address of your Computer and port of the local server. after that file name. like http://ip_address:port/filename for example, mine would be:


Top comments (4)

8koi profile image

I want this but with something like React/Next, any idea? not even sure how to search for it :c

bkanhu profile image
B Kanhu Charan

Hey, this method is also applicable to React/Next JS. You won't require Live server in this case, as you can simply use npm run dev. To access the application from another device, visit http://ip_address:port in your web browser.

faridulhassan profile image
Faridul Hassan

It works.
Thank you.

gracechinelo profile image

Thank you so much, I got it up and running