Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Quaap's avatar

Homestead 2.0 on Windows impossible?

As a novice programmer, trying to learn Laravel, I was looking for a suitable development environment for my projects. So far I used wamp for testing my projects, but I read about the benefits of Homestead 2.0, and wanted to give it a try.

On the internet there are many different tutorials, with almost as many different ways, for installing Homestead. But it seems that installing Homestead 2.0 on windows (7) is virtually impossible. (previous versions apparently were easier to install.?) I can't mention the number of different errors I get during the process. Can anyone give me an advice, or web link with an easy step by step tutorial, on how to get it to work?

The steps:

  • Install VirtuaBox (no errors)
  • Install Vagrant (no errors)
  • Install PHP (only mentioned in one tutorial, openssh error)
  • Install Composer (no error, if php is findable)

After this the problems start.

  • homestead init (among other things, resulted in: autoload.php not found)
  • edit Homestead.ymal (not found)
  • vagrant up (or could not find it, or resulted in errors)

I asked this question on another forum. The response: "If you're not able to get this to work, then maybe you're not suitable to be a programmer". Maybe this is true, but everybody has to start somewhere, and I refuse to give up this easy. (although it already cost me almost two days)

0 likes
25 replies
Robert-Jan's avatar
Level 24

I also struggled with it... It is hard to get it working on Windows (I am a novice programmer to).

I followd this video: https://www.youtube.com/watch?v=-73VP4AW2ec (You can skip some parts like Xdebug)

It is not the best video but if you follow carefully the steps he does with making directorys and the location you must point to execute the commands than it will work.

sitesense's avatar

I can confirm that it works fine in Win 8.1 so I can't see why it wouldn't work in 7.

I followed the instructions here and had no trouble at all:

http://laravel.com/docs/4.2/homestead#installation-and-setup

That said, I already had php installed (xammp) and my ssh keys were already generated.

... I just remembered one problem I had... when I SSH'd into the VM using "homestead ssh", my command line (Git Bash) was doing weird stuff, couldn't "ls" a directory, returned odd characters, couldn't backspace etc.

I fixed this by installing Cmder, a great tool and much nicer command line:

https://bliker.github.io/cmder/

NOTE:

You'll find the Homestead.yaml file here:

C:\Users\yourusername\.homestead\Homestead.yaml
2 likes
Erik's avatar

It is possible in Windows 7, using it myself. Will help you later if still necessary,

Shovels's avatar

@quaap - Stick with it, I'm sure someone on here will be able to help get you up and running. I'm also on Windows, so will try and help.

It's possible that your PATHS need updating to include locations where these tools have been installed.

And whoever said "If you're not able to get this to work, then maybe you're not suitable to be a programmer" is an ass-hat - Ignore them! :)

BlueScreenJunky's avatar

I haven't installed homestead 2.0 yet, but the previous versions were already a pain to install on windows. I found it amusing how it's supposed to make things easier (and it does once you're up and running), but first you have to install Virtualbox, install vagrant, install composer, configure your PATHS, find a software to generate an SSH key, and so on... which can get very confusing the first time.

If I find the time I'll try and install homestead 2.0, document every steps and let you know how it goes. I'm pretty sure it's possible to do on windows.

bestmomo's avatar

Install Homestead is not so hard on Windows but it's after for me. I can get it working with "homestead up". I map in yaml as this :

sites:
    - map: myapp.app
      to: /home/vagrant/Code/Laravel/public

When I use myapp.app in browser I get a 404 error from nginx/1.6.2. I never tried to go further...

bashy's avatar

That just means it can't map the domain to a path that's valid. Maybe your site isn't setup properly (document root as you have mapped it).

bestmomo's avatar

If I do that :

folders:
    - map: ~/projects
      to: /home/vagrant/projects/test

sites:
    - map: myapp.app
      to: /home/vagrant/projects/test

I guess my map is good... but it should not be because doesn't work either...

bashy's avatar

Can you SSH into the VM and check the config for nginx site?

bestmomo's avatar

Thanks @bashy , seems I have some issue with SSH access... looking deeper.

Carlos93's avatar

Hello! Like you I'm new on laravel, after a lot of research about vagrant, virtual environment...etc. I could install Homestead.

One problem was that I couldn't SSH to vm, I had to set the path manually: set PATH=%PATH%;C:\Program Files (x86)\Git\bin

try it!

1 like
Quaap's avatar

Thanks for the massive response! I will give it another try this weekend, using all your suggestions. I will let you know whether it works or not a.s.a.p.

jekinney's avatar

I am a developer by job description... Homestead 1.x worked great on XP to 8.1. When I tried upgrading to 2.0, now 2.1 nothing but issues too.

So your not alone. Unfortunately not much tutorials for windows based systems.

works like a charm on my mac though.

I sidestepped homestead for a Ubuntu vm and set it up. One amazing thing about using a vm, makes deployment so much easier as you can 100% replicate the deployment environment where you can't with wamp, mamp etc.

sitesense's avatar

@bestmomo

Sorry I didn't notice this earlier, but if you're on windows the folders mapping probably needs changing like this:

folders:
    - map: C:\projects
      to: /home/vagrant/projects/test

sites:
    - map: myapp.app
      to: /home/vagrant/projects/test

I've always done it this way with no problems.

Obviously "C:\projects" needs changing to the actual path, perhaps "D:\somefolder\projects".

Also, make sure you edit your "hosts" file (with administrator priveledge).

// C:\Windows\System32\drivers\etc\hosts

192.168.10.10    myapp.app
ilmala's avatar

I use bliker.github.io/cmder wery useful. Installato first wamp o xamp ecc... And pur PHP exe in tour path. Reboot cmder when change windows path. Install git and SSH is not in same folder . you need to put both in path.

bestmomo's avatar

@sitesense thanks for your help but I tested it and it doesn't work with this mapping. I think I'll look at this homestead later. It's supposed to save us time but when I see all the questions and issues related in this forum I wonder ^^. So for now I keep my old Wamp that works like a charm !

Quaap's avatar

I finally managed to get Laravel running using homestead. Again thanks for all your responses, together you have helped me to get homestead working .

Obviously I ran into a few problems on the way..

  • It seems you still have to install WAMP, although I thought you use Homestead so you won't have to use WAMP anymore.

  • I also discovered that you can't use TAB's in the yaml file, vagrant up will then result in some errors.

I still have a few questions:

  • I managed to make a database connection from within my laravel app. But how can I install phpMyAdmin, so I can view the database? Can I do this from the Git Bash command line?

  • What steps do I have to take to get the copied projects from WAMP working on Homestead? (aside from migrate en db:seed)

My homestead.yaml file:

folders:
    - map: ~/WebProjects/Code
      to: /home/vagrant/Code

sites:
    - map: site1.local
      to: /home/vagrant/Code/site1/laravel/public
    - map: site2.local
      to: /home/vagrant/Code/site2/laravel/public
    - map: site3.local
      to: /home/vagrant/Code/site3/laravel/public
    - map: site4.local
      to: /home/vagrant/Code/site4/laravel/public

My hosts file:

192.168.10.10    site1.local www.site1.local   
192.168.10.10    site2.local www.site2.local
192.168.10.10    site3.local www.site3.local
192.168.10.10    site4.local www.site4.local

When I visit site4.local in the browser it uses the site1 folder where I have a fresh install of Laravel 4.

site2.local was using the correct folder site2 with a Laravel 5 installation, but after a vagrant provision command it also uses the site1 folder. I used vagrant provision to reconfigure the vagrant managed machine, hoping it would fix these issues. Even php artisan serve from within the site4 folder, redirects me to the site1 folder when visiting localhost:8000. Am I doing something wrong?

sitesense's avatar

I can help you with the db connection...

Connect with hostname 127.0.0.1 port 33060 User: homestead Pass: secret

Also if you copy your projects over to your 'Code' folder or whatever it's called now, they should automatically be replicated in the VM.

You'll need to update your hosts file for each project that you add and set up the sites in Homestead.yaml

Then it's a case of running your migrations by connecting to the server with ssh - homestead ssh

Devon's avatar

You do not need to install WAMP, Apache, or anything else... If you're using the homestead helper scripts, then all you will need to install is PHP add Composer. Actually, if you manually clone the github repo, you don't even need them.

Aside from that, I typically just use Git Bash for my command-line stuff and I have it set as the default terminal in PHPStorm too.

I did have a few issues getting Homestead 2 set up and working, but I installed it the day after it was released and it had several issues on Windows... Many of those issues have been fixed though, so it should be a fairly straight forward process.

The docs, however, do seem to neglect Windows users a bit and could certainly be improved. Maybe if I get some time I'll send a PR if no one else beats me to it.

undrwd's avatar

I've always had problems with Rails and Laravel on windows. I switched to mac last year and it relieves a lot of headaches with just getting your development environment setup. Things just work on mac, where windows always involves countless hours tracking down issues/errors no one else seems to be experiencing. Plus mac hardware and software is more enjoyable as well. I'll never go back to windows. I'm sure you can get things up and running on windows but I would weigh the time involved. There is a reason why most developers are using macs. I would recommend a 13" macbook air (4GB of Ram is enough btw, 8GB is preferred of course). I would also recommend an asus 24" monitor on amazon ($150), a thunderbolt to hdmi adapter ($12), apple wireless trackpad and wireless keyboard and a rain design, mstand ($50). Then you'll have an excellent desktop and mobile dev setup.

pratik07shah's avatar

@Quaap @sitesense : How we should do mapping to projects placed in another Drive ?

folders:

- map: D:\something\Projects
  to: /home/vagrant/Code

sites:

- map: homestead.app
  to: /home/vagrant/Code/Laravel/public

I hope you guys will be able to help me out.

sitesense's avatar

You can just change the folder mapping to the drive where your projects are located.

folders

- map: path/to/your/local/folder
  to: /home/vagrant/Code

I've never tried but perhaps you could map several folders if that's what you are thinking - although the file syncing might be an issue - give it a try though and see what happens:

folders

- map: path/to/your/local/folder
  to: /home/vagrant/Code
- map: path/to/your/other/local/folder
  to: /home/vagrant/Code
bsesic's avatar

@ilmala If you don't want to install XAMPP you can just download the php Windows binaries here: http://windows.php.net/download/. Unpack it to a folder where you wish to have the binaries, e.g. C:/<your-folder-name>. Then add the path of the folder to your system settings. Either by using the Systemsettings or in a console by set PATH=%PATH%; <path-to-your folder> (without the space).

I think you also need to download an install ruby.

Using just php is a better thank using XAMPP. XAMPP needs lot of space, eat's up all your RAM and writes a lot of temporary files to the system. Also you get a full blown system with php, mysql, a ftp server and so on and you just don't need it if you are using homestead. If you are using XAMPP what you you need homestead for?

ilmala's avatar

@bsesic I need for old project and use homestead for the new, but on windows is too slow! For testing new things i prefer use artisan serve with sqlite. And Yes i have ruby, node ecc.... a pain on windows ;) Fortunately at home i have my macbook pro 15 ... another world!

Please or to participate in this conversation.