All the cloud service providers have integrated and ease the way of using Terraform. So, using Terraform as infrastructure as code tool will efficiently minimize your code and speed up the deployments on cloud.
Prerequisites
- Ubuntu 20.04
- sudo privileges
Install Terraform on Ubuntu 20.14
Step 1. First, update the system packages.
sudo apt-get update && sudo apt-get install gnupg software-properties-common curl
Step 2. To add the HashiCorp GPG key, execute:
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
Step 3. Now we need to add the HashiCorp Linux repository.
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
Step 4. Again update the packages and install Terraform.
sudo apt-get update && sudo apt-get install terraform
Step 5. Verify installation.
terraform --version
Output:
Terraform v1.0.1
on linux_amd64
Conclusion
This tutorial shows you how to install Terraform CLI on Ubuntu 20.04. For more info please visit the official documentation. Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.