Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install Vagrant on Ubuntu 20.04 - DesignLinux

Jun 08 2020
designlinux 0 Comments
How to Install Vagrant on Ubuntu 20.04

Vagrant is a an open-source tool for building and managing virtual machines. Generally, Vagrant is used by developers to set up a development environment that works across multiple operating systems. In this tutorial, we will show you how to install Vagrant on Ubuntu 20.04 system.

Prerequisites#

  • Virtualbox should installed on your Ubuntu 20.04 system.
  • You must logged in as root or user with sudo privileges.

Installing Vagrant on Ubuntu#

By default Ubuntu repositories includes Vagrant package, but it is not regularly updated. So we will download and install latest version of Vagrant from the official Vagrant website.

Currently, at the time of writing this tutorial, the latest version of Vagrant is 2.2.9. It always good to check latest version at Vagrant download page before starting installation.

Run the below command to download Vagrant using curl:

curl -O https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.deb

Once the download complete, execute below command to install it:

sudo apt install ./vagrant_2.2.9_x86_64.deb

You can verify the installation by typing:

vagrant --version

It should show output as following:

Vagrant 2.2.9

Using Vagrant on Ubuntu#

It’s very simple to create a Vagrant project. To define a root directory run below command to create the directory and navigate into it with:

mkdir ~/vagrant-test
cd ~/vagrant-test

After that, we need to initialize a new Vagrantfile using the vagrant init command, followed by the box you want to use.

Get the list of publicly available Vagrant Boxes on the Vagrant box catalog page.

For demostration we will use the centos/8 box:

vagrant init centos/8
A `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 file describes the type of machine required and how to configure. You can edit the Vagrantfile and do changes as your needs.

Now, run the vagrant up command to create and configure the virtual machine as specified in the Vagrantfile:

vagrant up
==> default: Configuring and enabling network interfaces...
    default: SSH address: 53.21.54.56:22
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Rsyncing folder: /home/tecnstuff/Vagrant/vagrant-test/ => /vagrant

Vagrant mounts the project directory at /vagrant in the virtual machine. This allows you to work on your project’s files on your host machine.

To ssh into the virtual machine, run:

Run the below command to login to VM using SSH:

vagrant ssh

To shutdown the virtual machine execute the below command:

vagrant halt

To destroy all resources created during the creation of the machine, enter:

vagrant destroy

Conclusion#

This article shown you how to install Vagrant on Ubuntu 20.04 and use of Vagrant project. To know more about Vagrant visit, the official Vagrant documentation page.

If you have any questions, please leave a comment below.

Related

Tags: ubuntu, vagrant

How to Install GCC (build-essential) on Ubuntu 20.04

Prev Post

How to Install VirtualBox Guest Additions on CentOS 8

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 1
  • 486
  • 612,665

DesignLinux.com © All rights reserved

Go to mobile version