Are you a Devops Engineer or an IT engineer who wants to spin up a virtual machine for locally testing the apps or to install any service locally?
We have a free way to achieve it using a VM automation tool called ‘Vagrant’.
Now our next checkpoint is How to install Vagrant locally?
Vagrant streamlines the process of creating and managing virtual machines (VMs) for development. This allows you to set up isolated environments with specific operating systems and configurations, perfect for testing and development. If you’re looking to get started with Vagrant, this guide will walk you through the installation process.
What You’ll Need:
You may also like: How to create your own Database locally on your laptop?
Installation Steps:
Download Vagrant: Head over to the official Vagrant download page . There, you’ll find installers for Windows, macOS, and various Linux distributions. Choose the installer compatible with your operating system.
Run the Installer: Double-click the downloaded installer and follow the on-screen instructions. The installation process is typically straightforward and shouldn’t take long.
Verifying Installation (Optional):
Once the installation is complete, you can verify Vagrant is working correctly by opening a terminal (command prompt on Windows) and typing the following command:
vagrant --version
If Vagrant is installed successfully, this command should display the installed Vagrant version.
Ex:
$ vagrant –version
Vagrant 2.4.0
Additional Software:
While Vagrant can function on its own, it works best alongside a virtual machine provider like VirtualBox https://www.virtualbox.org/wiki/Downloads. VirtualBox allows Vagrant to create and manage VMs. Download and install VirtualBox following a similar process as Vagrant.
You can use the command line interface (CLI) to install Vagrant. Here’s how to do it on different operating systems:
Linux:
Most Linux distributions have Vagrant packages available in their official repositories. Here’s an example using apt
on Ubuntu or Debian-based systems and yum on rpm based OS like CentOS:
sudo apt update
sudo apt install vagrant
Replace apt
with your package manager if your distribution uses something different (e.g., yum
on RedHat-based systems).
macOS:
You can use Homebrew, a popular package manager for macOS, to install Vagrant:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install vagrant
Windows:
Download the Vagrant installer for Windows from the official website https://www.vagrantup.com/ as mentioned before. The installer itself is a CLI program and will guide you through the installation process.
Verifying Installation:
Once you’ve installed Vagrant using the CLI, you can verify it using the same command mentioned earlier:
vagrant --version
This should output the installed Vagrant version if successful.
Additional Notes:
By using the CLI, you can automate Vagrant installation scripts or integrate it into your development workflow.
Congratulations! You’ve now successfully installed Vagrant and are ready to start creating development environments with ease. Many online tutorials and resources utilize Vagrant, so you’ll have a wealth of information at your fingertips to start exploring its capabilities.
You glance at your smartphone about 58 times daily - but did you know this…
Get ready, smartphone lovers! Lava International is about to launch its new smartphone, the Lava…
You often ask yourself, “Why is the server so slow today?” Whether it's your application…
The Google Pixel 9 Pro Fold is the latest foldable phone in the Google Pixel…
In the high-stakes world of cybersecurity, leaders are often seen as pillars of calm and…
As technology is growing, the number of threats and cyber crimes are also gaining momentum.…
View Comments