• Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate
TecNStuff
Menu
  • Home
  • Linux
  • Ubuntu
  • Debian
  • CentOS
  • Linux Commands
  • About Us
  • Donate

How to Install Vagrant on Debian 10

Written by Admin, Updated On July 11, 2020
debian, vagrant
How to Install Vagrant on Debian 10 Linux

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 Debian 10.

Prerequisites#

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

Installing Vagrant on Debian#

By default Debian 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 Debian#

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 Debian 10 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.

If our content helps you, please consider buying us a coffee

Thank you for your support.

Share On
Share on Facebook
Share on Twitter
Share on Reddit
Share on Tumblr
 Previous Article How to Install Apache Maven on Debian 10
Next Article   How to Install Apache Maven on Ubuntu 20.04

Related Posts

  • How to Install Php 8 on Debian 10

    How to Install PHP 8 on Debian 10

    January 2, 2021
  • How to Install GIMP on Debian 10

    How to Install GIMP 2.10 on Debian 10

    December 27, 2020
  • How to Install Python 3.9 on Debian 10

    How to Install Python 3.9 on Debian 10

    December 25, 2020

Leave a Reply Cancel reply

Popular Posts

  • How to Install Python 3.9 on Debian 10
    How to Install Python 3.9 on Debian 10 December 25, 2020
  • How to Install GIMP on Ubuntu 20.04
    How to Install GIMP 2.10 on Ubuntu 20.04 December 22, 2020
  • How to Install Notepad++ on Debian 10
    How to Install Notepad++ on Debian 10 December 23, 2020
  • How to Install Php 8 on Debian 10
    How to Install PHP 8 on Debian 10 January 2, 2021
  • How to Install Php 8 on Ubuntu 20.04
    How to Install PHP 8 on Ubuntu 20.04 December 28, 2020
© 2020 TecNStuff All rights reserved. This website is using and storing cookies on your browser. By using this website you agree our Privacy Policy.  Follow us -  Twitter | Facebook