// tutorial

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.

php laravel composer 6 min read
  1. 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.org first.

    bash
    php -v
    
    composer -V
  2. Install the Laravel installer

    The laravel/installer package gives you the laravel new command, which scaffolds a project faster than a raw Composer create-project and lets you pick a starter kit interactively. Install it globally, once, per machine.

    bash
    composer global require laravel/installer

    Make sure Composer's global vendor/bin directory is on your PATH, or the laravel command won't be found afterwards.

    bash
    export PATH="$HOME/.config/composer/vendor/bin:$PATH"
  3. Scaffold a new project

    Run laravel new with 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.

    bash
    laravel new example-app
    
    cd example-app

    No Laravel installer? A plain Composer create-project works exactly the same way:

    bash
    composer create-project laravel/laravel example-app
    
    cd example-app
  4. Set up your .env and app key

    The laravel new installer copies .env.example to .env and generates the APP_KEY for you. If you scaffolded with a plain Composer create-project instead, .env exists but APP_KEY is empty from a zero install — generate it yourself before running the app.

    bash
    php artisan key:generate

    By default DB_CONNECTION is set to sqlite, which needs no separate database server — good enough to get moving. Switch it to mysql or pgsql in .env whenever you're ready to point at a real database.

  5. 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.

    bash
    php artisan serve
    
    # then open http://127.0.0.1:8000

    Prefer one command that also watches your queue, logs and Vite build? Laravel ships a combined dev script for that:

    bash
    composer run dev