Nico Deblauwe

Shifting from Laragon to Herd on Windows

Created April 10, 2024

This article compares Laragon and Herd, both excellent PHP development tools, and provides tips on transitioning between them.

Herd is a solid environment emphasizing ease of use over configurability. This design choice is both its biggest strength and weakness, but I’m pretty sure that a few more iterations (and releases) will bring it soon to a point of the perfect balance.

Dev environments are handcrafted

You probably know the feeling, setting up a local development environment to your preference can take several months and many rounds of tweaks. And, during a computer switch or reset, typically some of these improvements might be lost if they were not documented, making one hesitant to make changes.

Laragon has been one of my trusted collaborators for years. Despite its imperfections, we've worked together long enough to understand each other's strengths and potential. I've found solutions or workarounds for all situations encountered so far, including multi-tenant apps with multiple local domains or adding new experimental PHP extensions.

I wasn't planning to switch environments, but curiosity about Herd led me to try it when I switched laptops.

Installing Laravel Herd

Starting with a clean slate allows for a straightforward setup of your new environment without having to worry about incompatibilities. It's a chance to embrace the capabilities of Herd, right off the bat.

Herd offers a free and paid pro version. While the free version is sufficient for basic developments, especially with Laravel 11 leaning towards Sqlite, it lacks support for MySql. This led me to choose the Pro plan, but know that you can also install MySql for free yourself.

Installation is simple: You just download one file and run it. If needed, there are plenty of YouTube videos explaining this. Unlike Laragon, Herd doesn't come with related tools, so I separately installed HeidiSQL and Cmder, no need for the software bundled with Laragon. This resulted in a more minimal (and customizable) setup.

Adding apps to Herd

Adding a project involves adding a directory to the Herd folder, which is customizable. I moved it to D:\HERD\. Like Laragon, Herd handles adding the domain to etc/hosts and creating the NGINX configuration. So an app in the \mygreatapp directory becomes immediately availabe on mygreatapp.test. Securing the domain (SSL) is as simple as clicking an icon and confirming (up to four times :-)).

When working on multi-domain sites (e.g. multi-tenant apps), a bit more flexibility is needed, e.g. to add or change configuration parameters. I couldn’t find (and would prefer) buttons for editing the etc/host manually, and accessing the sites-enabled directory. The same for a quick access button to the NGINX configuration file for each site. Small things, and not often needed, but having (and using) it with Laragon, makes me miss it here.

For the multi-domain basic use case, you can use the Herd CLI with the herd link command. Simply go to the directory for which you want an alias, mygreatapp for example, and type herd link tenantdomain to have the mygreatapp app also available from tenantdomain.test. Alternatively, you could create a softlink in the Herd path (ln -s mygreatapp tenantdomain), but as far as I can judge it's better to use the Herd CLI. And you can use herd unlink to remove an additional domain again.

If you need to make other changes, look for the configuration in %USERPPROFILE%\.config\herd\config\valet\NginX.

Built-in services

Herd includes additional services like a log viewer, dump viewer, and mail service. However, the mail service conflicts with others like HELO, by claiming port 2525 by default. I'd prefer to switch off the mail service or integrate with HELO. It would e.g. be enough for it to launch automatically when Herd starts, if selected by the user.

I'm also looking forward to trying xdebug soon. Until now, the complicated configuration deterred me, but Herd promises an easy setup. It needs however to be said, Laravel Ray has been sufficient for most use cases, so I'm unsure about xdebug's added value (for me). And, while we are at it, Ray replaces the (added value of a) dump server, with a lot more functionalities. So a similar switch like with mail and HELO could be thinkable.

Transitioning cookbook

Transitioning is not as daunting as it seems. All I did was clone a git repository in my Herd folder. The subsequent steps (composer install, npm install, configuring the .env, setting a key, seeding dummy data, …) are the same as with Laragon. And don’t forget, of course, any other custom actions described in the readme.MD file.

Connecting to the MySql database via HeidiSQL was smooth, and other tools like Laravel Ray worked out of the box. This means there's no need for a "cookbook" for switching to Herd.

And, lets be honest, switching is the ideal smoke test for your installation scripts or steps listed in the readme.MD file of your repo.

The verdict

Laragon offers nearly unlimited configurability but at the cost of complexity. For example, switching to a new PHP version takes me about 30 minutes and requires consulting the documentation. In contrast, Herd simplifies this process to a single click, an addictive simplicity.

Laragon is free, while Herd costs 99 EUR. A free version of Herd exists, but without MySQL, it feels too limited. As a web development teacher, I'd love to see an academic version that has at least MySQL included for free. Or with all the services at a reduced price, and/or the possibility for monthly licenses.

Herd is stable and complete. It includes most of the functionalities that you will ever need. Power users may miss some direct access buttons to configuration files, and the built-in services could use a bit more flexibility or configurability.

Despite the higher price and need for some further refinement, I quickly adopted Herd as my new standard environment for local development. Like any new tool, there's a learning curve, but over time, your development process will become more streamlined and efficient, because you have to spend less even less time in configuring your tooling.