Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Getting Started with Laravel  ›  Lesson

Installing Laravel with Herd

Laravel Herd 12 minLaravel Herd installs PHP, Composer, the Laravel installer, Node and a web server in one app, and serves every project folder in its parked directory at a .test address.

Installing Laravel with Herd

Laravel is written in PHP, so before your first page you need PHP itself, Composer (PHP's package manager), a web server and usually Node for building CSS and JavaScript. Installing and wiring these by hand used to eat an afternoon. Laravel Herd does it in one download for macOS and Windows.

The rule

Install Herd once; every folder in ~/Herd becomes a .test site.

Herd is a desktop app. Installing it gives you, already configured:

  • PHP, and you can switch versions from the Herd menu.
  • Composer, for installing PHP packages.
  • The laravel installer command, for creating projects.
  • Node and npm, for front-end assets.
  • A web server that serves your projects automatically.

The key idea is the parked folder. By default it is ~/Herd (your home folder, then Herd). Herd serves every folder inside it at an address made from the folder name plus .test:

cd ~/Herd
laravel new lendly
# now open http://lendly.test

You do not start a server or edit any config. The folder lendly simply becomes lendly.test.

Two more commands help when your code lives somewhere else:

  • herd park in a folder makes that folder a parked folder too, so every project inside it is served.
  • herd link inside a single project serves just that project, named after its folder.

The free version of Herd covers everything in this course. The paid Herd Pro adds extras such as bundled database and mail-testing services.

Not using Herd? The route still works: install PHP and Composer yourself, create the project, then run php artisan serve, which starts a development server at http://127.0.0.1:8000.

The shortcut

To predict a Herd address, take the folder name and add .test. To check whether a site will appear at all, ask "is it inside a parked folder, or linked?"

Where does each project live?Step 1 of 4
  1. ~/Herd/lendly

    Inside the default parked folder. Address: http://lendly.test.

The trap is creating a project in your Downloads folder and wondering why .test shows nothing. Herd only serves what it has been told about.

Drills

Answer fast — trust the rule.

quick drill

A project sits at ~/Herd/shelf. What address does Herd give it?

quick drill

Which of these does Herd NOT install for you?

quick drill

Your project is at ~/work/lendly, outside any parked folder. What serves it with Herd?

quick drill

Without Herd, which command starts a development server for a Laravel project?

Remember

  • Install Herd once, and every folder in ~/Herd becomes a .test site.
  • Address = folder name + .test, only for parked or linked folders.
  • Trap: projects outside a parked folder stay invisible until you link or park them.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainWhat Herd saves you

A classmate on macOS wants to start Lendly and asks what they need to install. Explain what Laravel Herd gives them and how their project ends up at a browser address.