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

pickles-and-corgis's avatar

Homestead: How do I browse to a new project?

Hey there!

Okay, so, I followed the tutorial in the link below and I got homestead working and I got a Laravel project going. http://arhamzul.com/how-to-install-homestead-and-laravel-on-windows-10/

Because the tutorial had me edit the Window's host file, I can browse to the project just going into my browser and typing myproject.dev

But now I added a second project. I put it in the same folder as the first project (see tutorial). It's called exampleCMS.dev

I have no idea how to access this new project in my browser. Everything I tried led me to my first project.

What should I do? Your help is appreciated! :)

0 likes
11 replies
SaeedPrez's avatar

https://laravel.com/docs/5.2/homestead#adding-additional-sites

Basically, open your homestead.yaml file (locaded in C:\Users\<YourUserName>\.homestead)

sites:
    - map: app.dev
      to: /home/vagrant/path/to/laravelproject1/public
    - map: app2.dev
      to: /home/vagrant/path/to/laravelproject2/public

then run the vagrant provision terminal command from your Homestead directory

pickles-and-corgis's avatar

@SaeedPrez Thanks for that link.

And alrighty, I was able to update the homestead.yaml file and ran the vagrant provision command as instructed. :)

Now I'm wondering what I need to do to make it so I can type examplecms.dev into my browser and it goes to this project?

I am able to do this with my first project. I type in myproject.dev

Here's my hosts file:

192.168.10.10 myproject.dev

michaeldyrynda's avatar

Add another entry into your hosts file for examplecms.dev for the same IP address.

You'll need to add the mapping in homestead as well as the host file so your computer knows that when you type examplecms.dev into your browser, it should resolve to 192.168.10.10.

pickles-and-corgis's avatar

Hmm.... Okay I added the new line to my Windows hosts file which now has it looking like this:

192.168.10.10 myproject.dev
192.168.10.10 examplecms.dev

And I'd already edited my homestead.yaml file like this:

sites:
    - map: myProject.dev
      to: /home/vagrant/Projects/myProject.dev/public
    - map: exampleCMS.dev
      to: /home/vagrant/Projects/exampleCMS.dev/public

But when I type examplecms.dev in the browser it takes me to the myproject.dev site.

Did I miss something?

michaeldyrynda's avatar

Did you also run vagrant provision as @SaeedPrez mentioned above? Each time you add a site to your Homestead.yaml file, you'll need to reprovision the box.

pickles-and-corgis's avatar

@deringer Yeah I did. I went to the root directory of my homestead, git bashed there, and typed in the command. It did a bunch of stuff and seemed to work without errors.

Should I try doing it again?

pickles-and-corgis's avatar

@SaeedPrez @deringer

I have an update. Alrighty, just to see if it would change anything I restarted my computer and I also ran the vagrant provision command again. examplecms.dev is still taking me to the myproject.dev file in the browser. So, I guess the solution is something else.

Hmm, I wonder what it could be. Got any new leads?

Edit: By the way, this is what the folders section of my homestead.yaml file says:

folders:
    - map: C:/Projects
      to: /home/vagrant/Projects

Maybe something is wrong here?

Second Edit:

I also tried what the best answer here suggested: http://stackoverflow.com/questions/27207150/homestead-2-0-multiple-sites-all-link-to-the-same-url

Typing vagrant global-status brought up this:

id       name    provider   state   directory                                   
---------------------------------------------------------------------------------------------------------
117ac4e  default virtualbox running C:/Users/myusername/Documents/virtual_environments/learning_vagrant
03962ee  default virtualbox running C:/xampp/htdocs/june-project/Homestead *

*Homestead ended up in that weird place when I installed it.

I typed in vagrant provision 117ac4e and it said:

default: VM is not currently running. Please, first bring it up with `vagrant up` then run this command.

I typed in vagrant provision 03962ee

That worked. But the problem still persists. Hmm.

pickles-and-corgis's avatar

I solved the problem. Turns out, I didn't realize Homestead had two folders. There's homestead and .homestead and they were in completely different locations.

They both have a homestead.yaml file in them but the one in the .homestead was the one I needed to edit. Once I edited that and ran vagrant provision, everything worked.

1 like
michaeldyrynda's avatar

It will come down to how you've installed homestead - either globally or per-project. Per-project is likely why you'd have a homestead folder in that xampp folder, globally it should have been installed in your home directory (as is the case with Mac/Linux).

Glad you got it sorted out, though.

pickles-and-corgis's avatar

@deringer Yeah I'm not sure how it ended up in that wonky place but apparently I was in that directory when I was installing stuff.

So is there normally a "homestead" and a ".homestead" folder or do normally we only have ".homestead"?

michaeldyrynda's avatar

It all depends on whether you install globally (composer global require) or in your project (composer require)

Please or to participate in this conversation.