Switching to Laravel Herd: A Smoother, Faster, and Smarter Dev Experience

Introduction

Laravel Herd as described on its official website, is a blazing fast, native Laravel and PHP development environment for both Windows and macOS. It includes everything needed to get started with Laravel development, including PHP and Nginx. Once installed, Herd allows developers to immediately begin building Laravel applications.

It is a one-click solution for PHP and specifically Laravel applications, designed to provide a seamless and efficient local development experience.

Traditionally, many backend developers working with Laravel or PHP use tools like XAMPP, WAMP, MAMP, or Laragon. However, these solutions often require more extensive setup, configuration, and manual handling of dependencies such as Node.js. They can also lead to various compatibility issues during development.

Why Switch to Laravel Herd

Cross-Platform Support (Mac and Windows): Herd provides native support for both macOS and Windows, ensuring a consistent and seamless development experience across platforms.

Minimal Configuration: Forget about spending hours configuring your local development environment. Herd requires minimal setup and provides a fast installation process. Essential tools like Composer, the Laravel Installer, and others are installed automatically and made available in your CLI environment.

Built-in SSL Support: Secure your local applications with HTTPS out of the box. Herd automatically generates and manages SSL certificates for your local sites.

Automatic Domain Routing (*.test Domains): After installing Herd, all requests to *.test domains are automatically routed to your local machine. This means you can access your projects directly by visiting project-name.test instead of navigating through localhost/project-name. This eliminates the need for manual host file edits or additional DNS configuration, making local site access seamless and immediate.

Robust Performance: Experience faster performance compared to traditional local development environments like XAMPP or MAMP. Herd leverages native binaries for PHP, nginx, and supporting services, resulting in a more efficient and responsive development setup.

Support for Non-Laravel Projects: Herd isn’t limited to Laravel projects. It can also be used to run other PHP-based applications.

Easily Manage Multiple PHP Versions: Herd supports multiple PHP versions (ranging from PHP 7.4 to PHP 8.4). Switching between versions can be done within seconds, and you can assign specific PHP versions to individual projects. Herd also handles updates seamlessly, notifying you when new versions are available.

Frontend Tooling with NVM: Herd ships with Node Version Manager (nvm), allowing you to easily install, manage, and switch between multiple Node.js versions directly from the terminal or the Herd UI.

Seamless Service Management (Herd Pro): With Herd Pro, setting up and managing services like MySQL, PostgreSQL, Redis, queues, storage solutions, and real-time systems becomes straightforward. Additional features include catching and debugging application emails, accessing and searching through local log files, and integrating Xdebug for enhanced debugging workflows.

External Site Configuration: Easily expose your local projects to the internet using tools like Expose or Ngrok. Herd also offers direct integration with Laravel Forge, making team collaboration and server management simpler.

Optimized Developer Experience: Thousands of developers have praised Herd for revolutionizing local Laravel development. As Caleb Porzio, creator of Livewire and Alpine.js, put it:

“Herd is one of those pieces of software that makes you think, ‘How did we manage without this for so many years?’ It’s golden.”

Getting Started with Laravel Herd

Getting started with Laravel Herd is simple and straightforward.
For this article, we’ll be focusing on the Windows installation process.

Note:
Herd requires Windows 10 or higher and administrator privileges during setup. However, it does not alter any existing services on your system.

Follow these steps to install and set up Herd:

Step 1: Download Laravel Herd

  1. Visit the official Laravel Herd website and click on Download for Windows.

  2. You will be redirected to a “Thanks for downloading Herd!” page. Follow the instructions displayed to proceed with the installation.

After downloading, run the installer as an administrator.
This is necessary for updating your hosts file and mapping directories and linked sites to .test domains.

Once installation is complete, you’ll have a fully functional PHP and Laravel development environment.
You can verify the installation by running the following commands in your terminal:

herd --version
php --version
laravel --version
composer --version
node --version

You can link your existing Laravel or PHP projects either through the Herd UI or the Command Line Interface (CLI).

Linking via the GUI

If you prefer a graphical interface, you can use Herd’s Site Wizard to link existing projects.

  • By default, Herd automatically parks the %USERPROFILE%\Herd directory.

  • Any PHP application inside this directory becomes immediately available via its .test domain.

  • If your projects are located elsewhere, you can add new paths under General > Herd paths by clicking "Add path".

You can add your www directory from WAMP or your htdocs directory from XAMPP as a parked path, as shown in the image below.

Linking via the CLI

You can also manually link projects using the Herd CLI:

  1. Open Command Prompt (CMD) or PowerShell.

  2. Navigate to your project’s directory:

Command Prompt (CMD):

cd %USERPROFILE%\Herd\your-project
herd link
herd link custom-domain

PowerShell:

Set-Location -Path "$env:USERPROFILE\Herd\your-project"
herd link
herd link custom-domain
  • Running herd link without parameters uses the current folder name as the domain name.

  • Running herd link custom-domain allows you to specify a custom domain name.

Once linked, you can access your application via project-name.test or custom-domain.test.

This is particularly useful if you organize your projects across multiple directories and want seamless domain access for all of them.

Tip (If You Don’t Have Herd Pro): Using phpMyAdmin for Managing MySQL

If you're not using Herd Pro, you won't have access to Seamless Service Management, which means you can't easily set up and manage services like MySQL, PostgreSQL, Redis, and queues directly within Herd.

So how can you work with these services?

  • For simple use cases, SQLite can be managed locally without any external services.

  • For more complex databases like MySQL, PostgreSQL, MongoDB, or Redis, you have a few options:

    • Download and install the service manually from the vendor.

    • Use a free third-party tool like DBngin to manage these database services locally.

    • Or upgrade to Herd Pro for built-in service management.

In this section, I’ll show you how to manage MySQL using phpMyAdmin alongside Herd, which is a great option if you don’t have Herd Pro.

I. Download phpMyAdmin

Visit the official phpMyAdmin website and click the Download button at the top right corner to get the latest release.

After downloading, extract the ZIP file to your desired directory.

Then, link it as a Herd project using the method explained earlier in this article. Once linked, you’ll be able to access phpMyAdmin via phpmyadmin.test in your browser.

Note: Ensure that a MySQL service is already running on your system, whether through DBngin or any other tool. This setup assumes an existing local MySQL installation or service that was running prior to switching to Herd.

Conclusion

Laravel Herd has proven to be a reliable all-in-one solution for PHP, Laravel, and other PHP frameworks. It offers faster performance and a smoother setup experience.

Will you be switching from Laragon or your current local server to Laravel Herd?

For more information, explore the official docs: herd.laravel.com/docs/windows

If you're a PHP or Laravel developer looking for a Smoother, Faster, and Smarter Dev Experience, Laravel Herd is built for you.

Start using Laravel Herd today!

10
Subscribe to my newsletter

Read articles from Oluwadamilola Soji-Oderinde directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Oluwadamilola Soji-Oderinde
Oluwadamilola Soji-Oderinde

As a Software Engineering student with over two years of experience in the tech space, I specialize in backend engineering and have hands-on experience as a Software Engineer. I also actively contribute to open-source projects.