Install Laravel on Mac: Quick & Easy Setup Guide
- Getting Started with Laravel on Mac
- Installing PHP, Composer, and the Laravel Installer
- Installing Node & NPM on macOS
- Creating Your First Laravel Application
Getting Started with Laravel on Mac
Laravel is a powerful PHP framework that makes web application development smooth and enjoyable. If you’re on macOS and ready to dive into Laravel, this guide will walk you through the steps to set up your environment, create your first application, and configure it for development.
Installing PHP, Composer, and the Laravel Installer
Before creating your first Laravel application, you need to have PHP, Composer, and the Laravel installer installed. Additionally, you’ll need Node & NPM or Bun for compiling your application’s frontend assets.
If you don’t have PHP and Composer installed, run the following command to install PHP, Composer, and the Laravel installer on macOS:
/bin/bash -c "$(curl -fsSL https://php.new/install/mac/8.4)"
After installation, restart your terminal session. If you need to update PHP, Composer, and the Laravel installer later, simply re-run the same command.
If you already have PHP and Composer, install the Laravel installer via Composer:
composer global require laravel/installer
Tip: For a fully-featured, graphical PHP management tool, check out Laravel Herd.
Installing Node & NPM on macOS
Node and NPM are required to compile and manage your Laravel application's frontend assets. On macOS, the easiest way to install them is via Homebrew:
# Download and install Homebrewcurl -o- https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | bash # Download and install Node.js:brew install node@22 # Verify the Node.js version:node -v # Should print "v22.18.0". # Verify npm version:npm -v # Should print "10.9.3".
This will display the installed versions of Node and NPM. You can update them anytime using:
brew upgrade node
Creating Your First Laravel Application
Once your environment is ready, create a new Laravel application:
laravel new example-app
The installer will ask you to select your preferred testing framework, database, and starter kit.
After creation, start the development environment:
cd example-appnpm installnpm run dev
And on a serparate terminal run:
composer run dev
Now visit http://localhost:8000 in your browser, and your Laravel app will be live.
With these steps, you’re ready to start developing with Laravel on macOS. From here, you can explore Laravel’s features, build your database models, set up routes, and create powerful web applications.
Stay Updated.
I'll you email you as soon as new, fresh content is published.