Homestead is a Vagrant box that simplifies creating a PHP/MySQL/nginx environment.


I put Homestead here (the default place):

cd ~/Homestead


Add the folder and site mappings:

# Edit with nano
nano ~/.homestead/Homestead.yaml

# Or edit with Atom
atom ~/.homestead/Homestead.yaml

Update hosts file:

sudo nano /etc/hosts

Reload the Homestead (Vagrant) box:

homestead reload --provision


Using the VM

# Change directory
cd ~/Homestead

# Start the VM
vagrant up

# Provision the VM (won't lose your data)
vagrant provision

# Provision something stubborn
vagrant reload --provision

# SSH into the VM
vagrant ssh

# Stop the VM
vagrant suspend

Make an alias

It’s annoying having to leave your project directory to start the VM. Add a function to your bash profile:

function homestead() {
    ( cd ~/Homestead && vagrant $* )

Now you can be inside any folder and run these:

homestead up
homestead provision
homestead reload --provision
homestead ssh
homestead suspend



cd ~/Homestead

# Update the Git repo
git pull

# Update the vagrant box
vagrant box update

Platform tricks

For Laravel

Works great. Homestead was made by Laravel.

For Statamic

Works great with one modification for the Statamic admin.

Edit ~/Homestead/scripts/ and find this code:

location / {
    # GravDept: add this line for Statamic
    rewrite ^/admin.php.*$ /admin.php;
    # GravDept: end

    try_files \$uri \$uri/ /index.php?\$query_string;

Remember to run homestead provision afterward.