Top Related Projects
A more enjoyable local development experience for Mac.
Docker files for running a basic Laravel application.
Full PHP development environment for Docker.
An open source Vagrant configuration for developing with WordPress
Scotch Box is a preconfigured Vagrant Box with a full array of LAMP Stack features to get you up and running with Vagrant in no time.
WordPress LEMP stack with PHP 8.2, Composer, WP-CLI and more
Quick Overview
Laravel Homestead is a pre-packaged Vagrant box that provides a development environment for Laravel, a popular PHP web framework. It includes a variety of software components, such as Nginx, MySQL, PostgreSQL, Redis, and more, making it a complete development environment for building Laravel applications.
Pros
- Consistent Development Environment: Homestead provides a consistent and reproducible development environment, ensuring that your application behaves the same way across different machines.
- Easy Setup: Homestead simplifies the setup process for a Laravel development environment, reducing the time and effort required to get started.
- Flexibility: Homestead supports multiple operating systems (Windows, macOS, and Linux) and can be customized to fit your specific development needs.
- Comprehensive Toolset: Homestead comes pre-installed with a wide range of tools and services, including databases, message queues, and caching systems, making it a one-stop-shop for Laravel development.
Cons
- Overhead: Homestead requires the use of Vagrant and VirtualBox, which can add some overhead and complexity to the development process.
- Limited Customization: While Homestead is highly customizable, the level of customization may be limited compared to setting up a development environment from scratch.
- Performance: The performance of the development environment may be slightly lower than a native setup, especially for resource-intensive tasks.
- Learning Curve: Developers who are new to Vagrant and VirtualBox may need to invest some time in learning how to use and configure Homestead effectively.
Getting Started
To get started with Laravel Homestead, follow these steps:
- Install VirtualBox and Vagrant on your machine.
- Clone the Homestead repository:
git clone https://github.com/laravel/homestead.git
- Navigate to the Homestead directory and copy the example Homestead configuration file:
cd homestead cp Homestead.yaml.example Homestead.yaml
- Customize the
Homestead.yaml
file to match your development needs, such as specifying the project directories and database configurations. - Run the Homestead provisioning command to set up the virtual machine:
vagrant up
- Once the provisioning is complete, you can access your Laravel application by visiting
http://homestead.test
in your web browser.
That's it! You now have a fully-configured Laravel development environment using Homestead.
Competitor Comparisons
A more enjoyable local development experience for Mac.
Pros of Valet
- Lightweight and faster setup compared to Homestead
- Utilizes native macOS services, reducing resource usage
- Simpler configuration and management for Mac users
Cons of Valet
- Limited to macOS environments
- Less isolated development environment than Homestead
- May require manual installation of some services
Code Comparison
Valet (Nginx configuration):
server {
listen 80;
server_name example.test;
root /path/to/example/public;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
}
Homestead (Vagrant configuration):
Vagrant.configure("2") do |config|
config.vm.box = "laravel/homestead"
config.vm.network "private_network", ip: "192.168.10.10"
config.vm.synced_folder ".", "/home/vagrant/code"
config.vm.provision "shell", path: "after.sh"
end
Valet focuses on simplicity and native macOS integration, making it ideal for Mac users who want a quick setup. Homestead provides a more comprehensive, cross-platform solution with a full virtual machine environment, offering better isolation and consistency across different operating systems. The choice between the two depends on your specific development needs and preferences.
Docker files for running a basic Laravel application.
Pros of Sail
- Lightweight and faster setup, using Docker containers
- Easier integration with CI/CD pipelines
- More closely mirrors production environments
Cons of Sail
- Less comprehensive out-of-the-box tooling compared to Homestead
- Requires Docker knowledge for customization
- May consume more system resources when running multiple projects
Code Comparison
Homestead (Vagrantfile):
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = HOMESTEAD_BOX
config.vm.hostname = "homestead"
# ... more configuration
end
Sail (docker-compose.yml):
version: '3'
services:
laravel.test:
build:
context: ./vendor/laravel/sail/runtimes/8.0
volumes:
- '.:/var/www/html'
# ... more configuration
Both Homestead and Sail aim to provide development environments for Laravel projects, but they use different approaches. Homestead uses a full virtual machine, while Sail leverages Docker containers. Sail offers a more lightweight and flexible solution, making it easier to set up and integrate with modern development workflows. However, Homestead provides a more comprehensive set of pre-configured tools and may be easier for developers who are not familiar with Docker.
Full PHP development environment for Docker.
Pros of Laradock
- More flexible and customizable, allowing for a wider range of development environments
- Supports multiple projects simultaneously with different PHP versions and extensions
- Easier to extend with additional services and tools
Cons of Laradock
- Steeper learning curve, especially for those new to Docker
- Requires more manual configuration and setup compared to Homestead
- Can be more resource-intensive, particularly when running multiple containers
Code Comparison
Homestead (Vagrantfile):
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = HOMESTEAD_BOX
config.vm.hostname = settings["hostname"] ||= "homestead"
config.vm.boot_timeout = 600
end
Laradock (docker-compose.yml):
version: '3'
services:
workspace:
build:
context: ./workspace
volumes:
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
extra_hosts:
- "dockerhost:${DOCKER_HOST_IP}"
Both Homestead and Laradock aim to simplify Laravel development environment setup, but they take different approaches. Homestead uses Vagrant and VirtualBox, providing a more traditional VM-based solution, while Laradock leverages Docker containers for a more modern and flexible approach. The choice between them depends on the developer's familiarity with the technologies and specific project requirements.
An open source Vagrant configuration for developing with WordPress
Pros of VVV
- Specifically designed for WordPress development, offering a more tailored environment
- Includes multiple WordPress installations and configurations out of the box
- Provides a robust set of development tools and utilities for WordPress
Cons of VVV
- Generally slower to provision and boot compared to Homestead
- Can be more resource-intensive, especially for older or less powerful machines
- Less flexibility for non-WordPress projects
Code Comparison
VVV (config.yml):
sites:
wordpress-one:
repo: https://github.com/WordPress/WordPress.git
hosts:
- one.wordpress.test
Homestead (Homestead.yaml):
sites:
- map: homestead.test
to: /home/vagrant/code/public
VVV focuses on WordPress-specific configurations, while Homestead provides a more general-purpose setup. VVV's configuration allows for easy setup of multiple WordPress sites, whereas Homestead's configuration is more flexible for various PHP projects.
Both repositories use Vagrant for creating development environments, but they cater to different needs. VVV is optimized for WordPress development, offering pre-configured WordPress installations and related tools. Homestead, on the other hand, provides a more versatile environment suitable for various PHP frameworks, including Laravel.
Scotch Box is a preconfigured Vagrant Box with a full array of LAMP Stack features to get you up and running with Vagrant in no time.
Pros of Scotch Box
- Simpler setup process, requiring fewer configuration steps
- Includes a wider range of pre-installed tools and software
- More beginner-friendly with extensive documentation and tutorials
Cons of Scotch Box
- Less frequently updated compared to Homestead
- Not officially supported by Laravel, potentially leading to compatibility issues
- Limited customization options out of the box
Code Comparison
Homestead (Vagrantfile):
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "laravel/homestead"
config.vm.hostname = "homestead"
config.vm.provider "virtualbox" do |vb|
vb.name = "homestead"
end
end
Scotch Box (Vagrantfile):
Vagrant.configure("2") do |config|
config.vm.box = "scotch/box"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.hostname = "scotchbox"
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
end
Both Homestead and Scotch Box are popular Vagrant boxes for PHP development. Homestead is officially supported by Laravel and offers tighter integration with the framework. It's regularly updated and provides a more streamlined experience for Laravel developers. Scotch Box, on the other hand, offers a broader range of pre-installed tools and is more accessible to beginners. However, it may require additional configuration for optimal Laravel development and receives less frequent updates.
WordPress LEMP stack with PHP 8.2, Composer, WP-CLI and more
Pros of Trellis
- Designed specifically for WordPress development, offering optimized configurations
- Supports multiple environments (development, staging, production) out of the box
- Includes built-in security features like SSL/TLS and fail2ban
Cons of Trellis
- Steeper learning curve, especially for developers new to Ansible
- Less flexibility for non-WordPress projects compared to Homestead
- Requires more manual configuration for custom setups
Code Comparison
Trellis (Ansible playbook example):
- name: Install WordPress
command: wp core install
args:
chdir: "{{ www_root }}/{{ item.key }}/current/"
with_dict: "{{ wordpress_sites }}"
Homestead (Vagrantfile example):
config.vm.define "web" do |web|
web.vm.hostname = "homestead"
web.vm.box = "laravel/homestead"
web.vm.network "private_network", ip: "192.168.10.10"
end
Both repositories provide development environments, but Trellis focuses on WordPress-specific configurations using Ansible, while Homestead offers a more general-purpose PHP development environment using Vagrant.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Introduction
Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, or any other server software on your local machine. No more worrying about messing up your operating system! Vagrant boxes are completely disposable. If something goes wrong, you can destroy and re-create the box in minutes!
Homestead runs on any Windows, Mac, or Linux system, and includes the Nginx web server, PHP, MySQL, Postgres, Redis, Memcached, Node, and all of the other goodies you need to develop amazing Laravel applications.
Official documentation is located here.
Components
Homestead is made up of 2 different projects. The first is this repo which is the Homestead application itself. The application is a wrapper around Vagrant which is an API consumer of a virtualization hypervisor, or provider such as Virtualbox, Hyper-V, VMware, Or Parallels. The second part of Homestead is Settler, which is essentially JSON & Bash scripts to turn a minimalistic Ubuntu OS into what we call Homestead base box. Homestead and Settler (AKA Homestead Base / Base Box) combined give you the Homestead development environment.
When you run
vagrant up
for the first time Vagrant will download the large base box from Vagrant cloud. The base box is the output from Settler. The base box will be stored at~/.vagrant.d/
and copied to the folder you ran vagrant up command from in a hidden folder named.vagrant
. This is what allows vagrant to create a VM and destroy it quickly and without having to download the large base box again.
Current versions
Ubuntu LTS | Settler Version | Homestead Version | Branch | Status |
---|---|---|---|---|
22.04 | 14.x | 15.x | main | Development/Unstable |
22.04 | 14.x | 15.x | release | Stable |
Developing Homestead
To keep any in-development changes separate from other Homestead installations, create a new project and install Homestead from composer, forcing it to use a git checkout.
$ mkdir homestead && \
cd homestead && \
composer require --prefer-source laravel/homestead:dev-main
After it's complete, vendor/laravel/homestead
will be a git checkout and can be used normally.
Top Related Projects
A more enjoyable local development experience for Mac.
Docker files for running a basic Laravel application.
Full PHP development environment for Docker.
An open source Vagrant configuration for developing with WordPress
Scotch Box is a preconfigured Vagrant Box with a full array of LAMP Stack features to get you up and running with Vagrant in no time.
WordPress LEMP stack with PHP 8.2, Composer, WP-CLI and more
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot