How To Install And Setup Vagrant | Linux Today

How To Install And Setup Vagrant

Written By
CS
Christopher Shaw
Sep 18, 2017

Vagrant is a powerful tool when it comes to virtual machines, here we will look at how to setup and use Vagrant with Virtualbox on Ubuntu to provision reproducible virtual machines.

Virtual Machines, not all that complex

For years, developers have been using virtual machines as part of their workflow, allowing them to swap and change environments that the software is running in, this is generally to prevent conflicts between projects such as project A needing php 5.3 and project b needing php 5.4.

Also, using Virtual Machines means you only ever need the computer you’re working on, you don’t need dedicated hardware to mirror the production environment.

It also comes in handy when multiple developers are working on one project, they can all run an environment which contains all of its requirements, but it can be hard maintaining multiple machines and ensuring all have the same versions of all the requirements, this is where Vagrant comes in.

The benefits of using Virtual Machines

Your vm is separate from your host environment
You can have a vm tailor for the requirements of your code
Anything done in one vm does not effect another VM
You can run programs in a vm which your host may not be able to run, such as running some windows only software in a – windows vm on top of ubuntu
What is Vagrant

In short, it’s a tool that works with virtual box to allow you to automate the creation and removal of a virtual machines.

It revolves around a Config File Called the VagrantFile, which tells vagrant what version of what os you want to install, and some other options such as the IP and Directory Syncing. You can also add a provisioning script of commands to run on the virtual machine.

By Sharing this VagrantFile around, all developers on a project. You will all be using the exact same virtual machine.

CS

Christopher Shaw

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.