Laravel 12 Installation: Complete Step-by-Step Guide
A complete Laravel 12 installation guide covering terminal commands, Herd/Sail, database setup, Vite, starter kits and authentication.
Installing Laravel 12 correctly means preparing the development environment, database, frontend build flow and first checks together. This guide walks through the official Laravel 12 path using the Laravel installer, while also explaining Herd and Sail options for local development.
Requirements
Before creating the project, install PHP, Composer, the Laravel installer, and either Node.js with NPM or Bun for frontend assets. Laravel's official installation guide currently recommends the Laravel installer and shows the `composer run dev` workflow after project creation.
composer global require laravel/installer
laravel new example-app
cd example-app
npm install
npm run build
composer run dev
Database
A fresh Laravel 12 project can start with SQLite. If you use MySQL or PostgreSQL, update the `DB_*` values in `.env`, create the database, and run migrations.
php artisan migrate
php artisan about
php artisan route:list
Herd and Sail
Herd is the easiest native local environment on macOS and Windows. Sail is useful when the team wants a Docker-based environment with services such as MySQL, Redis and Mailpit. Choose one workflow deliberately and document it in the project README.
First Project Checklist
- Set `APP_NAME`, `APP_URL`, `APP_LOCALE` and database values in `.env`.
- Run migrations and verify the application with `php artisan about`.
- Compile assets with Vite and confirm the browser opens without console errors.
- Initialize Git, commit the clean installation, and never commit `.env`.
Source note: this article follows the official Laravel 12 installation documentation, then adds the practical checks I use before starting real project work.