How to share your local Homestead box in Internet

Homestead is the standard development box for Laravel developers. But it would be great if for example you can paste a url to your colleagues so that they see what you are seeing in your local box?

Posted by Darwin Biler on January 18, 2015

Homestead is the standard development box for Laravel developers. But it would be great if for example you can paste a url to your colleagues so that they see what you are seeing in your local box?

Here is a simple trick. Vagrant has a feature called Vagrant Share . It basically allows you to generate a publicly available url of your local vagrant box, so that they can access your web app.

First thing you need to do is to create an account in VagrantCloud (if you don't have one yet).  You can sign up in here.

After you had signed-up and verified your account to be working. You need to login to your local vagrant. To do this, just execute

vagrant login

It will ask for your username/password that you just had created earlier.
After that, you need to locate where is the Vagrantfile of Homestead. In  *nix machines, this can be found in

~/.composer/vendor/laravel/homestead

So, just go into that folder and execute "vagrant share".

This is how it looked like when I did it in my end.

Screen Shot 2015-01-19 at 12.57.43 AM

 

In my case, my Homestead box was assigned with this url:

http://sultry-ground-2423.vagrantshare.com

That means, anyone in the Internet which can have this url will be able to access my Homestead box and see the locally hosted apps I'm developing as long as I'm not hitting "Ctrl+C" in my end.

Note that those urls changes each time you execute vagrant share. So its only actually useful for quick demo or tests that you want to show to someone else.


Did you find this useful?

I'm always happy to help! You can show your support and appreciation by Buying me a coffee (I love coffee!).