Vagrant Homestead Port forward change port number


By default homestead forward ports as below :

  • 80 => 8000
  • 443 => 44300
  • 3306 => 33060
  • 5432 => 54320

By configuration above you can access you webserver outside vm using localhost:8000

but for some reasons probably you want to use another port to access you web server, here are steps to follow :

  1. Open homestead.rb (mine is /home/yusuf/VirtualMachines/Homestead/scripts/homestead.rb)
  2. find following code :
    • # Default Port Forwarding
      default_ports = {
      80 => 8000,
      443 => 44300,
      3306 => 33060,
      5432 => 54320
      }

  3.  change it to :
    • # Default Port Forwarding
      default_ports = {
      80 => 8001,
      443 => 44300,
      3306 => 33060,
      5432 => 54320
      }

  4. run $ vagrant reload

 

  • Vagrant homestead change web server port forward from 8000 to 8001

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s