The Beard’s First Vagrant

About a year ago I decided I wanted to start using PHP. I remember from one of the best developers I’d ever met, that he used Vagrant to run his virtual environment. I looked into all sorts of variants of Vagrant and how to use them. The one thing I found that 99.9% of them had in common….they weren’t written for someone who wasn’t familiar with command line or had much experience outside of the “Hello World” class.

I’ve created a document for Free Code Camp covering Vagrant and the box in which I use. I will cover it here as well in hopes that someone might be able to alleviate the pulling out of their hair for a day and walk away with a win.

First off, you’ll need to get a few free programs. They’re safe and absolutely free!! First we need to install Vagrant and Virtual Box. As I’m not even close to being called a command line guru, I also installed a Git GUI (I use PC).

Once you have all of those installed, the rest of the process to get your first Vagrant Up and running (see what I did there? lol), is a very simple process.

Open Git GUI and a small box will pop up. I select the Create New Repository and go to whatever drive it is I want to save it to, name it, and select create and so on until the box changes.

Now you’ll have a window broken down into several portions that contain information that I’m not going to discuss here. The top left option on the menu at the top reads “Repository”. Select that and on the drop-down, select “Git Bash”.

Now you’ll have a command line interface pop up showing you in that directory. Cool!!

The next few items are rather simple and might take a few minutes to do as it might need to install for the first time.

Think of a name for the folder you want all the files for your project in. For the purpose of this article, we’ll name it “web-dev” (without the “” when you type it).

On our command line, let’s type the following:

git clone https://github.com/scotch-io/scotch-box.git web-dev

Then press Enter.

You’ll see some dialog on the command line then the prompt will return and you can type your next command:

cd web-dev

Press Enter.

You are now in the directory you want all your code and files to be stored. Now for the final command…..can you guess what it is???

vagrant up

Press Enter and watch it do it’s magic.

Once you see the magic trick is finished, open your browser and go to this URL:

http://192.168.33.10/

You’ll see a really cool landing page that will tell you all sorts of cool things.

Hopefully this was a win for you. If you want to know more about the Scotch Box, head on over to their site and see what all it has to offer. I love it and will never use anything else. https://box.scotch.io/

I hope someone finds this helpful as I did.

May the Beard be with you….