---
title: "Terraform"
description: "The gyro-hosting/gyro Terraform provider: install, authenticate and create a server."
url: https://www.gyrohosting.com/developers/en/guides/terraform.html
language: en
openapi: https://www.gyrohosting.com/developers/openapi.json
api_version: 2.30.0
---

# Terraform

```
terraform {
  required_providers {
    gyro = { source = "gyro-hosting/gyro", version = "~> 0.3" }
  }
}
provider "gyro" {}            # reads GYRO_TOKEN

resource "gyro_ssh_key" "me" {
  name       = "laptop"
  public_key = file("~/.ssh/id_ed25519.pub")
}

resource "gyro_server" "web" {
  plan          = "standart-2-4"   # list plans with 'gyro plan list' or data.gyro_products
  region        = "eu-de-1"        # list regions with data.gyro_locations
  image         = "debian-12"
  hostname      = "web-1.example.com"
  ssh_key_ids   = [tonumber(gyro_ssh_key.me.id)]
  confirm_order = true             # creating a server spends account balance
}
```

Provider 0.3 or later. `server_type`/`location` from older versions still work but are deprecated; upgrading does not replace existing servers.

Data sources: `gyro_products`, `gyro_locations`, `gyro_images`. `terraform destroy`
cancels the server at once: billing stops and the machine is wiped
(set `delete_immediately = false` to file a cancellation request instead).
