Terraform: Infrastructure as Code for VPS and Cloud

Cloud & DevOps · 19.04.2026
Terraform: Infrastructure as Code for VPS and Cloud

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 down
Security: Never commit terraform.tfvars or *.tfstate — they contain tokens and secrets. Add to .gitignore.
← Back to Knowledge Base Ask Support