How to install Vagrant on CentOS7

WebsitesCategory
3 min read
Christopher Carfi

Vagrant is a tool designed to manage the execution and implementation of virtual development environments. Do note that setting up Vagrant on CentOS 7 does require an additional step that may not be required in other Linux environments. That said, once set up, Vagrant enables you to easily manage and deploy multiple development environments that use the same pre-configured dependencies in one fell swoop. This minimizes the need to spend hours rebuilding operating systems or other deployments.

To set this up, you'll need a live Linux server (that you can tweak) with a dedicated IP address and a way to connect to it. We recommend a GoDaddy Virtual Private Server if you're just getting started, or a full dedicated server if you’re ready to take total control. To connect to your server, you'll need some kind of an SSH client. Google it, or try PuTTY (Windows) or Terminal (Mac).

[requirements difficulty="2" time="15"]

1. Install RubyGems.

Because of the way that Vagrant runs on the CentOS 7 operating system, you'll need to install it through the RubyGems package manager. As RubyGems doesn’t come pre-installed on CentOS 7, you'll need to install it first before you can proceed with the rest of the steps. Both Vagrant and RubyGems can be deployed through the Terminal in CentOS 7.

Once the Terminal window is opened, input the following two commands to install RubyGems:

sudo yum install ruby
sudo yum install rubygems

2. Update your system.

To make sure that your CentOS 7 box has all of the updated files it needs to successfully deploy Vagrant, update your system before proceeding using the following Terminal command:

sudo gem update --system

3. Install Vagrant.

Once RubyGems has been properly installed and your system is updated, you can quickly install Vagrant using the following Terminal command:

sudo gem install vagrant

4. Test Vagrant.

After finishing the Vagrant installation, the easiest way to check to make sure that everything has been added to your system properly is by following two steps. The first involves making sure that Vagrant has been installed to the proper directory, which should be the /local/bin/vagrant directory. You can do that with the following command:

pwd /local/bin/vagrant

The second step involves running Vagrant to make sure that everything loads properly. This can be easily completed using the following command:

vagrant up

As a courtesy, we provide information about how to use certain third-party products, but we do not endorse or directly support third-party products and we are not responsible for the functions or reliability of such products. Third-party marks and logos are registered trademarks of their respective owners. All rights reserved.

Products Used