Setting Up Laravel Using the Laravel Installer

Setting Up Laravel Using the Laravel Installer

Using the Laravel Installer is one of the fastest and cleanest ways to create new Laravel projects.
Follow these simple steps to get Laravel up and running on your machine.

Prerequisites

Before starting, make sure:

  • PHP ≥ 8.1 is installed on your machine
  • Composer is installed (we covered this in earlier steps)

 

Step 1 — Install Laravel Installer Globally

Open your terminal and run:

composer global require laravel/installer

This installs the Laravel Installer globally so you can run the laravel command from anywhere.

 

Step 2 — Add Composer’s Global vendor/bin Directory to Your PATH

You need to make sure your system can recognize the laravel command.

  • On macOS / Linux:
    Add this to your terminal config file (.bashrc, .zshrc, etc.)
export PATH="$HOME/.composer/vendor/bin:$PATH"

Or if using Composer v2 (typical path):

export PATH="$HOME/.config/composer/vendor/bin:$PATH"

Then run:

source ~/.bashrc
# or
source ~/.zshrc
  • On Windows:
    Add this to your Environment Variables > Path:
    C:\Users\YourName\AppData\Roaming\Composer\vendor\bin

 

Step 3 — Verify Laravel Installer

Check if the Laravel installer is available:

laravel --version

You should see something like:

Laravel Installer 5.x.x

 

Step 4 — Create a New Laravel Project

Now you’re ready to create a Laravel project!

laravel new myapp

This will:

✅ Create a new folder named myapp
✅ Install the latest stable Laravel version with all dependencies

– Optional: Install a specific Laravel version

laravel new myapp --version="11.1"

 

Step 5 — Navigate to Your Project

cd myapp

 

Step 6 — Run the Laravel Development Server

php artisan serve

You’ll see something like:

Starting Laravel development server: http://127.0.0.1:8000

Now open http://127.0.0.1:8000 in your browser.
🎉 Your Laravel project is up and running!

 

That’s it!

You’ve successfully set up Laravel using the Laravel Installer.

Laravel {"id":35,"topic_id":1,"name":"Installation and Setup","slug":"installation-and-setup","image":null,"description":null,"icon":null,"class":null,"color":null,"status":0,"order":0,"created_at":"2024-11-19T16:14:09.000000Z","updated_at":"2024-11-19T16:14:09.000000Z"} - List of Contents

Related Tutorials: