How to install Laravel 13.x
The fastest path from a clean machine to a running Laravel 13 app. We'll check the requirements, install the Laravel installer via Composer, scaffold a new project, and boot the dev server.
-
Check PHP and Composer
Laravel 13 requires PHP 8.3 or newer and Composer 2. Confirm both are installed before going further — if either command is missing, install PHP through your OS package manager and Composer from
getcomposer.orgfirst.php -v composer -V -
Install the Laravel installer
The
laravel/installerpackage gives you thelaravel newcommand, which scaffolds a project faster than a raw Composercreate-projectand lets you pick a starter kit interactively. Install it globally, once, per machine.composer global require laravel/installerMake sure Composer's global
vendor/bindirectory is on yourPATH, or thelaravelcommand won't be found afterwards.export PATH="$HOME/.config/composer/vendor/bin:$PATH" -
Scaffold a new project
Run
laravel newwith your project name. The installer walks you through picking a starter kit, testing framework and database — press Enter to accept the defaults if you just want a plain app to explore.laravel new example-app cd example-appNo Laravel installer? A plain Composer create-project works exactly the same way:
composer create-project laravel/laravel example-app cd example-app -
Set up your
.envand app keyThe
laravel newinstaller copies.env.exampleto.envand generates theAPP_KEYfor you. If you scaffolded with a plain Composercreate-projectinstead,.envexists butAPP_KEYis empty from a zero install — generate it yourself before running the app.php artisan key:generateBy default
DB_CONNECTIONis set tosqlite, which needs no separate database server — good enough to get moving. Switch it tomysqlorpgsqlin.envwhenever you're ready to point at a real database. -
Run the dev server
Start Laravel's built-in server and open the URL it prints. You should land on the default Laravel welcome page.
php artisan serve # then open http://127.0.0.1:8000Prefer one command that also watches your queue, logs and Vite build? Laravel ships a combined dev script for that:
composer run dev