What is Terraform?
Terraform, developed by HashiCorp, is a widely-used open source Infrastructure as Code (IaC) tool. It allows users to describe and set up cloud-based infrastructure using a user-friendly configuration language called HashiCorp Configuration Language (HCL), or JSON. With Terraform, users can define and manage their IaC, making it easier to automate and scale cloud infrastructure resources.
Install Terraform
To install Terraform on your Windows, Mac, or Linux operating system, the recommended method is to download and extract the executable binary. This approach is considered best practice for all operating systems. After installation, it is crucial to verify the Terraform version to ensure that it has been installed correctly. Remember that Terraform is simply an executable binary, so confirming the success of the installation by checking the version is important. For a detailed and comprehensive guide, we recommend referring to the official Terraform documentation.
Windows
You can use the following commands to install Terraform in the Windows operating system.
# Download Terraform.
$ curl -LO https://releases.hashicorp.com/terraform/1.14.7/terraform_1.14.7_windows_amd64.zip --output-dir /tmp
# Extract Terraform from archive.
$ unzip /tmp/terraform_1.14.7_windows_amd64.zip -d /tmp
# Install Terraform.
$ mv /tmp/terraform.exe /usr/bin
# Check Terraform version.
$ terraform --version
Mac
You can use the following commands to install Terraform in the Mac operating system.
AMD64 / X86-64 / X64
# Download Terraform.
$ wget https://releases.hashicorp.com/terraform/1.14.7/terraform_1.14.7_darwin_amd64.zip -P /tmp
# Extract Terraform from archive.
$ unzip /tmp/terraform_1.14.7_darwin_amd64.zip -d /tmp
# Install Terraform.
$ sudo mv /tmp/terraform /usr/local/bin
# Check Terraform version.
$ terraform --version
ARM64
# Download Terraform.
$ wget https://releases.hashicorp.com/terraform/1.14.7/terraform_1.14.7_darwin_arm64.zip -P /tmp
# Extract Terraform from archive.
$ unzip /tmp/terraform_1.14.7_darwin_arm64.zip -d /tmp
# Install Terraform.
$ sudo mv /tmp/terraform /usr/local/bin
# Check Terraform version.
$ terraform --version
Linux
You can use the following commands to install Terraform in any Linux-based operating system.
AMD64 / X86-64 / X64
# Download Terraform.
$ wget https://releases.hashicorp.com/terraform/1.14.7/terraform_1.14.7_linux_amd64.zip -P /tmp
# Extract Terraform from archive.
$ unzip /tmp/terraform_1.14.7_linux_amd64.zip -d /tmp
# Install Terraform.
$ sudo mv /tmp/terraform /usr/local/bin
# Check Terraform version.
$ terraform --version
ARM64
# Download Terraform.
$ wget https://releases.hashicorp.com/terraform/1.14.7/terraform_1.14.7_linux_arm64.zip -P /tmp
# Extract Terraform from archive.
$ unzip /tmp/terraform_1.14.7_linux_arm64.zip -d /tmp
# Install Terraform.
$ sudo mv /tmp/terraform /usr/local/bin
# Check Terraform version.
$ terraform --version