How to install Vagrant on Ubuntu 20.04?

Overview

Vagrant is an open-source tool for building and managing virtual machine environments in a single workflow. It allows developers to control the development environment using simple CLI commands. This tutorial will guide you through the process of installing Vagrant on Ubuntu 20.04.

Prerequisites

There are certain prerequisites that need to be met before you begin.

  • Ubuntu 22.04 LTS configured on your system.

  • Non-root Sudo user privileges.

Get Started

Step 1: Set up VirtualBox

VirtualBox is a free and open-source virtualization software that allows users to create and run virtual machines on their computer. Vagrant, on the other hand, is a command-line tool for building and managing virtual machine environments. Vagrant relies on virtualization software to create and manage virtual machines. By default, Vagrant supports several virtualization providers, including VirtualBox, VMware, and Hyper-V. However, VirtualBox is the recommended provider for most users due to its ease of use, cross-platform compatibility, and excellent documentation.

When you install Vagrant, it automatically detects the available virtualization providers on your computer. If VirtualBox is already installed, Vagrant will use it as the default provider. If not, Vagrant will prompt you to install it before proceeding with any further setup. Therefore, it is recommended to install VirtualBox before installing Vagrant to ensure a smooth setup process and avoid any compatibility issues.

  • To install VirtualBox, run the following command:

sudo apt install virtualbox

Step 2: Install Vagrant

Once VirtualBox is installed, begin installing Vagrant.

  • Update the Ubuntu package index:

sudo apt update

Navigate to the Vagrant downloads page to fetch the link for the latest version of the Vagrant package suitable for your system.

  • Download the package on your system using curl command:

curl -O https://releases.hashicorp.com/vagrant/2.3.4/vagrant_2.3.4-1_amd64.deb
  • After the .deb file is downloaded, install the Vagrant package.

sudo apt install ./vagrant_2.3.4-1_amd64.deb
  • Verify Vagrant installation by checking its version installed on your system:

vagrant --version

Conclusion

In this tutorial, you have successfully installed Vagrant on Ubuntu 20.04. With the help of Vagrant, you can your development workflow and save a lot of time.

Last updated