Originally published on laravel.learnio.dev — part of the Laravel best practices course. View this lesson on the original site.

Set up your local Laravel toolchain

To install Laravel cleanly, you need a supported PHP runtime and Composer 2.x available in your shell.

Create a new Laravel project

Use Composer's project template command:

composer create-project laravel/laravel my-app
cd my-app

This creates a full Laravel application skeleton with dependencies installed.

In practical terms, after create-project finishes you have:

  • application code location (app/),
  • route files (routes/),
  • configuration (config/),
  • database scaffolding (database/),
  • view/templates location (resources/views/),
  • public web entry point (public/index.php),
  • installed PHP dependencies (vendor/),
  • and the Laravel CLI entry point (artisan).

You are not starting from an empty folder. You are starting from a production-oriented baseline with framework conventions already in place.

flowchart TD
  A[my-app/] --> B[app/]
  A --> C[routes/]
  A --> D[config/]
  A --> E[database/]
  A --> F[resources/views/]
  A --> G[public/index.php]
  A --> H[vendor/]
  A --> I[artisan]

First project initialization

Inside the new folder:

cp .env.example .env
php artisan key:generate
php artisan serve

What these do:

  • .env gives your local environment configuration.
  • key:generate sets APP_KEY required for encryption/session features.
  • artisan serve starts a local development server.

Verify installation worked

Open the URL shown by php artisan serve (usually http://127.0.0.1:8000).
If the Laravel welcome page loads, installation is successful.

What to do if it fails

Check in this order:

  1. PHP version is supported for your Laravel version.
  2. Composer completed without permission errors.
  3. You are running commands from the project root (the folder containing artisan).

Next lesson covers project structure so you understand what each top-level directory is for.

From Laravel best practices — What is Laravel?