Using LocalCan with Laravel Herd sites
A guide to configure Local Domains and Public URLs for Laravel development
Using Public URLs with Laravel Herd
You can use either your Custom domain, subdomain of localcan.dev
, or Cloudflare Quick Tunnels in LocalCan to point to your Laravel Herd site and enjoy traffic inspection and Basic Auth (and no monthly costs!).
-
Create domain
In LocalCan, create a Domain with proxy and set the target server as your site, e.g.
http://myapp.test:80
orhttps://myapp.test:443
. -
Set Host header
On the domains list, click the "…" menu and choose Edit domain.
Scroll down to the Advanced Settings section, choose the Public URL tab and set the Host header to Target Server Host. This will ensure Laravel Herd knows which site to serve.
-
Create Public URL
Using Local Domains with Laravel Herd
To make it work, it's necessary to avoid port conflicts between LocalCan and Herd. Choose one of these two options:
Option 1: Edit Herd site to use a different HTTPS port
This option keeps HTTPS in both LocalCan and Herd, but moves Herd to a different port:
- Close Herd completely (quit the app, not just minimize).
- Open your site's Nginx config file:
/Users/<user>/Library/Application Support/Herd/config/valet/Nginx/<site-name>.test
. - Edit the line
listen 127.0.0.1:443 ssl;
by changing the port from 443 to, for example, 8443. - Save the file and launch Herd.
- In LocalCan, create a domain pointing to
https://<site-name>.test:8443
. - Make sure HTTPS proxy is enabled in LocalCan's settings.
Option 2: Make your Herd site HTTP-only
This option uses HTTPS in LocalCan but HTTP in Herd:
- In Herd, click Unsecure the selected site.
- Close Herd completely.
- In LocalCan, ensure the HTTPS proxy is enabled (if it's red, toggle it off and on).
- Launch Herd.
- In LocalCan, create a domain pointing to
http://<site-name>.test:80
.
In either options make sure to set the Host header to Target Server Host in the Advanced Settings section, in the Local Domain tab. This will ensure Laravel Herd knows which site to serve.
Additional steps
If you your app uses <site-name>.test
address somewhere in its source code, you may need to replace it with the <site-name>.local
domain or use relative paths, so that domain is not hardcoded.
© 2025 LocalCan™. All rights reserved.