Last week, I posted about Flock. These projects excite me because I have a Linux desktop I use for development. The distro I'm currently using is Arch Linux, and so I like to promote PHP development solutions that are able to run on multiple platforms which include Linux. It's odd because, at the time when I was posting about Flock, it never occurred to me to post about the solution I personally was currently using on my Linux machine, which is Lerd. So I figured I would correct that now. I've been using Lerd for about two months and have to say, I am genuinely happy with it. I don't even think about it anymore. It just runs perfectly for me when I'm working on PHP projects.
For a long time, being a developer in the Laravel world who uses a Linux desktop meant watching macOS folks get the cool tools first. Valet was macOS only. Then Laravel Herd showed up and made local development a one-click affair, on macOS and later Windows. Linux users got a polite shrug and a link to Docker.
Lerd fixed that for me. I wanted a Linux drop-in replacement for Herd, and that's exactly how I've used it: park my code folder, get a .test domain with HTTPS, pick a PHP version, and get back to work. I didn't need anything fancier.
Then I sat down to write this post and found out how much I'd been missing. Lerd does a lot more than I was asking of it. I didn't even know it had plugins. So this post covers two things: the basics I lean on every day, and the extras I'm now excited to start using.
What Lerd is
Lerd is a free, open source local PHP development environment. George Dumitrescu created it, and it's released under the MIT license. There's no paid tier and no account to sign up for, and you don't hit a "Pro" wall when you want a database.
It ships as a single binary written in Go. Under the hood, it runs Nginx, PHP-FPM, and your services (MySQL, PostgreSQL, Redis, Mailpit, and friends) as rootless Podman containers. That detail matters to me:
- There's no Docker daemon running as root in the background.
- Containers run as your user, managed by systemd user services on Linux.
- Your projects stay plain folders on disk. Lerd serves them as they are.
Platform support is wider than the name suggests. Lerd started life as "Herd for Linux," and Linux is still where it feels most at home, with support for Arch, Ubuntu and Debian, Fedora, Omarchy, NixOS, and other systemd distros. It also runs on macOS (Apple silicon and Intel, macOS 13 or newer) and on Windows through WSL2.
It isn't just for Laravel, either. Lerd detects a long list of frameworks, including Symfony, WordPress, Drupal, Statamic, CakePHP, Magento, and Tempest, and it can even sit in front of Node, Python, or Go apps.
Getting it installed
On Linux and macOS, the quickest route is the install script:
curl -fsSL https://lerd.sh/install.sh | bash
There are also packages if you prefer your package manager:
# Ubuntu / Debian
sudo add-apt-repository ppa:lerd/lerd
sudo apt update && sudo apt install lerd
# Fedora
sudo dnf copr enable georged/lerd
sudo dnf install lerd
# macOS (or Linux) via Homebrew
brew install lerd-env/lerd/lerd
lerd install
Windows users can grab Install-Lerd.exe from the GitHub releases page. It sets up WSL2, an Ubuntu distro, and Lerd for you.
A couple of Linux prerequisites are worth checking before you start. Lerd needs Podman 4.5 or newer and a working systemctl --user session. On Arch, also install crun, since Arch defaults to runc:
sudo pacman -S crun
loginctl enable-linger $USER
Linger lets your containers start on their own and keep running across sessions. Skip it and you'll wonder why your sites vanished after a reboot.
The installer asks for sudo once, to let unprivileged ports work and to point your system resolver at .test domains. After that, everything runs as you. When it finishes, check that all is well:
lerd status
You'll get a quick health report for DNS, Nginx, the PHP-FPM containers, your services, and certificate expiry.
The basics I use every single day
This is most of my Lerd life right here, and if you've used Herd or Valet, it'll feel familiar right away.
Serve every project in a folder
I keep my projects in one directory and park it:
lerd park ~/code
Now every PHP project inside ~/code gets its own domain. ~/code/acme is served at acme.test. There's no /etc/hosts editing, because Lerd runs its own small DNS server for .test names. New projects show up on their own because a watcher service keeps an eye on the folder.
If you only want a single project served, link it instead:
cd ~/code/acme
lerd link
Turn on HTTPS
lerd secure
Lerd issues a locally trusted certificate, switches the site to HTTPS, and even updates APP_URL in your .env for you. That last bit is small, but I've lost count of the times I've debugged broken asset URLs because APP_URL still said http://.
Pick a PHP version per project
I maintain projects on different PHP versions, so this one gets a workout:
# Set the default for everything
lerd use 8.5
# Pin this one project
cd ~/code/legacy-client
lerd isolate 8.3
lerd isolate writes a .php-version file in the project, so the choice travels with the repo. Lerd also reads the php constraint in your composer.json and picks the highest installed version that satisfies it, which means a lot of projects just work without any pinning at all.
The supported range is generous: PHP 8.0 through 8.6, plus 7.4. The docs are clear that 7.4 and 8.0 are a frozen legacy tier with no security patches, so treat them as a way to keep an old app running locally while you plan its upgrade.
That's it. Those four commands covered nearly everything I needed for months. Lerd got out of my way and let me write code.
Commit your setup with .lerd.yaml
If you work on a team, you can describe a project's environment in a .lerd.yaml file and commit it:
php_version: "8.5"
node_version: "22"
framework: laravel
secured: true
services:
- mysql
- redis
You don't have to write it by hand. Running lerd init walks you through a short wizard (PHP version, Node version, HTTPS, database, services, workers) and writes the file. If the project already has a herd.yml, a DDEV config, or a Lando file, the wizard offers to pre-fill from it. That's a thoughtful touch for anyone switching tools.
When a teammate clones the repo, one command does the rest:
lerd setup
It runs through the usual chores: composer install, JavaScript dependencies, .env setup, migrations, storage:link, the asset build, and more. You get a checklist and can untick anything you don't want.
Services and your .env
Spinning up a database is one command:
lerd service start mysql
The built-in services include MySQL, PostgreSQL, Redis, Meilisearch, RustFS (S3-compatible storage), and Mailpit for catching outgoing mail. There's a whole catalog of presets beyond those, too.
The part I like best is lerd env:
cd ~/code/acme
lerd env
It creates .env from .env.example if you don't have one, figures out which services the project uses, writes the right connection values, creates the project database (plus a _testing database), starts any services that aren't running, sets APP_URL, and generates an APP_KEY if one is missing. That's the whole "fresh clone to working app" dance in one command.
Already running MySQL or PostgreSQL on your host? Lerd handles that gracefully. If the default port is taken, it uses the next free one and writes that port into your .env.
The stuff I didn't know I had
Here's where writing this post paid off for me personally. All of this has been sitting on my machine the whole time.
A dump and query viewer
Lerd can catch dump() and dd() output and show it in its dashboard instead of splattering it across your page. It also groups SQL queries per request, with flags for N+1 patterns and slow queries, along with logs, mail, jobs, and outgoing HTTP calls. Capture is off by default, and toggling it doesn't restart anything:
lerd dump on
# Stream dumps to your terminal while you work
lerd dump tail --site acme
Say you have a route like this:
Route::get('/invoices/{invoice}', function (Invoice $invoice) {
dump($invoice->load('lineItems', 'customer'));
return view('invoices.show', compact('invoice'));
});
Hit the page and the dump, plus the queries that loaded those relationships, show up together in the dashboard. On the Herd side, the dump viewer is a Herd Pro feature. Here it's just part of the box.
A web dashboard and a terminal dashboard
lerd dashboard # browser UI
lerd tui # terminal UI
The web dashboard lets you manage sites, services, workers, logs, and even a Tinker session from the browser, and you can install it as a PWA. The terminal UI is great when you're SSH'd into a box or living inside tmux. There's also a system tray app if you like a menu icon.
Git worktrees as sites
If you use git worktrees to work on several branches at once, Lerd turns each worktree into its own site:
lerd worktree add feature/checkout
That branch gets served at feature-checkout.acme.test, with its own dependencies. You can share the parent site's database or give the branch its own isolated copy. Reviewing a pull request next to main without wrecking your local data is a real quality-of-life upgrade.
Sharing a site
Need a client to see your work in progress?
lerd share
Lerd detects a tunnel tool you already have (ngrok, Cloudflare's cloudflared, or Expose) and gives you a public URL. Options like Pinggy work over SSH with no signup at all. There's LAN sharing too, which is handy for checking a site on your phone.
AI assistant support
Lerd ships an MCP server, so tools like Claude Code, Cursor, Codex, and Copilot can see and manage your local environment. They can run Artisan and Composer, start services, read logs, and look at slow requests and N+1 queries.
# Register with every supported assistant
lerd mcp:enable-global
# Or write the config into one project so you can commit it
cd ~/code/acme
lerd mcp:inject
Plugins
And then there's the feature I had no idea existed. Lerd has a community plugin system, with a catalog at plugins.lerd.sh. Plugins can add CLI commands, dashboard pages, MCP tools, event hooks, and even new services and framework definitions.
# See what's in the catalog
lerd plugin search
# Install one
lerd plugin install <name>
# Or scaffold your own
lerd plugin new my-plugin
Plugins are written as shell scripts, Python, or Node. Catalog plugins are reviewed by a maintainer at one exact commit, and that exact commit is what Lerd installs. Plugins run with your user's permissions, so the docs sensibly remind you to read what you install. A catalog listing isn't a security audit.
I'll be poking at this one over the coming weeks.
So why not just use Herd?
I want to be fair here. Herd is a polished product, and plenty of people I respect use it happily. If you're on macOS and already paying for Herd Pro, I don't see an urgent reason to rip it out.
When I try to name the single biggest reason to pick Herd over Lerd, though, I come up empty. Lerd covers the core workflow (parked folders, .test domains, HTTPS, per-project PHP) and the features Herd keeps in Pro, like services, mail capture, and the dump viewer. It costs nothing.
Laravel has been adding new in-app features to Herd, like Herd Studio for building apps with AI coding agents right from the browser. Those may be exactly what some developers want. I don't use them, and I'm not sure I ever will. My editor and terminal already do that job for me.
What I want from a local environment is simple: get the work done, and stay out of my way when I want it to. Lerd does both.
I'd even point macOS developers at it. One honest trade-off there: on macOS, Lerd runs its containers inside a lightweight Podman VM, so it uses more resources than Herd's native processes. On Linux there's no VM layer at all, which is part of why it feels so light on my machine.
A few things to know before you jump in
- On Linux, you need Podman 4.5 or newer. Ubuntu 24.04, current Fedora, and Arch are fine. Ubuntu 22.04 and Debian 12 ship older Podman, and the docs explain how to get a newer one.
- Lerd needs ports 80, 443, and 5300 free, so stop Herd, Valet, or a system Apache/Nginx first.
- On Windows, it runs through WSL2, which some coverage still describes as beta.
- PHP 7.4 and 8.0 work, but they're frozen. Use them to keep old apps alive while you upgrade.
If it turns out not to be for you, lerd uninstall stops the containers and removes everything, and it asks before deleting your data and certificates.
Give it a try
If you develop PHP on Linux and you've been envious of the Herd crowd, install Lerd and park your code folder. You'll be up and running at https://your-app.test in a few minutes.
If you're on macOS and Herd Pro's price tag has kept you on the free tier, Lerd is worth a test drive too.
And if you're like me and have been using it for the basics, run lerd dashboard and lerd plugin search this week. There's a good chance it already does something you've been wishing for.
One more thing: Lerd can run sites on FrankenPHP with Octane worker mode (lerd runtime frankenphp --worker). If that's new to you, our earlier post on why FrankenPHP worker mode saves your sanity is a good primer.
References
- Lerd official website
- Lerd docs: Requirements
- Lerd docs: Installation
- Lerd docs: Quick Start
- Lerd docs: PHP versions
- Lerd docs: Project Setup
- Lerd docs: Configuration
- Lerd docs: Environment Setup
- Lerd docs: HTTPS / TLS
- Lerd docs: Dump viewer
- Lerd docs: Git Worktrees
- Lerd docs: Sharing Sites
- Lerd docs: AI Integration (MCP)
- Lerd docs: Community Plugins
- Lerd docs: Laravel Herd for Linux
- Lerd plugin catalog
- Lerd on GitHub
- Laravel News: Lerd, a free, open source Herd alternative for Linux and macOS
- Mohamed Said: Lerd, a free open source Laravel Herd alternative for Linux and macOS
- The Drop Times: Lerd and rootless Podman PHP development
- Laravel Herd documentation
- Laravel Herd changelog (macOS)
- PHP Architect: Here's Why FrankenPHP Worker Mode Saves Your Sanity