Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

stratboy's avatar

What's the current recommended installation way?

So this is the 3rd time I try to (re)start learning Laravel, and it's the 3rd time I ask this question over the years... What's the recommended installation way? I mean, once was homestead, then valet, then Docker, now Herd... Each time I restart studying Laravel there's a new way of installing and maintaining it. Quite confusing. So, currently I'm using Docker. Should I move to Herd?? I will restart using Laravel 11. Thank you.

1 like
10 replies
LaryAI's avatar
Level 58

The recommended way to install and set up Laravel can vary based on your development environment and personal preferences. As of Laravel 11, there are several popular methods you can use, each with its own advantages. Here’s a brief overview of the most common methods:

1. Laravel Sail (Docker)

Laravel Sail is a great option if you prefer using Docker. It provides a simple command-line interface for interacting with Laravel's default Docker configuration.

Installation Steps:

  1. Install Docker on your machine.
  2. Create a new Laravel project using Composer:
    composer create-project laravel/laravel example-app
    
  3. Navigate to your project directory:
    cd example-app
    
  4. Install Laravel Sail:
    composer require laravel/sail --dev
    
  5. Start the development environment:
    ./vendor/bin/sail up
    

2. Laravel Valet (macOS)

Laravel Valet is a great choice if you are on macOS and prefer a minimalistic setup. It configures your Mac to always run Nginx in the background when your machine starts.

Installation Steps:

  1. Install Homebrew if you haven't already:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Install PHP:
    brew install php
    
  3. Install Composer:
    brew install composer
    
  4. Install Laravel Valet:
    composer global require laravel/valet
    valet install
    
  5. Navigate to your project directory and link it:
    cd example-app
    valet link
    

3. Laravel Homestead (VirtualBox/Vagrant)

Laravel Homestead is a pre-packaged Vagrant box that provides a development environment without requiring you to install PHP, a web server, and other server software on your local machine.

Installation Steps:

  1. Install Vagrant and VirtualBox.
  2. Add the Homestead box:
    vagrant box add laravel/homestead
    
  3. Clone the Homestead repository:
    git clone https://github.com/laravel/homestead.git ~/Homestead
    cd ~/Homestead
    git checkout release
    
  4. Run the init command to create the Homestead.yaml configuration file:
    bash init.sh
    
  5. Edit the Homestead.yaml file to map your project directory.
  6. Start the Vagrant box:
    vagrant up
    

4. Laravel Herd (macOS)

Laravel Herd is a new, lightweight, and fast way to set up a local development environment on macOS.

Installation Steps:

  1. Download and install Laravel Herd from the official website.
  2. Follow the setup instructions provided by the installer.

Conclusion

Each method has its own use case and benefits. If you are already comfortable with Docker, Laravel Sail is a great choice and is officially supported. If you are on macOS and prefer a lightweight setup, Laravel Valet or Herd might be more suitable. Homestead is a good option if you prefer a virtualized environment.

Choose the one that best fits your workflow and development environment. Happy coding!

MohamedTammam's avatar

Doesn't matter. All you need is just PHP and database. Each new solution is there to make things easier from a different point of view.

Doesn't matter what you choose, just pick the easiest to you and start building stuff.

newbie360's avatar

For me, Homestead is best choice

Herd - extra function not free

Docker (WSL) - host OS can't use Github Desktop to mount the WSL repo

martinbean's avatar
Level 80

@stratboy You seem to be confusing installation with serving.

Personally, I install Laravel with Composer (composer create-project laravel/laravel new-project-name) and then use Sail to run the project locally. It means I don’t have to install anything locally and I don’t have to keep messing about with different versions of the same software (i.e. removing PHP 8.2 for 8.3, or maintaining multiple versions for different projects that have different requirements, etc).

1 like
stratboy's avatar

@martinbean Thank you. Not sure what's the difference with:

curl -s "https://laravel.build/example-app" | bash

Could you explain please? Has it different implications?

martinbean's avatar

@stratboy I’m not really a fan of having hitting a URL that’s then going to instantly run shell commands on my computer.

stratboy's avatar

@martinbean It seems that composer create-project laravel/laravel new-project-name is not enough: when I run sail up, the terminal says no configuration file provided: not found. Should I put a docker-compose file? What other steps? Thank you

martinbean's avatar

@stratboy The laravel/sail Composer package is installed, but you’ll still need to run php artisan sail:install to actually generate your docker-compose.yml and whatnot.

puklipo's avatar
  • Laravel 11
  • Mac + homebrew
  • Windows + WSL
  • Both have the latest PHP, composer and node.js installed.
  • What's really important is not Laravel, but the preparation steps up to this point.

Depends on the scale of the project.

Small project

  • laravel new example-app
  • SQLite
  • php artisan serve

This is good for starters. Don't try to do something difficult right from the start.

Medium project

  • https://laravel.build/
  • MySQL
  • sail up -d

Please or to participate in this conversation.