This guide shows how to install Laravel 13 on Windows, macOS and Linux with the current official method. It also covers the choices that confuse beginners (starter kits, SQLite versus MySQL), a table of the errors people hit most, and the steps to check that everything works.
Quick answer: To install Laravel 13, install PHP 8.3 or newer, Composer and the Laravel installer, then run
laravel new example-app. Move into the folder, runnpm install && npm run build, thencomposer run devand openhttp://localhost:8000. New apps use SQLite by default, so no database setup is needed to start.
Table of Contents
What You Need Before You Install Laravel
Laravel needs PHP, Composer and Node with npm. Laravel 13 supports PHP 8.3 to 8.5. Composer manages PHP packages, and Node compiles the frontend assets. A database server is optional, because new apps use SQLite out of the box.
| Tool | What it does | Check it with |
|---|---|---|
| PHP 8.3 to 8.5 (Laravel 13) | Runs the framework | php -v |
| Composer | Installs PHP packages | composer -V |
| Laravel installer | Creates new apps with laravel new | laravel --version |
| Node and npm (or Bun) | Builds frontend assets with Vite | node -v and npm -v |
The PHP range comes from the Laravel release notes, which also show that Laravel 12 supports PHP 8.2 to 8.5. If you run an older PHP version, upgrade it first. A newer Laravel release won’t install on an unsupported PHP.
If you’re not sure whether Laravel or Composer is already on your machine, see how to check if Laravel is installed and how to check the Laravel version.
Which Laravel Install Method Should You Use?
Use the one-command installer from php.new if you have nothing installed. Use laravel new if PHP and Composer already work. Use Laravel Herd if you want a point-and-click local environment on macOS or Windows. Composer’s create-project also still works.
| Method | Best for | Needs |
|---|---|---|
| php.new script | A fresh machine with no PHP or Composer | A terminal and internet access |
composer global require laravel/installer | PHP and Composer already installed | Working PHP and Composer |
| Laravel Herd | macOS or Windows, no manual server setup | Herd app |
composer create-project laravel/laravel | Scripts and CI, or the classic method | Working PHP and Composer |
Step 1: Install PHP, Composer and the Laravel Installer
If you have none of them, run the php.new script for your operating system. It installs PHP, Composer and the Laravel installer in one go. Restart your terminal afterward so the new commands are available.
On macOS:
/bin/bash -c "$(curl -fsSL https://php.new/install/mac/8.5)"
On Linux:
/bin/bash -c "$(curl -fsSL https://php.new/install/linux/8.5)"
On Windows, open PowerShell as administrator and run:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://php.new/install/windows/8.5'))
To update PHP, Composer and the installer later, run the same command again.
If PHP and Composer are already installed, add the Laravel installer with Composer:
composer global require laravel/installer
If you only need Composer, the Composer download page lists the command-line steps, and our guide to installing Composer for Laravel walks through it in detail.
Step 2: Create Your Laravel App
Create the app with one command. The installer asks you to choose a testing framework, a database and a starter kit. Pick the defaults if you’re learning, because you can add or change everything later.
laravel new example-app
Which Starter Kit Should You Pick?
Starter kits add login, registration, password reset and email verification. All the official kits use Laravel Fortify for authentication, and two-factor authentication is included. A starter kit is optional, and you can start from a fresh install.
| Kit | Frontend | Choose it if |
|---|---|---|
| Livewire | Livewire 4, Tailwind, Flux UI | You mainly write PHP and Blade |
| React | React 19, TypeScript, Tailwind, Inertia | You want a React single-page app |
| Vue | Vue 3, TypeScript, Tailwind, Inertia | You want a Vue single-page app |
| Svelte | Svelte 5, TypeScript, Tailwind, Inertia | You want a Svelte single-page app |
Each kit also comes in a WorkOS variant that adds social login, passkeys and single sign-on, but it needs a WorkOS account. If you don’t want a kit, choose none when asked.
The Classic Alternative
You can also create the project with Composer directly:
composer create-project laravel/laravel example-app
This creates the same base project without the installer prompts. Use it in scripts or when the Laravel installer isn’t available.
Step 3: Run the App
Move into the project, build the frontend assets, then start the dev command. It runs the local server, the queue worker and the Vite development server together.
cd example-app
npm install && npm run build
composer run dev
Open http://localhost:8000 in your browser. If you see the Laravel welcome page, the install worked. Press Ctrl + C in the terminal to stop everything.
For more on starting a project and what to do next, read how to start a Laravel project.
Step 4: Configure the .env File
Laravel keeps environment settings in a .env file in the project root. This file holds your app name, debug mode, database connection, mail settings and secrets. Never commit it to source control.
Set these first:
APP_NAMEfor your project name.APP_ENVaslocalwhile you develop.APP_DEBUGastruelocally only. It must befalsein production, because debug mode can expose configuration values to visitors.DB_*values for your database.
SQLite Is the Default Database
A new app uses SQLite. Laravel creates database/database.sqlite and runs the initial migrations for you, so you can start without installing a database server. That keeps your first run simple.
Switch to MySQL
To use MySQL, create an empty database, then set these values in .env:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
Then run the migrations, which are required for any database other than SQLite:
php artisan migrate
If the command fails, the most common causes are a wrong password, a database that doesn’t exist yet, or a MySQL server that isn’t running. Fix those first.
Step 5: Learn the Laravel Folder Structure
A new Laravel project has a small set of folders you’ll use constantly. Knowing them saves time when you follow tutorials or read other people’s code.
| Folder | What lives there |
|---|---|
app | Your application logic, such as models and controllers |
routes | Web and API route definitions |
resources | Views and frontend assets |
database | Migrations, factories and the SQLite file |
config | Configuration files |
public | The web entry point, index.php, and built assets |
storage | Logs, cache and uploaded files |
Point your web server at public. Never move index.php into the project root, because that exposes configuration files to the internet.
Install Laravel With Herd on macOS or Windows
Herd is a native PHP and Laravel environment for macOS and Windows that includes PHP and Nginx. It serves any app in its parked folder on a .test domain, so you don’t need to run a server command.
On macOS:
cd ~/Herd
laravel new my-app
cd my-app
herd open
On Windows, in PowerShell:
cd ~\Herd
laravel new my-app
cd my-app
herd open
Herd uses the directory name for the domain, so my-app opens at my-app.test. For local MySQL, PostgreSQL or Redis on macOS or Windows, Laravel’s docs point to Herd Pro or DBngin.
How to Verify the Installation
Check three things: the version, the command list and the welcome page. If all three work, your install is healthy. Run these commands from the project folder:
php artisan --version
php artisan list
php artisan about
php artisan --version shows the Laravel version, php artisan list shows every available Artisan command, and php artisan about prints a summary of the environment. Then open the welcome page at http://localhost:8000. Test the database by running php artisan migrate. If it finishes without errors, the connection is correct.
Common Laravel Installation Errors and Fixes
Most install errors come from the PATH, the PHP version or a missing extension. Read the first red line of the error, because it usually names the cause. The table below covers the ones people hit most.
| Error | Likely cause | Fix |
|---|---|---|
composer: command not found | Composer isn’t installed or isn’t on your PATH | Install Composer, then restart the terminal |
laravel: command not found | The Composer global bin folder isn’t on your PATH | Add Composer’s global vendor/bin folder to your PATH, then restart the terminal |
| Composer says your PHP version doesn’t satisfy a requirement | PHP is older than the Laravel version needs | Upgrade PHP to a supported version |
| Missing extension error | A required PHP extension is disabled | Enable it in php.ini, then restart |
could not find driver | The PDO driver for your database is missing | Enable pdo_mysql or pdo_sqlite in php.ini |
| Port 8000 already in use | Another process uses the port | Stop that process, or run php artisan serve --port=8001 |
| Write permission errors | The web server can’t write to storage or bootstrap/cache | Make both writable by the web server user |
The PHP extensions Laravel 12 lists as required are Ctype, cURL, DOM, Fileinfo, Filter, Hash, Mbstring, OpenSSL, PCRE, PDO, Session, Tokenizer and XML. Check the Laravel deployment docs for the list that matches your version.
From Local Install to a Real Server
A local install is not a production setup. Before you deploy, set APP_DEBUG=false, point the web server at public, and make storage and bootstrap/cache writable. Run php artisan optimize during deployment to cache config, routes and views.
One catch: after you run config:cache, Laravel stops loading the .env file. Call env() only inside configuration files, because elsewhere it returns null. For a step-by-step deployment, read how to deploy a Laravel project on cPanel.
Which Laravel Version Should You Install?
Install the latest major version for new projects. Laravel 13 is current and supports PHP 8.3 to 8.5. Laravel 12 still gets security fixes until February 24, 2027, and bug fixes ended on August 13, 2026.
| Laravel | PHP | Released | Bug fixes until | Security fixes until |
|---|---|---|---|---|
| 11 | 8.2 to 8.4 | March 12, 2024 | September 3, 2025 | March 12, 2026 |
| 12 | 8.2 to 8.5 | February 24, 2025 | August 13, 2026 | February 24, 2027 |
| 13 | 8.3 to 8.5 | Q1 2026 | Q3 2027 | Q1 2028 |
Laravel 11 no longer receives security fixes. If you maintain an older app, plan an upgrade, and see how to upgrade Laravel 9 to 10 for the pattern. If you need a specific older version, our guide to installing Laravel 10 covers it.
What to Do After Installing Laravel
After the install, build something small. Add a route, a controller and a view, then connect a model to a table. How to use Laravel is a good next read. Add Laravel Debugbar to see queries and timings while you build. If you’re hiring for a bigger project, see the skills a dedicated Laravel developer needs or our Laravel development service.
FAQ
How do I install Laravel on Windows?
Open PowerShell as administrator and run the php.new Windows command, which installs PHP, Composer and the Laravel installer. Restart the terminal, then run laravel new example-app. Or install Laravel Herd for a point-and-click local setup.
What do I need to install Laravel?
You need PHP, Composer and Node with npm. Laravel 13 supports PHP 8.3 to 8.5. A database server isn’t required, because new apps use SQLite by default.
What is the difference between laravel new and composer create-project?
Both create a Laravel app. laravel new uses the Laravel installer and asks about a starter kit, a testing framework and a database. composer create-project laravel/laravel creates the base project without those prompts.
Which PHP version does Laravel 13 need?
Laravel 13 supports PHP 8.3 to 8.5, according to the Laravel release notes. Laravel 12 supports PHP 8.2 to 8.5. Check the release notes before installing on an older server.
Do I need MySQL to run Laravel?
No. New apps use SQLite by default and create database/database.sqlite for you. Switch to MySQL by changing the DB_* values in .env and running php artisan migrate.
Why does localhost:8000 not load?
The dev server may not be running, or another process may be using port 8000. Run composer run dev, and check the terminal for errors. If the port is busy, stop the other process or run php artisan serve --port=8001.
How do I check which Laravel version I have?
Run php artisan --version inside the project folder. It prints the framework version. For more detail, php artisan about shows the environment summary.
Should I use a starter kit?
Use one if you need login and registration right away. Livewire suits PHP and Blade developers, and React, Vue or Svelte suit JavaScript-driven apps. You can also start with none and add authentication later.
Can I install Laravel without Composer?
Not in a practical way. Laravel’s dependencies are managed by Composer, and the official installers use it. The php.new script installs Composer for you if you don’t have it.
Install Once, Then Build
The install is the easy part when PHP, Composer and your PATH are right. Use laravel new, keep the default SQLite database while you learn, and read the first line of any error.
Once the welcome page loads, stop tweaking the setup and build a feature. Which will you start with, a login system from a starter kit, or a small API of your own?











