Using a http://192.168 address for a local laravel rest API

Im upgrading from laravel 7 to laravel 8 and Im trying to make a http request to a laravel API hosted locally. If I use http://localhost or, the requests give a response. But if I use a http://192.168.x.x address, I get an error Error: connect ECONNREFUSED. How do I use http://192.168.x.x ?


Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Access Laravel project over a network using IP

1- Identify your IP Address

on windows

on linux

2-Run your project
php artisan serve –host= –port=8000

3-Access your project via browser (on remote)

Possible Issues:

If your firewall is enabled, remote system might me blocked access.
– for this, you can either disable firewall completey on your local system
– or, enable certain port
In linux to allow a port

ufw status
ufw enable 8000

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Notify of

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x