Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

Installing Vagrant on Ubuntu

Vagrant allows users to create reusable virtualized, container, and cloud environments for testing, development, and even deployment purposes. Vagrant ships with native support for VirtualBox, Docker, and Hyper-V, and in this hands-on lab, we will be setting up both Vagrant and Docker — our desired provider. This will let us create code-based Docker environments that we can use and share multiple times as needed.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 30m
Published
Clock icon Sep 27, 2019

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Install Docker

    1. Add the prerequisite packages:
    sudo apt-get install apt-transport-https ca-certificates gnupg-agent software-properties-common
    
    1. Add Docker's GPG key:
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
    1. Verify that the proper key was retrieved:
    sudo apt-key fingerprint 0EBFCD88
    
    1. Add the Docker repository:
    sudo add-apt-repository 
    "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
    $(lsb_release -cs) 
    stable"
    
    1. Run an update on the package index:
    sudo apt-get update
    
  2. Challenge

    Install Vagrant

    1. Pull down the .deb package:
    cd /tmp/
    wget https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.deb
    
    1. Download the checksum and signature file:
    wget https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_SHA256SUMS.sig
    wget https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_SHA256SUMS
    
    1. Begin the import of HashiCorp's public key:
    vim hashicorp.asc
    
    1. Copy/paste the following key:
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    Version: GnuPG v1
    
    mQENBFMORM0BCADBRyKO1MhCirazOSVwcfTr1xUxjPvfxD3hjUwHtjsOy/bT6p9f
    W2mRPfwnq2JB5As+paL3UGDsSRDnK9KAxQb0NNF4+eVhr/EJ18s3wwXXDMjpIifq
    fIm2WyH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Y8+AWaJAZ37wpWh1p0cAEQEAAYkBHwQYAQIA
    CQUCUw5EzQIbDAAKCRBRhS2HNI/8TJntCAClU7TOO/X053eKF1jqNW4A1qpxctVc
    z8eTcY8Om5O4f6a/rfxfNFKn9Qyja/OG1xWNobETy7MiMXYjaa8uUx5iFy6kMVaP
    0BXJ59NLZjMARGw6lVTYDTIvzqqqwLxgliSDfSnqUhubGwvykANPO+93BBx89MRG
    unNoYGXtPlhNFrAsB1VR8+EyKLv2HQtGCPSFBhrjuzH3gxGibNDDdFQLxxuJWepJ
    EK1UbTS4ms0NgZ2Uknqn1WRU1Ki7rE4sTy68iZtWpKQXZEJa0IGnuI2sSINGcXCJ
    oEIgXTMyCILo34Fa/C6VCm2WBgz9zZO8/rHIiQm1J5zqz0DrDwKBUM9C
    =LYpS
    -----END PGP PUBLIC KEY BLOCK-----
    
    1. Save and exit.
    2. Complete the import with the following command:
    gpg --import hashicorp.asc
    
    1. Verify the files:
    gpg --verify vagrant_2.2.5_SHA256SUMS.sig vagrant_2.2.5_SHA256SUMS
    

    Note: The WARNING message can be disregarded as long as we see Good signature from HadshiCorp Security returned.

    1. Verify the checksum and that no errors exist for our Vagrant .deb file:
    shasum -a 256 -c vagrant_2.2.5_SHA256SUMS 2>&1 | grep OK
    

    Note: We should see a status of OK.

    1. Install Vagrant:
    sudo dpkg -i vagrant_2.2.5_x86_64.deb
    
    1. Confirm that Vagrant installed:
    vagrant --version
    

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

What's a lab?

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Provided environment for hands-on practice

We will provide the credentials and environment necessary for you to practice right within your browser.

Guided walkthrough

Follow along with the author’s guided walkthrough and build something new in your provided environment!

Did you know?

On average, you retain 75% more of your learning if you get time for practice.

Start learning by doing today

View Plans