Starting with Vagrant on Ubuntu 14.10 - A Beginner's Guide

This tutorial will cover the installation of Vagrant on Ubuntu 14.10, explain the basics of this great virtualisation tool and will guide you trough the creation of your first Vagrant instance.

Why do you need Vagrant?

To start with, I am sure this must be first question in every beginner's mind, that Why do I need it? To answer this, Vagrant is a piece of software through which you can create and configure virtual development environments. It is an highly efficient tool for managing virtual machines via CLI. This increases your and your team's productivity and flexibility.

Here, machines are provisioned on top of any of the virtualization tool, i.e. VirtualBox, VMware, AWS, or of any other provider. Later, industry-standard provisioning tools such as shell scripts, Puppet or Chef, can be used to automatically install and configure software on the machine.

This simply means that you can get a easy to configure, reproducible, and portable work environments as and when you require.

How does it benefits?

Vagrant has benefits to developers, operations engineer, designers and more. Here the key is that Vagrant makes it really easy with the fact that there is no complication or using vim and loads of annoying command line stuff easy to run a development environment. Getting your first development virtual machine ready will take minutes. (Excluding box/image download time).

Once you have finished developing, you can check in your changes, ask your colleague to check them out, and then they run the code on the exact same machine. This even works if they are on any part of world and is platform independent i.e. regardless of whether they are on Windows, Linux or Apple OS X. It is safe to say goodbye to "works on my machine" bugs after using Vagrant.

You'll surely get to know the benefits better once you start using it. You can read more about benefits here.

Getting Started

Download & install the latest version of Vagrant & Virtual Box, by visiting Vagrant Downloads and VirtualBox Downloads. Usually, the newest version of VirtualBox will work fine, but you should verify the version compatibility with Vagrant, by checking the official Vagrant docs.

Since I am using Ubuntu 14.10 x86_64, I'll show you how to download & install them on it:

Download them by:



Install them by:

sudo dpkg -i vagrant_1.7.2_x86_64.deb

sudo dpkg -i virtualbox-4.3_4.3.22-98236~Ubuntu~raring_amd64.deb

Here are some terms which you must understand before we run our first vagrant box:

Vagrant Box

A box is basically a package containing a representation of a virtual machine running a specific operating system. To be more simple, it is a base image of any Operating System or Kernel. It may be for a specific Provider.


The Provider is the piece of software responsible for creating and managing the virtual machines used by Vagrant. The main providers are Virtualbox and VMware, but the default one is VirtualBox, since it's free and open source.


Provisioner will do some task(s) using the vm instance already provided. The provisioners are used to set up the virtual server, installing all necessary software and executing different tasks. The most used provisioners are: Puppet, Chef and Ansible. Shell Script is also a very common option. You can find more information about vagrant provisioners here.

The Vagrantfile

The basic vagrant configuration is based in one file, the Vagrantfile. It shall be placed in your repository root. In this file you will define which base box you want - a box is, basically, a package with an operational system to be run in your virtual machine.

Creation of Instance

Create a test directory where we would be creating our first instance.

mkdir -p ~/Vagrant/test

cd  ~/Vagrant/test

We'll be using Ubuntu 12.04 LTS (Precise Pangolin), which already has a "box" set up.

vagrant box add precise32

You see here the argument precise32 which is a nickname for the URL. The box is downloaded at ~/.vagrant.d/boxes. You can now create an instance:

vagrant init precise32

vagrant up

If all goes well, it will now be running. Below is how the very basic VagrantFile looks like:

Vagrant.configure(2) do |config| = "precise32"

Please note- I have deleted the commented lines to avoid confusion.

If you want to get into this instance, via SSH, use this command:

vagrant ssh

Your instance is ready!

We'll learn more about Vagrant in the next tutorial.

Share this page:

11 Comment(s)

Add comment


From: ohno

Your post contains so much bad grammar that I could not bear to read more than a vey few paragraphs.

From: Sumita Singh

Grammer is okay with me. I do not find any issues reading it. Here the key is to understand Vagrant, which the article does perfectly.

From: Luis

 ohno :

Because maybe the first language him is not English.

Maybe if he wrote on his own might understand better.


Show some respect.

From: theWeird

The following box is installed and configured with apache2.2 and php-fpm as suggested in debian perfect server howto.

So it can be used for development of web applications coded for ISPConfig running webservers:


From: Nishant

I liked the tutorial. The guy who has written this article has very well documented it for beginners. Thank you Sanchit Jain Rasiya..

From: Alex

Thank you so much for the tutorial. Atleast it helped me to start with Vagrant. When is your next tutorial coming???

From: Shantanu K

Nice and helpful tutorial.

From: Jay Modi

Very helpful tutorial. Thanks for the providing such information in one place.

From: grassroot

Who reads the grammar? I speak more PHP than english; I just pay attention to the commands.

From: srikar

Its really good and great way for a web developer like me to start on vagrant 

From: marco

 Only thing I really hate in every tutorial is that nobody speaks of the standard username: vagrantand standard password: vagrant.can you tell me what the username and password for these vagrant boxes are?