Laravel

How to install laravel homestead

How to install laravel homestead

Laravel Homestead is an one of the delightful officail pre-package vagrant box for laravel development and It is open sourced, So it will runs on all the operating systems.
Vagrant box which is used to run laravel project in local virtual machines. So that user no need to install php , apache, wamp, xampp or mamp.
Vagrant box is defaultly having php and ngix server to develop a project.

Installation Steps

Before you install homestead make sure you have installed below packages
1. Vagrant
2. Virtualbox

Install Vagrant :

Download and Install Vagrant which suits your operating system.

Install Virtualbox :

Download and Install Virtualbox

Double click Orcle VM virtual box Icon, It will open virtual box.

vagrant-box.png

Lets start to install Homestead for your project.

Install Laravel Homestead to Vagrant box

Once Virtual box has installed, Now we need to add Laravel Homestead to Vagrant box by running the below command.

If this command gets fails, Please make sure are you using updated vagrant.
Now we have added homestead box, So we need to start installing homestead.



Install homestead

Just we need to clone the homestead folder within your home directory.

Once you cloned run bash.init.sh inside homested directory, It will create the Homestead.yaml

How to configure Homestead :

There are two ways of accessing projects using Homestead box.

1. Access all the sides by using common box.
2. Creating induvidual box for each projects.

I will prefer the second way, Because you can easily access this project by another system also.

Step 1 :

Create Laravel project in your Home directory :

Step 2 :

Add Homestead to your laravel folder

It will add Laravel homestead to your folder

Step 3 :

Create Homestead.yaml and Vagrant by running below command

For Linux or MAc

For windows

My Homestead file: 

My Vagrant file : 

Step 4 :

Run Vagrant up command.

It will add your laravel project to vagrant box and create local virtual server.

Step 5 :

Add your hosts to hosts file

For Mac or Linux :

For Windows :

Add your hosts in your hosts file

192.168.10.10 myApplication.dev

Step 6 :

Now you have successfully added homestead for laravel.
Open your browser and enter url as myApplication.dev and run it will run the Laravel project.

Laravel Installed

Thanks for reading this article. If you like this article don’t forget to share and comment.
Thanks!.
Happy Coding!!.