Deploys and manages Hetzner Cloud servers, SSH keys, networks, volumes, and firewalls. Use when deploying Hetzner instances, creating cloud servers, managing SSH keys, or configuring Hetzner infrastructure. Requires HETZNER_API_TOKEN in .env file.
Comprehensive Hetzner Cloud infrastructure management skill for deploying servers, managing SSH keys, networks, volumes, and firewalls via the Hetzner Cloud API.
Before using this skill for the first time:
Add your Hetzner Cloud API token to your project's .env file:
HETZNER_API_TOKEN=your_api_token_here
Getting your API token:
Run validation to verify your API token:
cd .claude/skills/hetzner-manager
uv run scripts/validate_api_key.py
Expected output:
Hetzner API Token Validation
============================
API Token: ****************************ABC1
Token Status: valid
Remaining Requests: 3600/hour
Available Datacenters:
- fsn1-dc14 (Falkenstein 1 DC14)
- nbg1-dc3 (Nuremberg 1 DC3)
- hel1-dc2 (Helsinki 1 DC2)
- ash-dc1 (Ashburn, VA DC1)
- hil-dc1 (Hillsboro, OR DC1)
| Type | vCPUs | RAM | Disk | Price/mo |
|---|---|---|---|---|
| cx22 | 2 | 4GB | 40GB | ~€4 |
| cx32 | 4 | 8GB | 80GB | ~€8 |
| cx42 | 8 | 16GB | 160GB | ~€15 |
| cx52 | 16 | 32GB | 320GB | ~€29 |
| cpx11 | 2 | 2GB | 40GB | ~€4 |
| cpx21 | 3 | 4GB | 80GB | ~€8 |
| cpx31 | 4 | 8GB | 160GB | ~€15 |
| Location | Code | Region |
|---|---|---|
| Falkenstein | fsn1 | Germany |
| Nuremberg | nbg1 | Germany |
| Helsinki | hel1 | Finland |
| Ashburn | ash | USA East |
| Hillsboro | hil | USA West |
| Image | Description |
|---|---|
| ubuntu-24.04 | Ubuntu 24.04 LTS |
| ubuntu-22.04 | Ubuntu 22.04 LTS |
| debian-12 | Debian 12 |
| rocky-9 | Rocky Linux 9 |
| fedora-40 | Fedora 40 |
uv run scripts/servers.py create \
--name my-server \
--type cx22 \
--image ubuntu-24.04 \
--location fsn1 \
--ssh-key my-key
Options:
--name: Server name (required)--type: Server type (default: cx22)--image: OS image (default: ubuntu-24.04)--location: Datacenter location (default: fsn1)--ssh-key: SSH key name to attach (recommended)--user-data: Cloud-init user data file pathReturns:
{
"id": 12345678,
"name": "my-server",
"public_ipv4": "65.108.xxx.xxx",
"public_ipv6": "2a01:4f8:xxx::1",
"status": "running",
"server_type": "cx22",
"datacenter": "fsn1-dc14"
}
uv run scripts/servers.py list
uv run scripts/servers.py get --id 12345678
# or
uv run scripts/servers.py get --name my-server
uv run scripts/servers.py delete --id 12345678
# or
uv run scripts/servers.py delete --name my-server
# Power off
uv run scripts/servers.py power-off --name my-server
# Power on
uv run scripts/servers.py power-on --name my-server
# Reboot
uv run scripts/servers.py reboot --name my-server
# Reset (hard reboot)
uv run scripts/servers.py reset --name my-server
uv run scripts/servers.py rebuild --name my-server --image ubuntu-24.04
uv run scripts/ssh_keys.py add \
--name my-key \
--public-key "ssh-ed25519 AAAA... user@host"
Or from a file:
uv run scripts/ssh_keys.py add \
--name my-key \
--public-key-file ~/.ssh/id_ed25519.pub
uv run scripts/ssh_keys.py list
uv run scripts/ssh_keys.py delete --name my-key
Add your SSH key (if not already added):
uv run scripts/ssh_keys.py add \
--name my-laptop \
--public-key-file ~/.ssh/id_ed25519.pub
Create the server:
uv run scripts/servers.py create \
--name web-server \
--type cx22 \
--image ubuntu-24.04 \
--location fsn1 \
--ssh-key my-laptop
Connect via SSH:
ssh root@<public_ipv4>
Create a cloud-init.yaml:
#cloud-config