How to Install Laravel: A Step-by-Step Guide for Beginners
Laravel is a powerful and elegant PHP framework for building modern web applications. In this guide, you'll learn how to install Laravel step-by-step on your system using Composer. Whether you're on Windows, macOS, or Linux, this guide will help you get started quickly.
🔧 Prerequisites
- PHP >= 8.1
- Composer (dependency manager for PHP)
- MySQL or any database
- Web server (Apache or Nginx)
📥 Step 1: Install Composer
If you haven't installed Composer yet, download it from the official website:
https://getcomposer.org/download/
📁 Step 2: Create Laravel Project
Open your terminal and run the following command:
composer create-project laravel/laravel my-laravel-app
This will create a new Laravel project in a folder named my-laravel-app.
⚙️ Step 3: Set File Permissions (Linux/macOS)
cd my-laravel-app
chmod -R 775 storage
chmod -R 775 bootstrap/cache
🚀 Step 4: Start Laravel Development Server
Navigate to your project folder and run:
php artisan serve
By default, your application will be accessible at http://127.0.0.1:8000
✅ You’re Ready!
Congratulations! You have successfully installed Laravel. Now you can start building your web application with one of the most loved PHP frameworks.
Need help setting up Laravel with a database or XAMPP? Stay tuned for our next blog!