Create a Primary IP
Create a Primary IP.
The --datacenter flag is deprecated. Use --location or --assignee-id instead. See https://docs.hetzner.cloud/changelog#2025-12-16-phasing-out-datacenters.
hcloud primary-ip create [options] --type <ipv4|ipv6> --name <name>
--assignee-id int Assignee (usually a Server) to assign Primary IP to
--assignee-type string Assignee Type to assign Primary IP to (default: server) (default "server")
--auto-delete Delete Primary IP if assigned resource is deleted (true, false)
--datacenter string Datacenter (name) (deprecated)
--enable-protection strings Enable protection (delete) (default: none)
-h, --help help for create
--label stringToString User-defined labels ('key=value') (can be specified multiple times) (default [])
--location string Location (ID or name) of Primary IP
--name string Name (required)
-o, --output stringArray output options: json|yaml
--type string Type (ipv4 or ipv6) (required)
--config string Config file path (default "~/.config/hcloud/cli.toml")
--context string Currently active context
--debug Enable debug output
--debug-file string File to write debug output to
--endpoint string Hetzner Cloud API endpoint (default "https://api.hetzner.cloud/v1")
--hetzner-endpoint string Hetzner API endpoint (default "https://api.hetzner.com/v1")
--no-experimental-warnings If true, experimental warnings are not shown
--poll-interval duration Interval at which to poll information, for example action progress (default 500ms)
--quiet If true, only print error messages
- hcloud primary-ip - Manage Primary IPs