Skip to main content

Introduction

The Laravel team provides Herd and php.new for beginners, but senior engineers tend to prefer managing each tool individually via a package manager. You can control versions yourself and easily switch between different PHP versions across projects. This guide walks through installing PHP, Composer, and Node.js (via nvm) with Homebrew, getting you to a state where laravel new works.
Target environment: macOS 13 Ventura or later. Works on both Apple Silicon (M1/M2/M3) and Intel.

Installing Homebrew

Homebrew is a package manager for macOS. If you haven’t installed it, run the following in your terminal.
After installation, on Apple Silicon the following line is automatically added to a shell profile such as ~/.zprofile. If you added it manually, reload the settings.
Verify the installation.

Installing PHP

1

Install the latest PHP

Homebrew’s php formula always points at the latest stable version. Laravel 13 requires PHP 8.3 or later.
2

Check the version

Success looks like PHP 8.3.x or later.
3

(Optional) Use a specific version

To manage multiple PHP versions, install a versioned formula.
Switch versions with brew link.
Check the currently linked version.

Installing Composer

1

Install Composer

Install directly with Homebrew.
2

Check the version

3

Configure the path for global installs

So that packages installed with composer global require (like the Laravel installer) are usable, add ~/.composer/vendor/bin to your PATH.Append this to ~/.zshrc (or ~/.bashrc):
Apply the changes.

Installing nvm

Install Node.js on a per-user basis using nvm (Node Version Manager). Because it doesn’t require root, it plays nicely with AI tools and CLIs that use global npm packages.
1

Install nvm

The latest install script is available on nvm’s GitHub repository.
2

Add to your shell config

The install script automatically appends the following to ~/.zshrc (or ~/.bashrc). Add it manually if it isn’t already there.
Reload the settings.
3

Verify the installation


Installing Node.js

1

Install the LTS version

2

Set as default

Set the default version so it’s used automatically in new terminal sessions.
3

Check the versions


Verifying the Laravel installation

1

Install the Laravel installer

2

Create a new project

An interactive setup begins. You can choose a starter kit and whether to include authentication.
3

Start the dev server

Open http://localhost:8000 in a browser; if the Laravel welcome page appears, you’re done.

When to use Herd

Manual setup with Homebrew is a good fit if you want to match settings with team members and CI environments, or if you frequently switch between multiple PHP versions.
Last modified on July 13, 2026