In this post we will learn how to install terraform on linux operating system. Terraform is open source infrastructure automation tool.In other words, for infrastructure as code you can use terraform. It works basically with providers like aws, azure, vmware etc. Due to hypbrid network like cloud and on premises network, terraform is playing a instrumental role.
This post will help you to set your first foundation that is installing terraform.
Installing Terraform on CentOS/RHEL system
- Install wget and unzip package
- Download terraform package
- Unzip the downloaded package
- Copy unzipped terraform file to /usr/local/bin
- Give executable permission
- Now check terraform
sudo yum install wget unzip
We will strongly suggest to always download and use latest package. Visit to terraform website to download terraform latest package.
wget https://releases.hashicorp.com/terraform/0.11.8/terraform_0.11.8_linux_amd64.zip
By using unzip command, it will extract one binary file called ‘terraform’
unzip terraform_0.11.8_linux_amd64.zip
sudo cp terraform /usr/local/bin
sudo chmod +x /usr/local/bin
Because we have copied the binary file to /usr/local/bin, the terraform command is available. You can check its absolute path by using command which terraform
The below command will show the version of terraform.
terraform --version
Installing Terraform on Ubuntu/Debian system
- Install wget and unzip package
- Download terraform package
- Unzip downloaded package
- Copy unzipped terraform file to /usr/local/bin
- Give executable permission
- Now check terraform
sudo apt-get install wget unzip
Visit to terraform website and download terraform latest package.
wget https://releases.hashicorp.com/terraform/0.11.8/terraform_0.11.8_linux_amd64.zip
Unzip the downloaded package.
unzip terraform_0.11.8_linux_amd64.zip
sudo cp terraform /usr/local/bin
sudo chmod +x /usr/local/bin
Because terraform extracted file copied to /usr/local/bin, the terraform command is available. Check the absolute path by command which terraform
Check the version of terraform by given below command.
terraform --version