Web development with Vagrant on a local network

by Michael Birch

How to configure any device that’s on your network to view a development website on a Vagrant box. Making sure LiveReload will work on all devices.

Using xip.io

xip.io works like magic to direct requests from other devices on a local network to the host machine.

  • Local VM IP Address:
  • Host IP Address:

puPHPet.com settings for Apache Virtual Host:

  • Server Name dev.domainname
  • Server Alias dev.domainname.

This won’t work yet for other devices on the network, because http://dev.domainname. will be directed to localhost on the host machine. Port forwarding is needed to forward the request to the Vagrant VM.

Port Forwarding

See http://docs.vagrantup.com/v2/networking/forwarded_ports.html

puPHPet.com settings for Local VM Forwarded Ports:

  • Host port: 7777
  • Box port: 80

This means that if you visit, the request will be forwarded to the guest:

Enter this address in a browser on another machine on your network to view the website: http://dev.domainname.


The request needs to go to your host machine. Make sure to specify the host’s IP address in the script that you include in your HTML:

<script>document.write('<script src=""></' + 'script>')</script>
blog comments powered by Disqus