> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> How to install Laravel and set up your PHP development environment.

## Requirements

Before getting started with Laravel, make sure your system meets the following requirements:

* **PHP 8.3 or higher**
* **Composer** (PHP package manager)
* **Laravel Installer** (optional but recommended)

<Info>
  Node.js/npm or Bun is also needed to compile front-end assets.
</Info>

## Installing PHP and the Laravel installer

The quickest way to install PHP, Composer, and the Laravel installer together is to run the appropriate command for your operating system:

<CodeGroup>
  ```shell macOS theme={null}
  /bin/bash -c "$(curl -fsSL https://php.new/install/mac/8.4)"
  ```

  ```powershell Windows (run as administrator) theme={null}
  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.4'))
  ```

  ```shell Linux theme={null}
  /bin/bash -c "$(curl -fsSL https://php.new/install/linux/8.4)"
  ```
</CodeGroup>

After running the command, restart your terminal session. If you already have PHP and Composer installed, you can install just the Laravel installer via Composer:

```shell theme={null}
composer global require laravel/installer
```

<Tip>
  If you prefer a graphical PHP management tool, check out [Laravel Herd](#laravel-herd) as well.
</Tip>

## Creating a new Laravel application

Once PHP, Composer, and the Laravel installer are ready, create a new application. The installer will prompt you to choose a testing framework, database, and starter kit:

```shell theme={null}
laravel new example-app
```

After the application is created, start the development server with the `dev` Composer script:

```shell theme={null}
cd example-app
npm install && npm run build
composer run dev
```

Open [http://localhost:8000](http://localhost:8000) in your browser to see your new application.

<Info>
  Starter kits automatically scaffold the application with authentication. Laravel 13 offers four options: React, Vue, Svelte, and Livewire.
</Info>

### Choosing a starter kit

When you run `laravel new`, you can pick from the following starter kits:

<AccordionGroup>
  <Accordion title="React">
    A React front-end starter kit powered by [Inertia](https://inertiajs.com). Uses React 19, TypeScript, Tailwind CSS, and [shadcn/ui](https://ui.shadcn.com), combining SPA-style interactions with server-side routing.
  </Accordion>

  <Accordion title="Vue">
    A Vue front-end starter kit powered by [Inertia](https://inertiajs.com). Uses the Vue Composition API, TypeScript, Tailwind CSS, and [shadcn-vue](https://www.shadcn-vue.com/).
  </Accordion>

  <Accordion title="Svelte">
    A Svelte front-end starter kit powered by [Inertia](https://inertiajs.com). Uses Svelte 5, TypeScript, Tailwind CSS, and [shadcn-svelte](https://www.shadcn-svelte.com/).
  </Accordion>

  <Accordion title="Livewire">
    A starter kit built with [Laravel Livewire](https://livewire.laravel.com), letting you build dynamic UIs using only PHP and Blade templates. Uses Tailwind CSS and [Flux UI](https://fluxui.dev). Ideal for teams who prefer staying in PHP.
  </Accordion>
</AccordionGroup>

<Tip>
  If you are not sure which stack to choose, read [Frontend](/en/frontend) first for a quick comparison of Blade, Livewire, Inertia, and SPA-style setups.
</Tip>

## Laravel Herd

[Laravel Herd](https://herd.laravel.com) is a native Laravel and PHP development environment for macOS and Windows. It installs PHP, Nginx, and the Laravel CLI in one step.

### macOS

1. Download the installer from the [Herd website](https://herd.laravel.com).
2. Run the installer — PHP is configured automatically.
3. `~/Herd` is set as the default park directory.

```shell theme={null}
cd ~/Herd
laravel new my-app
cd my-app
herd open
```

### Windows

1. Download the Windows installer from the [Herd website](https://herd.laravel.com/windows).
2. Launch Herd and complete the onboarding steps.
3. `%USERPROFILE%\Herd` becomes the park directory.

```shell theme={null}
cd ~\Herd
laravel new my-app
cd my-app
herd open
```

## Initial configuration

### Environment file

Many of Laravel's configuration values vary between environments. These values are managed in the `.env` file at the root of your project.

<Warning>
  Never commit your `.env` file to source control. It contains sensitive credentials that should remain private.
</Warning>

### Application key

A fresh installation generated by `laravel new` already has an application key set. If you cloned a project manually, generate one with:

```shell theme={null}
php artisan key:generate
```

### Database configuration

By default, Laravel is configured to use SQLite. To switch to MySQL or PostgreSQL, update your `.env` file:

```ini theme={null}
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=
```

After switching from SQLite, run the migrations to create the database tables:

```shell theme={null}
php artisan migrate
```

## IDE support

<AccordionGroup>
  <Accordion title="VS Code / Cursor">
    Install the official [Laravel VS Code Extension](https://marketplace.visualstudio.com/items?itemName=laravel.vscode-laravel) for syntax highlighting, snippets, Artisan command integration, and smart autocomplete for Eloquent models.
  </Accordion>

  <Accordion title="PhpStorm">
    [PhpStorm](https://www.jetbrains.com/phpstorm/laravel/) has built-in Laravel support, providing smart autocomplete for Blade templates, Eloquent models, routes, views, and translations.
  </Accordion>
</AccordionGroup>

## Next steps

<Card title="Routing" icon="arrow-right-arrow-left" href="/en/routing">
  Learn how to define routes and handle HTTP requests in Laravel.
</Card>
