Guides

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!).

  1. Create domain

    In LocalCan, create a Domain with proxy and set the target server as your site, e.g. http://myapp.test:80 or https://myapp.test:443.

  2. 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.

  3. 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:

  1. Close Herd completely (quit the app, not just minimize).
  2. Open your site's Nginx config file: /Users/<user>/Library/Application Support/Herd/config/valet/Nginx/<site-name>.test.
  3. Edit the line listen 127.0.0.1:443 ssl; by changing the port from 443 to, for example, 8443.
  4. Save the file and launch Herd.
  5. In LocalCan, create a domain pointing to https://<site-name>.test:8443.
  6. 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:

  1. In Herd, click Unsecure the selected site.
  2. Close Herd completely.
  3. In LocalCan, ensure the HTTPS proxy is enabled (if it's red, toggle it off and on).
  4. Launch Herd.
  5. 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.