HashiCorp has recently announced in this blog post the possibility to download their tools (Terraform, Packer, Consul, …) via a classical and official Linux packages manager.

In this blog post, I expose how to use this repository for download the Terraform binary on Linux operating system.

For this performing following steps:

  1. Register the Terraform repository

    curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
    sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
    
  2. Update list of packages

    sudo apt-get update
    

    install terraform

  3. Optionally, we can check the list of Terraform versions packages available, by running this command:

    apt search terraform
    

    apt search terraform

  4. Then, download the Terraform binary:

     sudo apt-get install terraform
    
  5. Finally, check the installed version of Terraform

     terraform version
    

We can now use this script inside automation Terraform installation.

If you are on MacOs you can read this new blog post annoucing the use of Homebrew Tap for download and run HashiCorp tools.

image To learn more about the different ways to install Terraform, you can read my new book on Terraform called Terraform Cookbook available on Amazon.