Deploy Tailscale onto a Hetzner cloud server with Terraform.
-
Install Terraform
-
Clone this repository
-
Create a
terraform.tfvars
file with the following content:
hetzner_token = "" # https://console.hetzner.cloud/projects/<project_id>/security/api-tokens
ssh_public_key = "" # e.g. "ssh-rsa ...."
tailscale_auth_key = "" # https://login.tailscale.com/admin/settings/keys
server_username = "" # e.g. "tailscale"
server_name = "" # e.g. "tailscale-server"
tailscale_api_key = "" # https://login.tailscale.com/admin/settings/authkeys
-
Run
terraform init
-
Run
terraform apply
-
Log into Tailscale and authorize the new device.
-
Profit!
- The server will be created in the
hel
datacenter by default. You can change this by setting thelocation
variable interraform.tfvars
tofsn1
orhel1
.
This project is licensed under the MIT License - see the LICENSE file for details.