Skip to content

Vendor-neutral, engineer-written explanations. Clear definitions first, then practical steps with real examples — no fluff.

What is Homestead in Laravel?

SB
Written by StageBit Engineering Team
Updated January 2026 3 min readVerified by engineers

Laravel Homestead is an official, pre-packaged Vagrant virtual machine designed to provide a complete PHP development environment. It includes everything you need to develop Laravel applications without installing PHP, a web server, or other services on your local machine. Note that Homestead is a legacy package and Laravel Sail is the modern alternative.

Why Use Homestead?

  • Provides a pre-configured development environment for Laravel projects.
  • Runs consistently on Windows, macOS, or Linux.
  • Includes Nginx, multiple PHP versions, MySQL, PostgreSQL, Redis, Memcached, Node, Docker, and more.
  • Fully isolated, disposable, and easy to recreate with Vagrant.
  • Supports advanced tools like Xdebug, Blackfire, Mailpit, Minio, and Laravel Dusk.

Without Homestead

Without Homestead, you would need to manually install and configure each service:

  • Install PHP, Nginx/Apache, MySQL/PostgreSQL, Node.js, Composer, Redis, and other dependencies.
  • Configure PHP versions, services, and environment variables manually.
  • Debugging tools like Xdebug or Blackfire require separate setup.
  • Sharing your local environment with team members is more complex.

Included Software in Homestead

  • Ubuntu 22.04, Git, Composer
  • PHP 5.6 – 8.3 (multiple versions available)
  • Nginx, MySQL 8.0, PostgreSQL 15, SQLite3
  • Redis, Memcached, Docker, Node (with Yarn, Bower, Gulp, Grunt)
  • Mailpit, Beanstalkd, Xdebug, XHProf/Tideways/XHGui

Optional Software

You can enable optional services via Homestead.yaml features:

  • Apache, Elasticsearch, MongoDB, MariaDB, Neo4j, Cassandra, CouchDB
  • Grafana, InfluxDB, Logstash, MinIO, PM2, Python, R, RabbitMQ, Rust
  • Laravel Dusk Webdriver, Oh My Zsh, Blackfire, RVM

Installation and Setup

  1. Install Vagrant and a supported provider (VirtualBox, Parallels).
  2. Clone the Homestead repository:
    git clone https://github.com/laravel/homestead.git ~/Homestead
    cd ~/Homestead
    git checkout release
  3. Create the configuration file:
    # macOS / Linux
    bash init.sh
    
    # Windows
    init.bat
  4. Edit Homestead.yaml to configure shared folders, sites, databases, PHP versions, and services.
  5. Launch the Vagrant box:
    vagrant up

Configuring Homestead

1. Provider

Set the Vagrant provider in Homestead.yaml:

provider: virtualbox

2. Shared Folders

Map your project directories to the virtual machine:

folders:
    - map: ~/code/project1
      to: /home/vagrant/project1
      type: "nfs"

3. Sites

Map domains to project folders:

sites:
    - map: homestead.test
      to: /home/vagrant/project1/public

4. Environment Variables

variables:
    - key: APP_ENV
      value: local
    - key: FOO
      value: bar

5. PHP Versions

Specify PHP version per site:

sites:
    - map: homestead.test
      to: /home/vagrant/project1/public
      php: "8.1"

6. Services

Enable or disable services:

services:
    - enabled:
        - "postgresql"
    - disabled:
        - "mysql"

7. Ports

Forward additional ports if needed:

ports:
    - send: 50000
      to: 5000
    - send: 7777
      to: 777
      protocol: udp

Advanced Usage

  • SSH:vagrant ssh into your Homestead machine.
  • Add multiple sites: Configure multiple Laravel projects on the same VM.
  • Mailpit: Intercept emails locally at http://localhost:8025.
  • Minio: Use S3-compatible storage locally.
  • Laravel Dusk: Enable webdriver: true for browser testing.
  • Debugging: Use Xdebug or Blackfire for profiling.
  • Extending: Add custom scripts via after.sh or user-customizations.sh.

Daily Workflow

  1. SSH into the VM: vagrant ssh
  2. Access sites in browser via configured domains (e.g., http://homestead.test).
  3. Run Laravel Artisan commands for each PHP version if needed.
  4. Forward ports or add new services as required.

Updating Homestead

  1. Destroy the current VM: vagrant destroy
  2. Pull the latest repository updates: git fetch & git pull origin release
  3. Update composer dependencies: composer update
  4. Update Vagrant box: vagrant box update
  5. Re-provision the VM: vagrant up

Summary

Homestead provides a complete, consistent, and isolated Laravel development environment that works across operating systems. It includes multiple PHP versions, databases, caching tools, and developer utilities. Even though Homestead is a legacy package and Laravel Sail is now preferred, it remains a great way to set up a Laravel development environment quickly and reliably.

Was this answer helpful?

Your feedback helps us improve our answers.

Still need help?

Talk to our Laravel experts

We've handled GDPR/CCPA compliance for dozens of EU & US Laravel.

Talk to Laravel Experts

Tell us more about your brand!

Rohit Kundale, Our VP of Sales and Marketing is ready to meet with your team.