How to Install Vagrant on Ubuntu 20.04
How to Install Vagrant on Ubuntu 20.04

How to Install Vagrant on Ubuntu 20.04
June 6, 2020 by Editorial Staff
Contents
- 1 How to Install Vagrant on Ubuntu 20.04
- 2 Installing in Vagrant on Ubuntu
- 3 Getting Started with Vagrant
- 4 Conclusion
How to Install Vagrant on Ubuntu 20.04
We hope this post helped you to find out How to Install Vagrant on Ubuntu 20.04
Vagrant is a command-line device for constructing and managing digital machines.
By default, Vagrant can provision machines on prime of VirtualBox, Hyper-V, and Docker. Different suppliers comparable to Libvirt (KVM), VMware and AWS may be put in through the Vagrant plugin system.
Vagrant is often utilized by builders to arrange a growth atmosphere that works throughout a number of working programs.
This text describes the best way to set up Vagrant on an Ubuntu 20.04 machine. We’ll use VirtualBox, which is the default supplier for Vagrant.
Installing in Vagrant on Ubuntu
We are going to provision the digital machines on prime of VirtualBox.
If VirtualBox will not be put in in your system you may set up it by operating:
sudo apt update
sudo apt install virtualbox
The Vagrant package deal, which is on the market in Ubuntu’s repositories, will not be commonly up to date. We’ll obtain and set up the most recent model of Vagrant from the official Vagrant website.
On the time of writing this text, the most recent steady model of Vagrant is model 2.2.9. Go to the Vagrant downloads page to see if there’s a new model of Vagrant accessible.
Obtain the Vagrant package deal with wget
:
curl -O https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.deb
Once the file is downloaded, install it by typing:
sudo apt install ./vagrant_2.2.9_x86_64.deb
To confirm that the set up was profitable, run the next command that may print the Vagrant model:
vagrant --version
The output should look something like this:
Vagrant 2.2.9
Getting Started with Vagrant
Making a Vagrant venture is straightforward as establishing the venture root listing and defining a Vagrantfile.
Run the next instructions to create the listing and cd into it with:
mkdir ~/my-vagrant-projectcd ~/my-vagrant-project
Subsequent, initialize a brand new Vagrantfile utilizing the vagrant init
command adopted by the field you wish to use.
Bins are the package deal format for the Vagrant environments and are provider-specific. You’ll find an inventory of publicly accessible Vagrant Bins on the Vagrant box catalog web page.
On this instance, we’ll use the centos/8
field:
vagrant init centos/8A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
Vagrantfile is a Ruby file that describes the best way to configure and provision the digital machine. You possibly can open the Vagrantfile, learn the feedback and make adjustment based on your wants.
Run the vagrant up
command to create and configure the digital machine as specified within the Vagrantfile:
vagrant up==> default: Configuring and enabling network interfaces...
default: SSH address: 192.168.121.74:22
default: SSH username: vagrant
default: SSH auth method: private key
==> default: Rsyncing folder: /home/linuxize/Vagrant/my-vagrant-project/ => /vagrant
Vagrant mounts the venture listing at /vagrant
within the digital machine. This lets you work in your venture’s recordsdata in your host machine.
To ssh into the virtual machine, run:
vagrant ssh
You can stop the virtual machine with the following command:
vagrant halt
To destroy all resources created during the creation of the machine, enter:
vagrant destroy
Conclusion
We’ve proven you the best way to set up Vagrant on Ubuntu 20.04 and create a primary Vagrant venture.
To search out extra details about Vagrant go to, the official Vagrant documentation web page.
We hope the How to Install Vagrant on Ubuntu 20.04 help you. If you have any query regarding How to Install Vagrant on Ubuntu 20.04 drop a comment below and we will get back to you at the earliest.
We hope this post helped you to find out How to Install Vagrant on Ubuntu 20.04 . You may also want to see — How to Install Java on Ubuntu 20.04