How can I install Vagrant on CentOS 8 / RHEL 8 Linux system?. Vagrant is a command line tool that enables you to create and configure portable and reproducible development environments and demo labs. The product is developed by HashiCorp.

With Vagrant, you can setup your development environments in seconds on various virtualization platforms / providers such as KVM, VirtualBox, VMware, Parallels, Hyper-V, and Docker. There is comprehensive documentation which you can follow along to get started.

Step 1: Install Virtualization Technology of choice

Choose a virtualization technology that you’ll orchestrate with Vagrant. For developers, the most common open source alternatives are KVM and VirtualBox:

Install VirtualBox on CentOS / RHEL 8

Install KVM on CentOS / RHEL 8

Step 2: Install Vagrant on CentOS 8 / RHEL 8

After the installation of Virtualization tool on CentOS / RHEL 8 system, you can now install Vagrant on CentOS 8 / RHEL 8 machine. If you’re using it with other providers such as VMware or Docker, ensure it is installed prior to Vagrant installation.

You Check the latest version of Vagrant available in the Downloads page. But we will install Vagrant on CentOS 8 / RHEL 8 from YUM repository.

Install packer build dependencies:

sudo dnf groupinstall "Development Tools" -y 
sudo dnf -y install rsync gcc zlib-devel libvirt-devel cmake

Install Ruby and Ruby Development packages that are required to use Vagrant.

sudo dnf install -y ruby ruby-devel

Add Vagrant YUM repository:

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

Then install Vagrant on CentOS 8 / RHEL 8:

sudo yum install vagrant

Start installation using y when asked:

Hashicorp Stable - x86_64                                                                                                         1.6 MB/s | 506 kB     00:00
Dependencies resolved.
==================================================================================================================================================================
 Package                               Architecture                         Version                                 Repository                               Size
==================================================================================================================================================================
Installing:
 vagrant                               x86_64                               2.2.16-1                                hashicorp                                39 M

Transaction Summary
==================================================================================================================================================================
Install  1 Package

Total download size: 39 M
Installed size: 112 M
Is this ok [y/N]: y

Agree to import GPG key:

Downloading Packages:
vagrant-2.2.16-1.x86_64.rpm                                                                                                        14 MB/s |  39 MB     00:02
------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                              14 MB/s |  39 MB     00:02
warning: /var/cache/dnf/hashicorp-164999f2fbadbd87/packages/vagrant-2.2.16-1.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID a3219f7b: NOKEY
Hashicorp Stable - x86_64                                                                                                          96 kB/s | 3.1 kB     00:00
Importing GPG key 0xA3219F7B:
 Userid     : "HashiCorp Security (HashiCorp Package Signing) <[email protected]>"
 Fingerprint: E8A0 32E0 94D8 EB4E A189 D270 DA41 8C88 A321 9F7B
 From       : https://rpm.releases.hashicorp.com/gpg
Is this ok [y/N]: y

Confirm installation of Vagrant by checking the version installed and the help page.

$ vagrant --version
Vagrant 2.2.16

View Vagrant usage help page:

$ vagrant --help

Step 3: Using Vagrant on CentOS 8 / RHEL 8

Check our guide below:

How To run CentOS 8 VM using Vagrant on KVM / VirtualBox / VMWare / Parallels

It covers creation of a CentOS 8 virtual machine on KVM, VirtualBox and other environments using vagrant.

More guides:

Install and Configure DHCP Server & Client on CentOS 8 / RHEL 8

How To Provision VMs on oVirt / RHEV with Terraform

How to Provision VMs on KVM with Terraform

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!


As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.

LEAVE A REPLY

Please enter your comment!
Please enter your name here