Get Started with Terraform

Learn how to install, configure, and deploy infrastructure using infrastructure as code. Follow these steps to start managing your cloud infrastructure with Terraform.

Getting Started with Terraform

Step 1: Install Terraform

Download and install the Terraform CLI for your operating system from the official HashiCorp website.

curl -O https://releases.hashicorp.com/terraform/1.4.6/terraform_1.4.6_linux-amd64.zip
unzip terraform_1.4.6_linux-amd64.zip
sudo mv terraform /usr/local/bin/
                        

Step 2: Write Configuration

Create a Terraform configuration file (.tf) to declare your infrastructure in code.

provider "aws" {
  region = "us-west-2"
}

resource "aws_instance" "example" {
  ami = "ami-12345678"
  instance_type = "t2.micro"
}
                        

Step 3: Apply Configuration

Initialize your working directory and apply your configuration to provision resources.

terraform init
terraform apply
                        

Learn Terraform

Beginner

Getting Started Guide

Our beginner-friendly guide walks you through creating your first Terraform configuration and deploying your first infrastructure.

View Getting Started Guide
Intermediate

Advanced Tutorials

Go deeper with advanced Terraform techniques, including modules, state management, and enterprise workflows.

View Advanced Tutorials

Join the Terraform Community

Get help from our active global community of developers, operators, and enterprise users. Ask questions, share your Terraform experiences, and explore use cases shared by other users.

Join the Community Forum
Community

Start Managing Infrastructure Like Code

Join the 3.2 million+ users who trust Terraform to manage infrastructure at scale.

```