Allow Hosting Laravel Applications Locally on the Network with Herd #1197
Replies: 5 comments 1 reply
-
|
I recently purchased Laravel Herd Pro, and I'm quite disappointed to find out that this functionality is not available out of the box. I hope the team considers adding this as a default feature in the future. |
Beta Was this translation helpful? Give feedback.
-
|
i have the same issue , so is their another way to resolve it ? |
Beta Was this translation helpful? Give feedback.
-
|
The difficulty with this request is that Herd serves applications via their local |
Beta Was this translation helpful? Give feedback.
-
|
Until Herd supports LAN binding natively, here’s a simple workaround to expose specific projects on specific ports (e.g., http://192.168.1.70:5001 → project-x.test, :5002 → project-y.test). This is Windows-focused, but the idea is the same elsewhere.
Repeat for 5002 → anothersite.test, etc.
Now you can host any site you have at any custom port. (providing you have the port available) Happy development! |
Beta Was this translation helpful? Give feedback.
-
|
My solution is based on this https://laravel.com/docs/12.x/valet#sharing-sites-on-your-local-network In my Windows 11 computer i have a Herd secure site for example backup edit server {
- listen 127.0.0.1:80;
+ listen 80;
#listen 127.0.0.1:80; # valet loopback
server_name lan-only.test www.lan-only.test *.lan-only.test;
return 301 https://$host$request_uri;
}
server {
- listen 127.0.0.1:443 ssl;
+ listen 443 ssl;
#listen VALET_LOOPBACK:443 ssl; # valet loopback
server_name lan-only.test www.lan-only.test *.lan-only.test;
root /;
charset utf-8;
client_max_body_size 512M;
http2 on;
+ allow 127.0.0.1;
+ allow 192.168.1.33; # <--- THIS IS ANOTHER LOCAL DEVICE IP
+ deny all;
location ~* /<hash-string>/([A-Z]+:)(.*) {
internal;
alias $1;
try_files $2 $2/;
}
# OTHER CODE BELOWSave this file and go to Herd Dashboard restart all services and also in this computer firewall allow port 80, 443 come to If an IP not in the above You shouldn't open the WAN port 80, 443 in your router. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Title: Allow Hosting Laravel Applications Locally on the Network with Herd
Body Content:
I have been using Laravel Herd for local development and have found it to be an excellent tool for running Laravel applications. However, I have encountered a limitation when attempting to host my Laravel application locally on the network.
In a traditional setup using the
php artisan servecommand, we can specify the host IP to serve the application on the local network, allowing other devices on the same network to access the application. For instance:This feature is especially useful in scenarios like:
Currently, Laravel Herd does not provide an option to configure the host IP or expose the application to the local network. It would be highly beneficial if Herd could support this feature, either by extending the existing functionality or by providing an additional configuration option in its setup.
Suggested Solution:
Benefits:
I hope this feature can be considered for a future release, as it would make Laravel Herd an even more versatile tool for local development. Thank you for your efforts in maintaining this project!
Looking forward to your feedback on this suggestion.
Beta Was this translation helpful? Give feedback.
All reactions