Access project via IP / LocalHost

  • | 234 points


    I have found several topics regarding my issue but have been unable to resolve it.

    I have auto virtual hosts enabled creating a http://myproject.test link which is working fine. But I wish to be able to access the page via http://localhost/myproject. Unfortunately this is giving me a 404 page.

    Reason I wish to be able to resolve this is, I would like to test from my mobile device without having to use ngrok sharing.

    How would I be able to access my project via the localhost address?



  • | 9762 points

    Yes, you can access your development PC using a mobile device on the same network.

    You need the IP address of your development PC, open terminal and type IPCONFIG. Make a note of the IPv4 address e.g. IPv4 Address. . . . . . . . . . . :

    Start Laragon, and click Start All. Wait for Apache (or NGINX) to start.

    Click Web. The web page will open with a Laragon message. Still, on your dev PC in the address bar type in the IP address you noted earlier, e.g. hit enter and you will see the same Laragon screen. Finally, try that IP address on your mobile.


    To access subfolders, they must contain a file named index.php or index.html. You navigate to the same IP address as before, with the directory name. e.g.


    To see the Laragon page on your mobile, you must be on the same network as your PC, it doesn't matter if the PC is wired and the mobile phone is using WiFi, as long as they are on the same internal network. It will not work if your mobile is on a mobile network (3g/4g). When you first launch Laragon you need to allow Apache through your windows firewall too.

  • | 234 points

    Hi @Pen-y-Fan,

    Thanks for your comment, so actually the method you mention is what I expected to work. Unfortunately I'm only able to access the Laragon welcome page. All the project pages are not reachable other than by using the pretty url. Neither when I enter the full address including the index.php file.

    I didn't face this issue using XAMPP, so my thought is, it has something to do with Laragon.



  • | 116 points


    you must change ports in Laragon. If u use automatically create virtual hosts, u see all of this host will be in same port (normaly 80 or 443 for SSL). You can do that with adding other port to your project. For me working adding in {Laragon folder}/etc/apache2/sites-enabled conf file (without prefix auto in filename) with copied host contents and changing port's. After reload apache you can going in browser to your project with local_ip:port_u_use.

  • | 25 points

    @Pen-y-Fan It shows me 403 Forbidden while accessing it on my phone with ip address on nginx. Any Idea?

  • | 9762 points

    @back2Lobby sorry I don't know much about nginx. I googled 403 forbidden nginx and it could be firewall or config related. For example

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.