Laravel Installation Guide
Laravel can be installed in several ways, but the recommended way is via Composer.
Prerequisites
Before installing Laravel, make sure you have:
1. PHP (Version 8.1 or higher recommended)
Check:
2. Composer (Dependency manager for PHP)
Check:
If Composer isn’t installed, download it here:
👉 https://getcomposer.org/download/
3. A Web Server (like Apache or Nginx)
You can use XAMPP, MAMP, or Laragon (for Windows).
Step 1: Install Laravel via Composer
Open your terminal and run:
Replace project-name
with whatever you want to name your app.
Example:
This will:
-
Download Laravel
-
Set up dependencies
-
Create a new project folder
Step 2: Navigate into the Project Folder
Step 3: Start the Laravel Development Server
Run:
Output:
Now, open your browser and go to http://127.0.0.1:8000
You should see the Laravel welcome page.
Optional: Verify Laravel Version
Alternative: Use Laravel Installer
If you prefer using the Laravel Installer globally:
1. Install via Composer:
Make sure Composer's global bin directory is in your $PATH
.
Then, create a project:
Laravel Installed! What Next?
You can now:
-
Set up your
.env
file -
Configure database connection
-
Create routes, controllers, and views
-
Start building your application!