Laravel Development Environment Comparison: Herd vs Sail vs Valet vs Homestead vs Serve

PHP Laravel Herd Sail Valet Homestead

Choosing a local development environment for laravel is crucial as it directly impacts the productivity of the developers and helps them easily run their laravel applications locally. The laravel team spent years building tools to help developers setup their laravel local development environment as quick and easily as possible. Here, I will be covering all the five different laravel local development environment tools and help you decide which one is best for your use case. The following are the list of official laravel web development environments released so far.

1. Laravel Herd

Update:

Laravel Herd now supports windows operating system. The premium version of Laravel herd(Herd pro) has more features like dumps, logs, services, etc.

Laravel Herd is the latest development environment released by Beyond Code in collaboration with Laravel. Herd advertises themselves as One click PHP development environment which I believe is true. I was able to install Herd directly from the Laravel Herd Website and able to run all of my existing Laravel(and Jigsaw) applications without any additional configuration. I just added the root path of all of my projects to the Herd's path configuration, and it automatically created local testing urls for each of the application.

Laravel Herd allows developers to run multiple PHP web applications and each of them can run on different PHP versions. Herd also makes it very easier to switch the PHP version on the command line which makes it a very good choice for developers who are working on more than one project.

Laravel Herd Highlights

Laravel Herd Limitations

Overall Herd is a great choice for you if

  • You are running more than one application with different PHP versions
  • All of your applications run on PHP7.4 or higher
  • You do not need any PHP extensions more than what is currently shipped with Laravel Herd

2. Laravel Sail

Laravel Sail is an official docker based web development environment for Laravel. If you love containers, You will love Laravel Sail. It's a feature rich pre-packaged docker container which provides support for PHP, Composer, MySQL, Redis, MeiliSearch and MailPit out of the box. Since it's a docker container, You can extend it to install any other services you may wish.

When running your applications with Sail, Your apps run on a docker container and completely isolated from your computer.

Laravel Sail Highlights

Laravel Sail Limitations

Overall Sail is a great choice for you if

  • You are using Windows / Linux
  • You are running one or less applications which doesn't need to talk to each other
  • All of your applications run on PHP8 or higher

3. Laravel Homestead

Laravel Homestead is an official pre-packaged vagrant box which comes with most commonly used tools and services which are required to run a PHP or Laravel application.

Vagrant boxes are lightweight virtual machines which can be created and disposed easily. So developing applications using laravel homestead allows developers to experiment and dispose the virtual machines easily without affecting their system.

Containers are evolving, and it had become an industry best practice to use containers instead of virtual boxes. If you are a new developer starting with Laravel, It is recommended to start with either Laravel Herd or Sail(Docker).

Laravel Homestead Highlights

Laravel Homestead Limitations

Overall Homestead is a great choice for you if

  • PHP or other system requirements for your application aren't supported by Laravel Sail or Herd
  • Your application has a restriction on the operating system on which it runs

4. Laravel Valet

Laravel Valet is a minimalistic Web development environment for macOS. Just like Herd, Valet allows developers to run multiple PHP web applications and each of them can run on different PHP versions.

With the release of Laravel Herd and official mention of Herd in the Valet docs, There are very good chances that Laravel Herd will replace Laravel valet in the near future. So, i would recommend to start using Herd instead of Valet.

Laravel Valet Highlights

Laravel Valet Limitations

Overall Laravel Valet is a great choice for you if - You are using macOS - Your applications are running an older PHP version which is not supported by Laravel Herd

5. Artisan Serve

Serve isn't a Web development environment but instead a laravel artisan command which uses PHP's built-in web server to quickly run and preview the application. By executing the php artisan serve command, One can easily preview their laravel application without depending on a development environment.

Artisan Serve Highlights

Artisan Serve Limitations

Overall Artisan Serve is a great choice for quickly previewing your laravel applications without the need to setup them beforehand

Side By Side Comparison

Laravel HerdLaravel SailLaravel HomesteadLaravel ValetArtisan Serve
Operating SystemmacOSLinux, Windows, macOSLinux, Windows, macOSmacOSLinux, Windows, macOS
PHP versions>= 7.4>= 8.0>= 5.6>= 5.6>= 5.6
Multiple PHP VersionsYesYesYesYesYes
Database ToolsNoYesYesNoNo
Additional PHP ExtensionsNoYesYesYesYes
Who is it for?macOS users who are using PHP7.4 or higherAny user who need advanced control over services they useLinux/Windows users who have operating system dependenciesmacOS users who are using PHP version which is not supported by Laravel HerdAny user who wish to quickly preview the laravel application without setting up a development environment

There is no one size fits for all solution. Every development environment is unique in their own way. If we have to choose one, I believe the best choices are

For daily laravel tips and interesting finds, Follow me on X