Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

perkola's avatar

localhost not accessible from mobile

While developing and testing i start my local development server like this php artisan serve --host=0.0.0.0 --port=8080 which results in Laravel development server started on http://0.0.0.0:8080

I am able to access the server from all desktop computers in my home network but not from my mobile phone. Why is that?

I have opened port 8080 in the WAN settings on my routes and it works fine with desktop computers, but not with mobile phones.

0 likes
14 replies
DPatel's avatar

Is your mobile connected to wifi on the same network as the desktop computers? If not you will also need to set up port forwarding on your router to the computer that is running the server instance.

perkola's avatar

@DPatel yes my mobile phone is connected to the same network as the desktop computers. Can it be something with the DNS-lookup on my phone?

bobbybouwmann's avatar

If you are on an Android you can do something like this: settings -> applications -> Network Location -> Clear data

jekinney's avatar

Another way is use chrome dev tools. You can click the little mobile phone icon on the top left. You can then choose between hundreds of devices including phones, tablets etc or set the display settings. Bam test the site out with in a few clicks.

perkola's avatar

@blackbird I tried clearing the data but it still does not work. Any other ideas?

@jekinney I am aware of Chrome dev tools and I use it every day. However I want to view my site in development on my phone for various reasons.

1 like
aitiba's avatar

Try to access using the laravel app hosted ip address.

To know which is your local ip. If you are on Gnu/Linux: open a console and type "sudo ifconfig". On windows open a console too and type "ipconfig".

mesqueeb's avatar

Hello Community! I have the same problem, and I have not yet been able to view the local host on my iPhone!

Any advice?

mesqueeb's avatar

I'm looking for a free option to be able to view my laravel dev server on my phone.

Browserstack is too expensive at 60 usd/month.

wavedirect's avatar

For iphone you can connect by ip address with same wifi network.

Prit_Patel's avatar

@wavedirect my PC and mobile also in the same network but not working site in device access with IP Address

Sinnbeck's avatar

@Prit_Patel Please dont revive a 7 year (or 1 if you go by last reply) thread. Instead if you want us to help, you should create a new thread and describe your exact issue. A lot has happened in 7 years

1 like

Please or to participate in this conversation.