Laravel strives to make the entire PHP development experience delightful, including your local development environment.
About Laravel Homestead
The Laravel Homestead is a type of pre-packaged Vagrant box. It also contains a Vagrant setup. This setup is something different from the normal Vagrant setup. In this setup, no provisions are provided using Chef or Puppet. Instead, users generally flashing a server image with Vagrant. The server image is configured earlier. This setup is loved by many users. The Laravel Homestead is suitable for small teams, and also for small to medium size projects.
While using this Vagrant setup the possibilities of errors are less on versions and OSs. That is the OS and the version errors are less in this setup. This setup provides a quick boot and it is enough to anyone to start with Laravel. Also, one can easily maintain and use Laravel with this setup. This setup does not require any server to setup. Similarly, users don’t need to configure any Vagrant setup. This setup lets the user concentrate only on the code.
What it contains?
Laravel Homestead not only offers the user with an appealing PHP stack for VM but also helps the user to manage multiple sites and projects by using a single VM. This Laravel Homestead comes as a featured package. It not only covers the minimum requirements to use Laravel, but it also makes use of the latest tools. That is it contains the latest tools that will enhance user’s apps and sites.
It contains the following tools,
- Ubuntu 14.04 – Which is a familiar and easy to use, Operating System
- PHP 5.5 – The stable latest build of PHP
- Nginx – The faster, better performing, and easier to configure web server
- MySQL - a popular database
- Node (With Bower, Grunt, and Gulp) – Which contains all the front-end tools and web server
- Redis – The high performing Key Value Store and caching
- Memcached – Contains caching tools
- Beanstalkd – The easy to use Queue server
- Laravel Envoy – The Task Runner of Laravel
- Fabric + HipChat Extension
Steps to configure Laravel Homestead
To setup the Laravel Homestead with Vagrant, users have to follow these steps:
Add Laravel Box to Vagrant
The Laravel Homestead is mainly built for Vagrant. So, in order to use this, users have to make sure that Vagrant is installed. After installing Vagrant, users simply have to download and add the box to Vagrant. This can be done in a single command.
Cloning the Repository
After adding the Laravel Box to Vagrant, one has to clone the official repository of Laravel. But one does not want to clone this where the projects are though. With Laravel Homestead, users have to map all their projects to the project folders on the computer. In general, Homestead behaves as a manager for the entire user’s project. Therefore, while using this, users have to place this somewhere outside of the project folder. For example, one can place the project folder in one location and this in some other location. This helps Homestead to easily manage all your projects.
Users have to clone this inside the directory of Homestead by using the clone command.
Next to this, users have to setup the Homestead.yaml file. This is the only file that allows the user to edit it. After setting up this file, users can open the file and can edit it in their favorite editor. To edit this file, users have to open this file in the editor.
Pair the SSH Keys
In the next step, users have to set the path to the keys. That is users have to set the path for the private and public key. This can be done in the “authorize” area. In this users can reference a path to their public key. If you are using a Mac OS, this can be done very easily. Users simply have to replace the places where it says “me” with the username.
Main folder mapping
After this, the user has to map the main folder where all the projects are going to be placed. In this users have to mention the location of their local machine and Virtual server.
Map your first site
This is the final step. In this users have to map their first site in the sites section. This can be done by using the “Map Key”.