Beginner’s Guide: How to Install and Create Your First Laravel App Like a Pro (Step-by-Step Setup)

Step-by-step tutorial to create your first Laravel app

If you’re looking to build robust, scalable, and elegant PHP applications, Laravel is one of the best frameworks to start with. This guide will help you set up your Laravel development environment and create your first Laravel app step-by-step – even if you’re just getting started.

🚀 What is Laravel?

Laravel is a powerful open-source PHP framework designed for web artisans. It provides a clean and elegant syntax while offering all the essential tools you need to build modern web applications — routing, ORM, templating, authentication, and more.

Whether you’re a backend developer or just exploring PHP frameworks, Laravel simplifies the development process like no other.

✅ Prerequisites

Before we install Laravel, make sure you have the following tools ready:

  • PHP >= 8.1
  • Composer (dependency manager for PHP) — Download Composer
  • A local development environment like XAMPP, Laragon, MAMP, or Laravel Valet
  • MySQL, SQLite, or any supported database
  • Optional but recommended: VS Code with PHP and Laravel extensions

🛠️ Step-by-Step: Install Laravel

1. Create a New Laravel Project

Open your terminal and run:

composer create-project --prefer-dist laravel/laravel blog-app

This will install Laravel into a folder named blog-app.

2. Navigate to the Project Directory

cd blog-app

3. Set Up Environment File

cp .env.example .env

Then generate your application key:

php artisan key:generate

4. Configure Database

Edit your .env file with the correct database credentials:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_db_name
DB_USERNAME=your_username
DB_PASSWORD=your_password

Run migrations:

php artisan migrate

5. Start the Laravel Development Server

php artisan serve

Your app will be running at http://localhost:8000

📁 Laravel Project Structure

Here’s a quick overview of key folders in your new Laravel app:

  • app/ – Application logic and core code
  • routes/web.php – Web routes
  • resources/views/ – Blade template views
  • public/ – Public assets and entry point
  • database/ – Migrations and seeders

💡 Create Your First Route and View

1. Add a Route

Edit routes/web.php:

Route::get('/', function () {
    return view('welcome');
});

2. Customize Your View

Open resources/views/welcome.blade.php and update the content as desired.

🧠 Final Thoughts

You’ve now successfully installed Laravel, created a project, and served your first app locally. 🎉

Laravel’s expressive syntax and rich ecosystem make it a go-to choice for modern PHP development. Stay curious, explore more features like Eloquent, Livewire, Sanctum, and dive into the full power of the Laravel framework.