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:
.envgives your local environment configuration.key:generatesetsAPP_KEYrequired for encryption/session features.artisan servestarts 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:
- PHP version is supported for your Laravel version.
- Composer completed without permission errors.
- 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?