$ cat /posts/how-to-install-laravel-12-step-by-step-beginner-guide.md

How to Install Laravel 12: Step-by-Step Beginner Guide

drwxr-xr-x2026-01-095 min0 views
How to Install Laravel 12: Step-by-Step Beginner Guide

Laravel is one of the most popular PHP frameworks for building modern web applications. In this tutorial, you will learn how to install Laravel 12 from scratch, verify the installation, and run your first Laravel application using official and recommended methods.

image
Before installing Laravel 12, make sure your system has PHP 8.3+ and Composer installed.

System Requirements

Laravel 12 requires a modern PHP environment with specific extensions enabled to function correctly. These requirements ensure optimal performance and security.

  • PHP 8.3 or higher
  • Composer (PHP dependency manager)
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring, Tokenizer, XML, Ctype, JSON extensions

Check PHP Version

bash
php -v

Step 1: Install Composer

Composer is required to manage Laravel dependencies. If Composer is not installed on your system, use the following commands to install it globally.

bash
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer --version

Step 2: Install Laravel 12

The recommended way to install Laravel 12 is by using Composer’s create-project command. This method downloads the framework along with all required dependencies.

bash
composer create-project laravel/laravel my-laravel-app
This command automatically installs the latest Laravel 12 version and prepares your project structure.

Verify Laravel Installation

bash
cd my-laravel-app
php artisan --version

Step 3: Environment Configuration

Laravel uses an .env file to manage environment-specific configuration such as database credentials and application keys.

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

Step 4: Run Laravel Development Server

Laravel includes a built-in development server that allows you to run your application locally without additional setup.

bash
php artisan serve

Laravel Project Structure Overview

After installation, Laravel creates a well-organized directory structure that helps developers maintain clean and scalable applications.

DirectoryPurpose
app/Core application logic such as controllers and models
routes/All application route definitions
resources/Views, Blade templates, and frontend assets
database/Migrations, factories, and seeders
storage/Logs, cache, and compiled files
Ensure proper write permissions are set for storage and bootstrap/cache directories to avoid runtime errors.

Conclusion

You have successfully installed Laravel 12 and run your first application. With its elegant syntax and powerful features, Laravel 12 is an excellent choice for building scalable and secure PHP applications. From here, you can explore routing, controllers, databases, and API development.

Next steps: Learn routing, controllers, Blade templating, and database migrations to start building real-world Laravel applications.
$ echo $TAGS: #PHP #Laravel

$ cat /comments/ (0)

new_comment.sh

// Email hidden from public

>_

$ cat /comments/

// No comments found. Be the first!

[session] guest@{codershandbook}[timestamp] 2026

Navigation

Categories

Connect

Subscribe

// 2026 {Coders Handbook}. EOF.