SuperAPI AI Directory

hcloud-servers

Design & creation

View repository

Updated 10-15 20:32

About this skill

Hetzner Cloud Servers

Server Lifecycle

Create a Server

hcloud server create [options] --name <name> --type <server-type> --image <image>

Flags:

  • --name <name> - Server name (required)
  • --type <server-type> - Server Type ID or name (required)
  • --image <image> - Image ID or name (required)
  • --location <location> - Location ID or name
  • --ssh-key <key> - SSH Key ID or name (can be specified multiple times)
  • --network <network> - Network ID or name to attach to (can be specified multiple times)
  • --firewall <firewall> - Firewall ID or name to attach to (can be specified multiple times)
  • --volume <volume> - Volume ID or name to attach (can be specified multiple times)
  • --user-data-from-file <file> - Read user data from file (use - for stdin)
  • --label <key=value> - User-defined labels (can be specified multiple times)
  • --placement-group <group> - Placement Group ID or name
  • --primary-ipv4 <ip> - Primary IPv4 ID or name
  • --primary-ipv6 <ip> - Primary IPv6 ID or name
  • --enable-backup - Enable automatic backups
  • --enable-protection <delete|rebuild> - Enable protection (values: delete, rebuild)
  • --start-after-create - Start Server after creation (default: true)
  • --without-ipv4 - Create without IPv4
  • --without-ipv6 - Create without IPv6
  • --allow-deprecated-image - Allow use of deprecated images
  • --automount - Automount Volumes after attach
  • -o, --output json|yaml - Output format

List Servers

hcloud server list [options]

Columns: id, name, status, type, ipv4, ipv6, location, datacenter, labels, protection, volumes, private_net, placement_group, backup_window, created, age, rescue_enabled, locked, included_traffic, ingoing_traffic, outgoing_traffic, primary_disk_size

Flags:

  • -l, --selector <label> - Filter by label selector
  • -s, --sort <field> - Sort results
  • --status <status> - Filter by status (can be specified multiple times)
  • -o, --output noheader|columns=...|json|yaml - Output options

Describe a Server

hcloud server describe [options] <server>

Flags:

  • -o, --output json|yaml|format - Output format

Delete Servers

hcloud server delete <server>...

Accepts one or more server IDs or names.

Update a Server

hcloud server update [options] <server>

Flags:

  • --name <new-name> - New server name

Power Management

Power On

hcloud server poweron <server>

Power Off (Hard)

hcloud server poweroff <server>

Immediately cuts power. Use shutdown for graceful ACPI shutdown.

Shutdown (Graceful ACPI)

hcloud server shutdown [options] <server>

Sends an ACPI shutdown request. The OS must support ACPI.

Flags:

  • --wait - Wait for the server to shut down before returning
  • --wait-timeout <duration> - Timeout for waiting (default: 30s)

Reboot (Graceful)

hcloud server reboot <server>

Reset (Hard)

hcloud server reset <server>

Hard reset, equivalent to pressing the physical reset button.

Access

SSH into a Server

hcloud server ssh [options] <server> [--] [ssh options] [command [argument...]]

Flags:

  • -u, --user <user> - SSH username (default: root)
  • -p, --port <port> - SSH port (default: 22)
  • --ipv6 - Connect via IPv6 address

Pass additional SSH options after --.

Get Server IP

hcloud server ip [--ipv6] <server>

Flags:

  • -6, --ipv6 - Print the first address of the server's primary IPv6 network

Request VNC Console

hcloud server request-console [options] <server>

Returns a WebSocket URL and password for VNC console access.

Flags:

  • -o, --output json|yaml - Output format

Server Modifications

Change Server Type

hcloud server change-type [--keep-disk] <server> <server-type>

Server must be stopped first. Requires a reboot after the change.

Flags:

  • --keep-disk - Keep disk size of current type (enables downgrading later)

Rebuild Server

hcloud server rebuild [options] --image <image> <server>

Reinstalls the server from an image. All data on the server will be lost.

Flags:

  • --image <image> - Image ID or name (required)
  • --allow-deprecated-image - Allow use of deprecated images
  • --user-data-from-file <file> - Read user data from file (use - for stdin)

Create Image from Server

hcloud server create-image [options] --type <snapshot|backup> <server>

Flags:

  • --type <snapshot|backup> - Image type (required)
  • --description <text> - Image description
  • --label <key=value> - Labels (can be specified multiple times)

Rescue Mode

Enable Rescue Mode

hcloud server enable-rescue [options] <server>

Outputs a root password. Server must be rebooted to enter rescue mode.

Flags:

  • --ssh-key <key> - SSH Key ID or name to inject (can be specified multiple times)
  • --type <type> - Rescue type (default: linux64)

Disable Rescue Mode

hcloud server disable-rescue <server>

Reset Root Password

hcloud server reset-password [options] <server>

Flags:

  • -o, --output json|yaml - Output format

Backups

Enable Backups

hcloud server enable-backup <server>

Disable Backups

hcloud server disable-backup <server>

Network Attachment

Attach to Network

hcloud server attach-to-network [options] --network <network> <server>

Flags:

  • -n, --network <network> - Network ID or name (required)
  • --ip <ip> - IP address to assign (auto-assigned if omitted)
  • --ip-range <cidr> - Subnet CIDR to attach to (auto-assigned if omitted)
  • --alias-ips <ip> - Additional alias IPs (can be specified multiple times)

Detach from Network

hcloud server detach-from-network --network <network> <server>

Flags:

  • -n, --network <network> - Network ID or name (required)

Change Alias IPs

hcloud server change-alias-ips [options] --network <network> <server>

Flags:

  • -n, --network <network> - Network ID or name (required)
  • --alias-ips <ips> - New alias IPs
  • --clear - Remove all alias IPs

ISO Management

Attach ISO

hcloud server attach-iso <server> <iso>

Detach ISO

hcloud server detach-iso <server>

Placement Groups

Add Server to Placement Group

hcloud server add-to-placement-group --placement-group <group> <server>

Flags:

  • -g, --placement-group <group> - Placement Group ID or name (required)

Remove Server from Placement Group

hcloud server remove-from-placement-group <server>

Create Placement Group

hcloud placement-group create [options] --name <name> --type <type>

Flags:

  • --name <name> - Name (required)
  • --type <type> - Type (required, e.g. spread)
  • --label <key=value> - Labels (can be specified multiple times)
  • -o, --output json|yaml - Output format

List Placement Groups

hcloud placement-group list [options]

Columns: id, name, servers, type, age, created

Flags:

  • -l, --selector <label> - Filter by label selector
  • -s, --sort <field> - Sort results
  • -o, --output noheader|columns=...|json|yaml - Output options

Describe Placement Group

hcloud placement-group describe [options] <placement-group>

Flags:

  • -o, --output json|yaml|format - Output format

Delete Placement Groups

hcloud placement-group delete <placement-group>...

Labels and Protection

Add Label

hcloud server add-label [--overwrite] <server> <label>...

Labels use key=value format.

Flags:

  • -o, --overwrite - Overwrite if label key already exists

Remove Label

hcloud server remove-label <server> (--all | <label>...)

Flags:

  • -a, --all - Remove all labels

Enable Protection

hcloud server enable-protection <server> (delete|rebuild)...

Protection types: delete, rebuild. Specify one or both.

Disable Protection

hcloud server disable-protection <server> (delete|rebuild)...

Set Reverse DNS

hcloud server set-rdns [--ip <ip>] (--hostname <hostname> | --reset) <server>

Flags:

  • -i, --ip <ip> - IP address to set rDNS for
  • -r, --hostname <hostname> - Hostname for the PTR record
  • --reset - Reset rDNS to default value

Server Types (Read-Only)

List Server Types

hcloud server-type list [options]

Columns: name, id, description, cores, cpu_type, architecture, memory, disk, storage_type, category, included_traffic, traffic, deprecated

Flags:

  • -l, --selector <label> - Filter by label selector
  • -s, --sort <field> - Sort results
  • -o, --output noheader|columns=...|json|yaml - Output options

Describe Server Type

hcloud server-type describe [options] <server-type>

Flags:

  • -o, --output json|yaml|format - Output format

Images

List Images

hcloud image list [options]

Columns: name, id, type, os_flavor, os_version, description, architecture, disk_size, image_size, created, age, deprecated, bound_to, status, protection, rapid_deploy, labels, created_from

Flags:

  • -t, --type <type> - Filter by type: system, app, snapshot, backup
  • -a, --architecture <arch> - Filter by architecture: x86, arm
  • -l, --selector <label> - Filter by label selector
  • -s, --sort <field> - Sort results
  • -o, --output noheader|columns=...|json|yaml - Output options

Describe Image

hcloud image describe [options] <image>

Flags:

  • -a, --architecture <arch> - Architecture (default: x86)
  • -o, --output json|yaml|format - Output format

Delete Images

hcloud image delete <image>...

Update Image

hcloud image update [options] <image>

Flags:

  • --description <text> - Image description
  • --type <type> - Image type

Image Labels and Protection

hcloud image add-label [--overwrite] <image> <label>...
hcloud image remove-label <image> (--all | <label>...)
hcloud image enable-protection <image> delete
hcloud image disable-protection <image> delete

Infrastructure Reference

Locations

hcloud location list [options]

Columns: name, id, description, country, city, network_zone, latitude, longitude

Flags:

  • -o, --output noheader|columns=...|json|yaml - Output options
hcloud location describe [options] <location>

Flags:

  • -o, --output json|yaml|format - Output format

Datacenters (Deprecated)

Datacenters are deprecated. Use locations instead.

hcloud datacenter list [options]

Columns: name, id, description, location

hcloud datacenter describe [options] <datacenter>

ISOs

hcloud iso list [options]

Columns: id, name, description, type, architecture

Flags:

  • --architecture <arch> - Filter by architecture: x86, arm
  • --type <type> - Filter by type: public, private (default: both)
  • --include-architecture-wildcard - Include ISOs with unknown architecture (for custom ISOs with architecture filter)
  • -o, --output noheader|columns=...|json|yaml - Output options
hcloud iso describe [options] <iso>

Flags:

  • -o, --output json|yaml|format - Output format

List All Resources

hcloud all list [options]

Lists all project resources (servers, images, volumes, networks, firewalls, etc.). Does not include static/public resources like locations or public ISOs.

Flags:

  • --paid - Only list resources that cost money
  • -l, --selector <label> - Filter by label selector
  • -o, --output json|yaml - Output format