Search code examples
phplaravelvirtual-machinehosthomestead

Laravel homestead accessing site in browser


I am having trouble accessing a site hosted on a laravel homestead virtual machine, using the hostname homestead.app:8000.

  • http://homestead.app:8000 returns a "This webpage is not available" message in chrome.

  • 127.0.0.1:8000 returns the 'Laravel 5' landing page, which I was expecting from the above.

I have added the following to the /etc/hosts file on my local machine (and tried a few variations of this).

127.0.0.1 homestead.app:8000

Any obvious reasons why this wouldn't work? Steps that may have been missed?

This is the content of the Homestead.yaml file

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

authorize: ~/.ssh/homestead.pub

keys:
    - ~/.ssh/homestead

folders:
    - map: ~/Apps/test
      to: /home/vagrant/Code

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

databases:
    - test

variables:
    - key: APP_ENV
      value: locals

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 93000
#       to: 9300
#     - send: 7777
#       to: 777
#       protocol: udp

Solution

  • Change /etc/hosts on your local machine to this

    192.168.10.10   homestead.app
    

    Save and in the browser of your choice on your local machine navigate to

    http://homestead.app