Terraform: Infrastructure as Code
Terraform lets you describe server infrastructure in .tf files and manage it via CLI instead of manual web console clicks.
Hetzner Cloud Example
provider "hcloud" {
token = var.hcloud_token
}
resource "hcloud_server" "web" {
name = "web-01"
image = "ubuntu-24.04"
server_type = "cx22"
location = "nbg1"
}Core Commands
terraform init # initialize
terraform plan # preview changes
terraform apply # apply
terraform destroy # tear downSecurity: Never commit
terraform.tfvars or *.tfstate — they contain tokens and secrets. Add to .gitignore.