agyanadda@gmail.com

Laravel Installation

Laravel Basics 1 min read Updated Dec 2, 2026 Topic 2 of 31

To create a Laravel project you need PHP and Composer (PHP's package manager) installed on your computer.

Requirements

  • PHP 8.2 or newer (check the Laravel docs for the exact version your release needs)
  • Composer — download from getcomposer.org
  • A database such as MySQL or SQLite (new projects use SQLite by default)

Two ways to create a project

  • composer create-project laravel/laravel blog
  • Or install the Laravel installer once: composer global require laravel/installer, then laravel new blog

Run it

Go into the folder and start the development server with php artisan serve. Open http://127.0.0.1:8000 — you will see the Laravel welcome page.

The .env file

Settings that change between your computer and the live server — app name, debug mode, database name and password — live in .env. Never upload .env to GitHub.

Example

Example — Create and run a new project Bash
# 1. Create the project
composer create-project laravel/laravel blog

# 2. Go into the folder
cd blog

# 3. Start the development server
php artisan serve
# INFO  Server running on [http://127.0.0.1:8000].

After php artisan serve, open http://127.0.0.1:8000 in your browser to see the Laravel welcome page. Press Ctrl+C to stop the server.

Test Yourself With Exercises

Exercise 1 Multiple Choice

Which tool installs Laravel and its packages?

Exercise 2 True / False

You should commit your .env file to GitHub.

Exercise 3 Fill in the Blank

Start the development server with: php artisan ___

Frequently Asked Questions

Yes. XAMPP or WAMP give you PHP and MySQL. Install Composer separately, create the project with Composer, and either run php artisan serve or point Apache's document root at the project's public folder.