> ## 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

> Learn how to install Laravel and set up your PHP environment.

## Requirements

Before getting started with Laravel, you need the following:

* **PHP 8.3 or higher**
* **Composer** (PHP's package manager)
* **Laravel installer** (optional but recommended)

<Info>
  You also need Node.js/npm or Bun to compile frontend assets.
</Info>

## Installing PHP and the Laravel installer

The easiest way to install PHP, Composer, and the Laravel installer together is to run the following command for your OS:

<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 want a graphical PHP management tool, also check out [Laravel Herd](#installing-with-laravel-herd).
</Tip>

## Creating a new Laravel application

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

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

Once 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
```

Once the development server is running, visit [http://localhost:8000](http://localhost:8000) in your browser.

<Info>
  A starter kit automatically generates a base scaffold that includes authentication. In Laravel 13, you can choose from four options: React, Vue, Svelte, or Livewire.
</Info>

### Starter kit options

When you run `laravel new`, you can choose one of the following starter kits:

<AccordionGroup>
  <Accordion title="React">
    A React frontend starter kit using [Inertia](https://inertiajs.com). It adopts React 19, TypeScript, Tailwind, and [shadcn/ui](https://ui.shadcn.com), providing a modern setup that combines an SPA with server-side routing.
  </Accordion>

  <Accordion title="Vue">
    A Vue frontend starter kit using [Inertia](https://inertiajs.com). It adopts the Vue Composition API, TypeScript, Tailwind, and [shadcn-vue](https://www.shadcn-vue.com/).
  </Accordion>

  <Accordion title="Svelte">
    A Svelte frontend starter kit using [Inertia](https://inertiajs.com). It adopts Svelte 5, TypeScript, Tailwind, and [shadcn-svelte](https://www.shadcn-svelte.com/).
  </Accordion>

  <Accordion title="Livewire">
    A starter kit using [Laravel Livewire](https://livewire.laravel.com). Build dynamic UIs with PHP alone—ideal for teams that primarily use Blade templates. It adopts Tailwind and [Flux UI](https://fluxui.dev).
  </Accordion>
</AccordionGroup>

<Tip>
  If you're unsure which setup to choose, review the differences between Blade, Livewire, Inertia, and SPAs on the [Frontend](/en/frontend) page first to help you decide.
</Tip>

## Installing with Laravel Herd

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

### macOS

1. Download the installer from the [Herd website](https://herd.laravel.com).
2. Run the installer and PHP is configured automatically.
3. The `~/Herd` directory is set as the parked 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. After installing, launch Herd and complete the onboarding.
3. `%USERPROFILE%\Herd` becomes the parked directory.

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

## Initial configuration

### Environment configuration

Many of Laravel's configuration values may differ per environment.
For that reason, key configuration values are managed in the `.env` file at the root of your application.

<Warning>
  Do not commit the `.env` file to source control.
  There is a risk of exposing sensitive information.
</Warning>

### Database configuration

By default, Laravel is configured to use SQLite.
If you want to use MySQL or PostgreSQL, update the `.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=
```

If you're using a database other than SQLite, run migrations to create the 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) to get Laravel support such as syntax highlighting, snippets, Artisan command integration, and smart autocompletion for Eloquent models.
  </Accordion>

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

## Next steps

<Card title="Directory structure" icon="folder-open" href="/en/directory-structure">
  Understand the key directories and files in a Laravel project.
</Card>


## Related topics

- [Laravel Console Starter](/en/packages/laravel-console-starter/index.md)
- [Laravel Boost](/en/boost.md)
- [Laravel Telescope](/en/telescope.md)
- [Laravel Prompts](/en/prompts.md)
- [Laravel MCP](/en/mcp.md)
