While the prospect of getting a new development machine is often very exciting, I usually dread setting up the development machine. I have to download and install a gazillion tools just to get me started. Switching between machines is usually a nightmare. How can you solve such problems?
In a nutshell, if you are a PHP developer, homestead vagrant is the solution to the above started problem. It is a reproducible, and portable development machine that is easy to configure.
By the end of this tutorial, you would have known what vagrant is, its advantages and the tools that you need to get started. Laravel Homestead gives of all of the products in the image below out of the box.
We will cover the following topics in this tutorial
As the name implies, virtualization of the creation of a simulated object that functions like the actual object. For example, a virtual computer is a simulation of an actual computer and it can be used just like a real computer. We can install the operating system on it and do many other tasks.
There are many advantages to virtualization. Imagine that you are a software developer and needs to see how your system performs in different operating systems. You may want to test the application on Windows, Linux and Mac OS. It could be you want to test the application on Windows only but try different versions i.e. Windows 7, 8, and 10.
Buying dedicated machines for such cases could be very costly for you and even if you manage, who wants to use a lot of different machines at the same time. Virtualization is the solution to the above challenge. All you need is a single machine with great specifications and you can have as many virtual machines as you want.
Virtualization software enables you to create virtual machines. Some of the virtualization software is free and others are commercial. Let’s look at some of the popular virtualization software.
In these tutorial series, we will be working with Oracle Virtual Machine.
In a nutshell, vagrant is a command line utility for managing the lifecycle of virtual machines. Vagrant makes it easy for you to configure and manage reproducible and portable work environments.
The configuration settings for the development environment are stored in a vagrantfile that you can share with other developers. The vagrantfile settings can be configured by a single command vagrant up. The configuration file is cross platform. You don’t need to worry about the operating system that other members are using. Such is the “sinful” nature of vagrant :)
In a nutshell, homestead is a pre-packaged vagrant box that provides you will all the development tools that you need by default.
Let me explain using the roles and permissions analogy. In a role and permissions based authorization system, you define users such as admin and limited. You assign permissions to roles i.e. admin can do everything while limited cannot do certain tasks. When you create a new user, all you do is assign them a role and the permissions defined for that role will automatically be applied to the new user. This saves you the time of assigning the roles individually.
Homestead is similar to a role. It comes with all the PHP and Web development tools required to develop web applications. Once you have setup your virtual machine and vagrant, you simply add homestead box to it and all of the development tools are installed automatically for you. This saves you the time of individually installing the required software.
Laravel homestead isn’t a Laravel framework development framework only. Nope, you can generally development any PHP web application using homestead. We will look at how we can do this as we proceed in the tutorial series.
We already briefed covered this when we started the advantages of virtualization in the above sections. Let’s now look at some more advantages.
In this section, we will look at the system requirements for installing Laravel Homestead. You will basically need the following
If you are using windows, you will need a processor that supports virtualization. The easiest way of checking if your processor supports virtualization is;
Right click on the task bar
Select Task Manager menu
Go to performance tab
If virtualization is supported, the state will either be Enabled or Disabled. If it is disabled, you will need to enable it from the BIOS Setup.
You will need to have sufficient storage space. Homestead box image is about 1GB. The virtual machine that I have created is close to 4GB. Based on these factors. I think its safe to have about 20GB of free space.
A minimum of 4GB is usually sufficient but having 6GBplus of RAM provides a better experience.
You will need to install virtualization software. For this tutorial, we will be using VirtualBox. We will not include the instructor of how to download and install VirtualBox. The process is just like installing any other software.
You can download Vagrant from the official website https://www.vagrantup.com/downloads.html installing vagrant is like installing any other program. Use the comments section if you have any questions or difficult installing it.
This is especially needed for Windows users. We will be using Git bash to interact with our vagrant box.
When you are done installation all of the above software, you will need to restart your machine.
In this tutorial, we have looked at what virtualization is and what it can do for us. We got introduced to vagrant and homestead. We also looked at the system requirements needed to get up and running with Laravel Homestead.
The next tutorial will look at how to install and configure homestead.
Kode Blog Tutorials is dedicated to bring you update to date, high quality free tutorials. You can support us by using the social media buttons to like and share the tutorial and subscribing to our newsletter. Please use the comments section below to give us feedback.
You can sign up for a free account on our site and you will be able to keep track of your progress as you go through the tutorial series.