DEV Community

Cover image for Access Laravel Projects on a Local Network
Rafli Zocky
Rafli Zocky

Posted on • Originally published at Medium

Access Laravel Projects on a Local Network

Made for those tired of running php artisan serve locally. Examples with XAMPP and Laragon. Should work for other PHP frameworks too.

Steps

1. Place your Laravel projects in your web server directory:

# XAMPP
C:\xampp\htdocs\project1

# Laragon
C:\laragon\www\project1
Enter fullscreen mode Exit fullscreen mode

2. Open httpd.conf and add:

# XAMPP
Listen 8001
<VirtualHost *:8001>
    DocumentRoot "C:/xampp/htdocs/project1/public"
    <Directory "C:/xampp/htdocs/project1/public">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

# Laragon
Listen 8001
<VirtualHost *:8001>
    DocumentRoot "C:/laragon/www/project1/public"
    <Directory "C:/laragon/www/project1/public">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
Enter fullscreen mode Exit fullscreen mode

3. Uncomment if not already:

LoadModule rewrite_module modules/mod_rewrite.so
Include conf/extra/httpd-vhosts.conf
Enter fullscreen mode Exit fullscreen mode

4. Restart Apache, then access via browser:

http://10.198.210.184       → Project 1
http://10.198.210.184:8001  → Project 2
http://10.198.210.184:8002  → Project 3

# or use localhost:port
Enter fullscreen mode Exit fullscreen mode

FAQ

Can't access it? Check:

  • Firewall → Allow incoming connections on ports 80, 8001, 8002
  • 403 Forbidden → Ensure AllowOverride All and Require all granted are set, check folder permissions
  • Routes not working → Ensure mod_rewrite is enabled, verify DocumentRoot points to the public folder

Need help building your app?
I'm available for freelance web & Android development — raflizocky.netlify.app

☕ Support my writing: paypal.me/raflizocky · saweria.co/raflizocky

Top comments (0)