top of page
  • Writer's pictureTiffany Silva

Step by Step guide to install Laravel with Homestead

Updated: Aug 23, 2021

Server Requirements


Laravel comes with a number of system requirements. Therefore, an already setup development environment is provided to you which can be installed easily; the Laravel Homestead Virtual Machine.

Laravel Homestead is an official, well packaged development environment provided by vagrant box making it easier to start developing using laravel.


Installation- virtual environment:

The easiest way to run homestead is to first install a software package that provides the capability to run homestead. Although, there are many software packages listed, the free and open source software 'Virtualbox' is the perfect solution regardless of the operating system.


Step 1:

You can easily download virtualbox provided freely by oracle. Download the latest stable version depending on your operating system. Next, download vagrant provided freely by HashiCorp. Both the installations will take you through a setup and if you wish to install manually, that is also possible.

Note: sometimes vagrant installation maybe blocked by firewall, ignore and allow the process to continue.


Step 2:

Next, to install the vagrant homestead box, run the following command,

Step 3:

Clone the homestead git repository in the home directory, run the following command,

checkout to the release branch,

run the following command to create the Homestead.yaml file,

Note: if you haven't installed git bash to run git commands, install it from git.


Step 4:

Create an ssh key in the same directory,

Step 5:

Edit the homestead file as follows,



Step 6:

Windows does not allow to run the homestead.app link to be run from the browser. Therefore, do the following changes,

Go to C:\Windows\System32\drivers\etc\ folder.

Edit the hosts file in any text editor (open in administrator mode) or use nano to edit the file in cmd administrator mode.

Insert the following line,

To insert more sites,

Note: Now, all browsers force to use HTTPS. So instead of running homestead.app, use "homestead.test", "homestead.localhost", "homestead.invalid", "homestead.test", or "homestead.example".

If this sounds like trouble, use firefox as your development browser.


Step 7:

Run the following command to start vagrant homestead from the homestead directory,

Note: To start laravel from anywhere,

Create a 'homestead.bat' file anywhere in the machine and paste the following code,



Remember to replace the 'C:\Homestead' directory with your actual directory to the homestead installation.

Next, add the directory to the newly created file to your PATH variables.

Now you can run the homestead vm from anywhere in the machine by,


Step 8:

Run the following command to start the vm,

Run the command to install laravel in homestead environment,

Next move to the folder you mapped where in this case it's the 'code' folder,

We are ready to make a new laravel project. So I have created a new project called test,

Your project will be created and now you can access through the browser by hitting,

You should now be displayed with,

Now, you have successfully setup your laravel environment with Homestead.

22 views0 comments

Comments


Posts

bottom of page