If you’re currently using Laravel Sail for local development and want to switch to Herd, this guide will walk you through the migration process. While both tools provide excellent development environments, they have different approaches to managing services and dependencies.
Laravel Sail uses Docker containers to provide isolated development environments, while Herd takes a native approach by running services directly on your machine. Here are the key differences:
Before switching to Herd, make sure to stop all running Sail containers:
Download and install Herd from the official website. Follow the installation instructions to get Herd up and running on your machine.
Your .env
file likely contains Docker-specific configurations. Here’s how to update common settings:
If you’re using MySQL:
If you’re using Redis:
If you’re using Mailhog with Sail, switch to Herd’s mail service:
If you’re using Herd Pro, you can install services directly from the Herd UI. The free version requires manual installation of additional services.
Review your docker-compose.yml
file to identify which services your application needs. Common services include:
For Herd Pro users, you can install these services via the Services tab in settings. Free version users should install these services separately.
You can now remove Sail from your project:
Also, clean up Sail-related files:
docker-compose.yml
docker/
directoryUpdate your composer.json
scripts section to remove Sail commands. For example:
Create a herd.yml
file in your project root to define project-specific configurations either manually or by running herd init
:
Initialize your project with Herd:
This command will configure your project according to the herd.yml
file and set up any required services.
If you need to migrate your data from Sail’s MySQL container:
Since Herd runs services natively rather than in containers, you might need to adjust file permissions:
When working with a team, make sure to:
herd.yml
configuration file via version controlIf you encounter issues during migration:
Herd Pro users can also access priority email support for migration assistance.