Laravel Homestead is an official package for vagrant. It’s packed with all the needed software for a Laravel project, but the used stack is also suitable for any other PHP-based application.
The box includes the Nginx web server, PHP 5.6 til 7.3, PostgreSQL, MySQL, Redis, Memcached and few other software. You can find the full list in the official documentation.
It’s perfect for an independent setup on your machine without installing any other software than vagrant and a VM-provider like virtualbox.
WordPress & Homestead
We use the same bedrock-based setup as mentioned in our post about the Valet example. The same applies here, you can use the default or any other WordPress Boilerplate.
It takes a little bit more time than setting up Valet, but it’s just as easy.
Before installing Laravel Homestead, check if you have vagrant as well as a VM-provider installed. Following VM-providers are supported: VirtualBox, VMWare, Parallels or Hyper-V.
Please also check the further information for the VM-providers other than vagrant here.
We use the combination of vagrant + VirtualBox.
For installing Homestead you can either use vagrant or clone the repository itself. To download the Homestead-box via vagrant, use the following command:
vagrant box add laravel/homestead
If you consider cloning the Homestead-repo instead, use the following:
▲ git clone https://github.com/laravel/homestead.git ~/Homestead
▲ cd ~/Homestead
▲ git checkout v7.xx.0 // Clone the desired release...
After the cloning run the initialisation script which creates the Homestead configuration file:
There will be a
Homestead.yaml file afterwards in the
The created configuration file has everything we need already. We’ll just adjust the mapping and domain-name for the demo-project, so it’s callable via
Nothing complicated or special there. Just map the desired project folder to the VM-folder. Also note the
/web as the root, which is required for the bedrock setup.
To call the website via
towa.boilerplate.local adjust your
So far so good. The final step before we need is to create a database to use. The database credentials are per default the following:
That’s it. Now you can start the vagrant box – will take a few minutes the first time – and then you’re good to go.
For starting just run
vagrant up in the
~/Homestead folder. If the VM is ready you can open now
towa.boilerplate.local and also
ssh into the VM.