Skip to main content
Hetzner API credentials store a Hetzner Cloud API token, used to provision and manage Hetzner clusters. The token is validated when you save it - Ankra makes a read-only call to the Hetzner Cloud API (GET /locations), so a rejected or mistyped token is refused immediately.
Don’t have a Hetzner account? Sign up for Hetzner Cloud to get started.

What Ankra Accesses

Hetzner clusters are self-managed: Ankra provisions the servers and networking with your token, then runs Kubernetes on top. The token is used for: Hetzner API tokens are project-wide - there is no per-resource scoping in Hetzner’s token model, and a Read & Write token can manage everything in its project. Create the token in a project dedicated to Ankra-managed clusters if you want isolation from other workloads.

Before you start

  • A role with credentials.write (the built-in owner and admin roles have it). See Credentials.

Creating a Hetzner API Credential

1

Get a Hetzner API token

  1. Log in to the Hetzner Console
  2. Select your project
  3. Go to Security → API Tokens
  4. Click Generate API Token with Read & Write permissions - a read-only token passes the save-time check but fails as soon as Ankra needs to create a server
  5. Copy the token (it’s only shown once)
2

Add it to Ankra

Go to Integrations & alerts → Credentials, click Add credential, and under Cloud providers choose Hetzner Cloud. Enter:
  • Name: 3 to 100 lowercase letters, digits and single hyphens (for example hetzner-prod). It cannot change later.
  • API token: the token from the previous step
Click Test the connection. You see The connection works. Then click Add credential; the credential’s page opens.
The portal’s cluster wizard asks for an SSH key credential; the API, the CLI and Terraform accept a Hetzner cluster without one, and Ankra generates its own key pair for every Hetzner cluster. The organisation needs a payment method before it can create one. Next: Hetzner Clusters.

Replace the token, or add Object Storage keys

Open the credential, click Settings & access, and use Replace the secret (see Replace the secret). It has three fields; leave a field empty to keep what is stored for it:
  • New API token: a new Hetzner Cloud API token.
  • New object Storage access key and New object Storage secret key: only if backups go to Hetzner Object Storage. Give the two together.
Click Check and replace. Ankra checks the new values with Hetzner Cloud before it stores them; you see The secret is replaced.

Listing Hetzner Credentials

Troubleshooting Hetzner Credentials

These are the answers Test the connection and Check now give: The check verifies the token is accepted, not that it can write. If the credential saves fine but cluster provisioning later fails with a permissions error, the token is read-only - generate a Read & Write token and replace it on the credential’s page.