DEV Community

Ankit Verma
Ankit Verma

Posted on

3

How to Serve a Laravel Project on Your Local Network

Before you start, make sure you have:
Both devices (your pc/laptop and your phone/other device) connected to the same Wi-Fi network

Step 1: Find Your Local IP Address

Open your terminal and run this command:

ipconfig getifaddr en0
Enter fullscreen mode Exit fullscreen mode

This returns something like: 192.168.29.247
This is your local IP address — other devices on the same network can use this to reach your system.

Step 2: Serve Laravel Using PHP’s Built-In Server

Navigate to your Laravel project root folder:

cd path/to/your-laravel-project
Enter fullscreen mode Exit fullscreen mode

Then run the following command:

php -S 192.168.29.247:8080 -t public
Enter fullscreen mode Exit fullscreen mode

Note:

  • php -S starts the built-in PHP server
  • 192.168.29.247 is your system IP address
  • 8080 is the port (you can use another, like 8000)
  • -t public tells PHP to serve files from Laravel’s public/ folder

You should now see something like:

PHP 8.x Development Server started at http://192.168.29.247:8080
Enter fullscreen mode Exit fullscreen mode

Step 3: Access the App from Another Device

On your phone or another computer connected to the same Wi-Fi, open a browser and go to:
http://192.168.29.247:8080
Now your Laravel app running.

Optional: Adjust Firewall Settings (If Needed)

If you're unable to access the app from another device:

  • Go to System Firewall Settings
  • Ensure incoming connections are allowed for Terminal or PHP

Heroku

Deploy with ease. Manage efficiently. Scale faster.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (0)

Survey image

Calling All Cloud Developers - Your Insights Matter

Take the Developer Nation Survey and help shape cloud development trends. Prizes await!

Join Today