How to Install Terraform on Ubuntu Linux
Step-by-step guide to install Terraform on Ubuntu Linux using APT. Configure HashiCorp repository and verify installation.
Technology
Install Terraform on macOS with Homebrew: brew tap hashicorp/tap && brew install hashicorp/tap/terraform. Includes version pinning, upgrading
Terraform, developed by HashiCorp, is a popular open-source infrastructure as a code software tool that enables you to build, change, and version infrastructure efficiently. Here's a comprehensive guide to installing Terraform on a macOS system.
First, open the Terminal app on your macOS. You can find it in the Utilities folder inside the Applications folder.
Run the following command in the Terminal to add the HashiCorp tap, a repository of all HashiCorp formulae for Homebrew:
brew tap hashicorp/tapThis command clones the HashiCorp repository into Homebrew's directory and prepares it for installing Terraform.
==> Tapping hashicorp/tap\
Cloning into '/opt/homebrew/Library/Taps/hashicorp/homebrew-tap'...\
remote: Enumerating objects: 4068, done.\
remote: Counting objects: 100% (4068/4068), done.\
remote: Compressing objects: 100% (1426/1426), done.\
remote: Total 4068 (delta 2677), reused 3989 (delta 2627), pack-reused 0\
Receiving objects: 100% (4068/4068), 741.70 KiB | 1.82 MiB/s, done.\
Resolving deltas: 100% (2677/2677), done.\
Tapped 2 casks and 28 formulae (87 files, 1015.4KB).To install Terraform, use the following command:
brew install hashicorp/tap/terraformHomebrew will fetch the Terraform package and install it on your macOS device. During this process, you'll see the progress of the download and installation.
==> Fetching hashicorp/tap/terraform\
==> Downloading https://releases.hashicorp.com/terraform/1.7.2/terraform_1.7.2_darwin_arm64.zip\
######################################################################################## 100.0%\
==> Installing terraform from hashicorp/tap\
🍺 /opt/homebrew/Cellar/terraform/1.7.2: 3 files, 88.6MB, built in 4 seconds\
==> Running `brew cleanup terraform`...After the installation is complete, you can verify it by running:
terraform --versionThis command will display the installed version of Terraform, confirming the successful installation.
Terraform v1.7.2
on darwin_arm64For a better command-line experience, Terraform provides an autocomplete feature. To enable it, run:
terraform -install-autocompleteRestart your Terminal for the autocomplete feature to take effect.
To keep Terraform up-to-date, you can use Homebrew to upgrade it to the latest version:
brew upgrade hashicorp/tap/terraformIf Terraform is already at the latest version, Homebrew will notify you.
Learn by doing with interactive courses on CopyPasteLearn:
With these simple steps, you have successfully installed Terraform on your macOS device. You're now ready to use Terraform to manage and deploy your infrastructure in a consistent and predictable manner. Remember to regularly check for updates to keep your Terraform installation current.
Step-by-step guide to install Terraform on Ubuntu Linux using APT. Configure HashiCorp repository and verify installation.
Step-by-step guide to install Terraform on RHEL using YUM. Configure HashiCorp repository and verify installation. Step-by-step guide with code examples and ...
Join me at CfgMgmtCamp 2025 in Ghent as I discuss automating AI-powered graph databases using Ansible, OpenAI, and Neo4j GenAI. Discover best practices in.
Learn how to use Terraform data sources to query existing resources, look up AMIs, reference remote state, and build dynamic configurations. Complete.