Install Terraform on Alpine Linux
Install Terraform on Alpine Linux for Docker containers and lightweight environments. Binary install, apk package, and minimal Docker images.
Terraform
Install Terraform on RHEL 9, RHEL 8, and CentOS Stream. Official HashiCorp repository, manual binary install, and version management with tfenv.
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo yum -y install terraform
terraform versionsudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo dnf -y install terraformsudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo yum -y install terraformterraform version
# Terraform v1.x.xTERRAFORM_VERSION="1.8.5"
curl -LO "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
unzip "terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
sudo mv terraform /usr/local/bin/
rm "terraform_${TERRAFORM_VERSION}_linux_amd64.zip"
terraform versionFor ARM systems (e.g., Graviton):
curl -LO "https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_arm64.zip"git clone https://github.com/tfutils/tfenv.git ~/.tfenv
echo 'export PATH="$HOME/.tfenv/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
tfenv install latest
tfenv use latest
terraform versionterraform -install-autocomplete
source ~/.bashrc# If installed via repo
sudo yum remove terraform
# If installed manually
sudo rm /usr/local/bin/terraformUse the official HashiCorp repository for automatic updates via dnf/yum. Use tfenv when you need multiple versions for different projects. Use manual binary install for air-gapped or restricted environments.
Install Terraform on Alpine Linux for Docker containers and lightweight environments. Binary install, apk package, and minimal Docker images.
Install Terraform on Arch Linux and Manjaro. Official repository, AUR packages, manual binary install, and tfenv version management.
Install Terraform on Windows Subsystem for Linux (WSL). Ubuntu, Debian, and RHEL on WSL2 with AWS CLI, VS Code integration, and path configuration.
Run Terraform in Docker containers for consistent CI/CD environments. Official HashiCorp image, custom Dockerfiles, and Docker Compose workflows.