11.12.2018

Sahin Ucar

In a previous post we described how you can use Laravel Valet for your local development environment. This post shows how to setup your local development environment based on Laravel Homestead.

Laravel Homestead

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.

 

1. Requirements

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.

 

2. Installation

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:

 

bash init.sh

 

There will be a Homestead.yaml file afterwards in the ~/Homestead folder.

3. Configure

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 towa.boilerplate.local.

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 ~/etc/hosts file:

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:

 

  • host: 127.0.0.1
  • port: 33060
  • username: homestead
  • password: secret

4. Start

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.

Your turn.

Sahin Ucar

Director Development

We would love to get some feedback, questions, comments or whatsoever :)

Betrunken von zu vielen Informationen

Wie unsere Aufmerksamkeit unter der Digitalisierung leidet

Inspirierender Mensch: Simon Sinek

Digitalagentur Vorarlberg Digitalagentur Wien Digitalagentur St. Gallen TOWA//creative TOWA//beta TOWA//crm TOWA//data

Cookie Einstellungen

Hier sind alle Cookies aufgeführt, die für unsere Marketingzwecke verwendet werden.

Google Analytics (cn_AnalyticsActive)

Wird verwendet, um Daten über das Gerät und das Verhalten des Besuchers an Google Analytics zu senden. Verfolgt den Besucher über Geräte und Marketingkanäle.