Craft on Herd when the README still says Valet
On this page
This week I opened a Craft Commerce site I built in the summer of 2022 to deal with a pile of Dependabot warnings. Its .nvmrc pinned a Node release that is long out of support, so one commit bumped it. Another fixed the Twig-side module that reads Vite's manifest, because a newer major of Vite moved manifest.json into a .vite folder. Routine stuff. What I want to write down is the part before either commit: getting a three-year-old Craft repo to serve on a Mac whose local stack has been replaced since the README was written.
What the README asks for
The agency's Craft starter README, which this store and most of the Craft sites on my machine were built from, lists its requirements as Laravel Valet, Composer 2, NVM, and the MySQL and PHP versions that were current in 2022. The getting-started steps are valet link {sitename}, valet use php@{version}, composer install, "create database and import database from production/staging", nvm use, npm i, npm start. The newer Craft sites bumped the PHP and MySQL versions, and kept Valet.
None of my Craft repos use DDEV. There is not a .ddev folder in any of them, and I have never needed Docker for a Craft site. The whole reason Valet made sense for these projects is that they are plain PHP and MySQL, and that is exactly the case Herd covers.
Herd is Valet with an app around it
My Statamic repos have said "Herd" in their READMEs since 2024. The Craft READMEs never got updated, and it turned out not to matter, because the commands map one for one. Herd bundles Valet's site drivers, including the Craft one, which recognizes the craft executable in the project root and serves from web/ instead of public/. So:
valet link exampleisherd link example. In my case I do not even run it, because~/webdevis parked in Herd and every folder in it is already<folder>.test.valet use php@{version}is a click on Herd's PHP version menu. If one site cannot run on the global version,herd isolate {version}from inside its folder pins that site without touching the others. My one site still on an old Craft major is the kind that needs it; the newer Craft sites have been fine on Herd's current PHP.valet secureisherd secure, and the.env.examplealready assumes it:SITE_URL=https://craft-starter.test, with the@webalias inconfig/general.phpbuilt from that value.
Composer still runs with the project's platform setting, not Herd's PHP. The 2022 store pins a platform PHP version in composer.json that is older than what Herd runs, so dependency resolution behaves as if it were on that older PHP even while Herd serves the site on the current one. That is the setting to look at when composer install picks an older package than you expected.
The database is the one real step
This is where Craft differs from the Statamic post. Herd's free tier does not include a database server, and Craft will not boot without one. I run MySQL from DBngin, listening on 127.0.0.1 as root with no password, which is exactly what the starter's .env.example expects:
DB_DRIVER=mysql
DB_SERVER=127.0.0.1
DB_PORT=
DB_DATABASE=
DB_USER=root
DB_PASSWORD=
Fill in DB_DATABASE, create it, and import a dump from staging or production:
mysql -h 127.0.0.1 -u root -e 'CREATE DATABASE store'
php craft db/restore ~/Downloads/store.sql
php craft here is Herd's PHP, since that is what is on the path. The db/restore command has been in Craft for years, and it is nicer than piping into mysql because it uses the credentials from .env and you cannot restore into the wrong database by accident.
The older .env.example files still name the MySQL version they were written for, and I have left them alone. The README is a record of what the site was built against, not a promise about what it runs on.
Settings to flip locally
Two environment values in the starter are set for production and need changing for local work. CRAFT_DEV_MODE=false becomes true so Twig errors are readable. CRAFT_ALLOW_ADMIN_CHANGES=false becomes true, otherwise the control panel will not let you add a field, because project config is meant to flow from the repo to the server and not the other way. The 2022 store's example ships with ALLOW_ADMIN_CHANGES=true; the newer starter flipped the default to false.
The Vite side is a flag too. VITE_SERVER=true makes the site's small Vite module inject http://localhost:5173/@vite/client and the entry scripts instead of reading the built manifest from web/bundle/, which is what npm run dev needs. Leave it false and run npm run build when you only want to see the site.
What did not change
The repository. I looked at four of my Craft repos while writing this. Three have READMEs from 2022 and 2023 that name Valet, and not one line in any of them had to move for Herd. The PHP version menu, a parked folder and a MySQL from DBngin replaced valet use, valet link and whatever MySQL you were running before, and the .test URLs in every .env kept working.
The short version: if your Craft site runs on PHP and MySQL, Herd is Valet, and the README's Valet instructions still describe it. The only thing Herd does not give you is the database, and DBngin gives you that in one click.