After having to do this whole process a few times I’ve realized that there is no clear cut way to do it – there’s tutorials for older versions of Homestead and/or Windows but nothing that puts them all together. This is just my experience with how I did it and I’m sure it’ll be a bit different for everyone so feel free to leave a comment if it didn’t work for you.
For this I’m using the latest version of VirtualBox 5.0.2, Vagrant 1.7.4, Composer for Windows, WAMP 2.5 (64 bit) and Windows 8.1.
For my console I mainly use Git Bash from the Git for Windows package here – https://git-for-windows.github.io/
- First thing you want to do is download install VirtualBox from here – https://www.virtualbox.org/wiki/Downloads
- Then you need to download and install Vagrant for Windows from here – http://www.vagrantup.com/downloads.html
- After both are installed your computer needs a reboot. Remember this page and come back when your computer starts up.
- Now you install WAMP – I choose all the default settings and just hit next until it’s ready.
- After that is done you’ll need to install Composer. During this process you’ll be asked for the path to PHP – luckily you now have that on your Windows computer after installing WAMP so point Composer to your PHP binary (for me it was C:\wamp\bin\php\php5.5.12\php.exe)
- At this point I started following standard Homestead installation guides but still ran into some issues. My first one was when I went into Git Bash and tried to run the ‘vagrant box add laravel/homestead’ command and got some sort of TTY error. To fix this I tried doing the same thing but with good old Windows Command in administrator mode and it worked! (Thanks to https://github.com/Vas-ko for this tip)
- Now I went back into Git Bash and installed Homestead globally using Composer with the command ‘composer global require “laravel/homestead=~2.0″‘
- Once this was done I thought it was time to run ‘homestead init’ but I got another error – this time it told me the command wasn’t found. This means I needed to add the Composer binary path to my Windows system variables. To do this: Go to system properties (use search or search in Windows 8.1 for ‘path’ and choose Edit system variables) go to the system variables at the bottom and find one where the variable is Path and double click on the area beside it and add C:\Users\Moe\AppData\Roaming\Composer\vendor\bin (replace Moe with your username on Windows obviously) and make sure to separate it from the one before it with a semicolon ;
- Make sure you restart console (Git Bash) now so that the new system variables can be loaded in
- Time to initialize Homestead, run the ‘homestead init’ command.
- Now it’s time to generate your ssh keys, to do this I go to my root directory in console (cd ~ or go to C:\Users\Yourusername) and run the ‘ssh-keygen -t rsa -C “you@homestead”‘ command and choosing to leave the password blank (I just hit enter at all the prompts)
- Now it’s time to edit your Homestead.yaml file in order to map the server to a directory, if you’re using the default make sure you have a directory called ‘Code’ in your C:\Users\Yourusername directory
At this point you should be up and running with a configuration that matches all others so any other tutorial will apply as to where to go from here. Good luck and feel free to ask questions in the comments.