Skip to main content

Hetzner API Token

NightOps requires a Hetzner Cloud API token to manage your servers.

Create an API Token

Step 1: Create a Project (if needed)

Hetzner API tokens are scoped to a project:

  1. Log in to Hetzner Cloud Console
  2. Select your project (or create a new one)

Step 2: Generate Token

  1. Go to Security → API Tokens
  2. Click Generate API Token
  3. Configure the token:
    • Description: NightOps Integration
    • Permissions: Select Read & Write
  4. Click Generate API Token
  5. Copy the token immediately — it won't be shown again

Step 3: Add to NightOps

  1. Log in to your NightOps dashboard
  2. Go to Providers → Add Provider → Hetzner
  3. Paste your API token
  4. Click Test Connection
  5. Click Save Provider

Required Permissions

NightOps requires Read & Write permissions:

PermissionPurpose
ReadList servers, check status
WritePower off/on servers

Multiple Projects

If you have servers in multiple Hetzner projects:

  1. Generate a token for each project
  2. Add each as a separate provider in NightOps
  3. Name them clearly (e.g., "Hetzner - Production", "Hetzner - Staging")

Token Security

Best Practices

  1. Create a dedicated token — Don't reuse tokens from other integrations
  2. Use project isolation — Separate production and staging into different projects
  3. Audit regularly — Review API token list and remove unused tokens

Token Rotation

To rotate your token:

  1. Generate a new token in Hetzner Cloud Console
  2. Update the token in NightOps (Settings → Providers → Edit)
  3. Test the connection
  4. Delete the old token in Hetzner

Troubleshooting

"Invalid Token"

  1. Verify the token was copied completely
  2. Check the token is for the correct project
  3. Ensure Read & Write permissions are enabled

"Server Not Found"

  1. Confirm the server is in the same project as the token
  2. Check the server hasn't been deleted

Rate Limiting

Hetzner's API rate limit is 3,600 requests/hour. NightOps operations stay well within this limit.


Next Steps