Creating a new laravel with homestead is very easy and convenient. Follow along to create a new application project using homestead's terminal commands to add new websites in your virtualbox virtual machine. In our example, we already have homestead.test running fine but what if we want to add another application, lets call it myApp. Follow these instructions:

  • Stop Vagrant
  • Edit Homestead.yaml
  • Edit hosts File
  • Restart Vagrant with provisioning flag
  • View in Browser

Note: > means its a DOS command in windows

Stop Vagrant

To stop vagrant if you are already running, run this command:
> vagrant halt

Edit Homestead.yaml

Open the Homestead.yaml with your favorite editor and make it look like this:

---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox

# YOU CAN SKIP THESE TWO OPTIONS FOR TESTDEV:
#authorize: ~/.ssh/id_rsa.pub

#keys:
#    - ~/.ssh/id_rsa

folders:
    - map: F:\Path\To\LARAVEL\Projects
      to: /home/vagrant/code

sites:
    - map: homestead.test
      to: /home/vagrant/code/example/public

    - map: myApp.test
      to: /home/vagrant/code/myApp/public

databases:
    - homestead

features:
    - mariadb: false
    - ohmyzsh: false
    - webdriver: false

Be sure to save your changes.

Edit hosts File

open hosts file as administrator. You can find the hosts files in windows in the following folder: C:\Windows\System32\drivers\etc\

Add the myApp into your list. The hosts file should look like this at the bottom of the file:

192.168.10.10    homestead.test
192.168.10.10    myApp.test

Restart Vagrant

To restart your vagrant use the --provisioning flag to take the new changes. The virtualbox server will serve both websites. Run the following command:
> vagrant up --provision

Open in Browser

Now you can open both different websites or projects from one single virtualbox.

http://homestead.test

http://myapp.test

Resources:

https://laracasts.com/discuss/channels/requests/create-multiple-sites-on-homestead-20