hcloud_config.md

February 6, 2026 ยท View on GitHub

hcloud config

Manage configuration

Synopsis

This command allows you to manage options for the Hetzner Cloud CLI. Options can be set inside the configuration file, through environment variables or with flags.

The hierarchy for configuration sources is as follows (from highest to lowest priority):

  1. Flags
  2. Environment variables
  3. Configuration file (context)
  4. Configuration file (global)
  5. Default values

Option values can have following types:

  • string
  • integer
  • boolean (true/false, yes/no)
  • duration (in the Go duration format, e.g. "1h30m")
  • any of the above as a list

Most options are 'preferences' - these options can be set globally and can additionally be overridden for each context. Below is a list of all non-preference options:

OptionDescriptionTypeConfig keyEnvironment variableFlag
configConfig file path (default "~/.config/hcloud/cli.toml")stringHCLOUD_CONFIG--config
contextCurrently active contextstringactive_contextHCLOUD_CONTEXT--context
tokenHetzner Cloud API tokenstringtokenHCLOUD_TOKEN

Since the above options are not preferences, they cannot be modified with 'hcloud config set' or 'hcloud config unset'. However, you are able to retrieve them using 'hcloud config get' and 'hcloud config list'. Following options are preferences and can be used with set/unset/add/remove:

OptionDescriptionTypeConfig keyEnvironment variableFlag
debugEnable debug outputbooleandebugHCLOUD_DEBUG--debug
debug-fileFile to write debug output tostringdebug_fileHCLOUD_DEBUG_FILE--debug-file
default-ssh-keysDefault SSH Keys for new Servers and Storage Boxesstring listdefault_ssh_keysHCLOUD_DEFAULT_SSH_KEYS
endpointHetzner Cloud API endpointstringendpointHCLOUD_ENDPOINT--endpoint
hetzner-endpointHetzner API endpointstringhetzner_endpointHETZNER_ENDPOINT--hetzner-endpoint
no-experimental-warningsIf true, experimental warnings are not shownbooleanno_experimental_warningsHCLOUD_NO_EXPERIMENTAL_WARNINGS--no-experimental-warnings
poll-intervalInterval at which to poll information, for example action progressdurationpoll_intervalHCLOUD_POLL_INTERVAL--poll-interval
quietIf true, only print error messagesbooleanquietHCLOUD_QUIET--quiet
sort.<resource>Default sorting for resourcestring listsort.<resource>HCLOUD_SORT_<RESOURCE>

Options will be persisted in the configuration file. To find out where your configuration file is located on disk, run 'hcloud config get config'.

Options

  -h, --help   help for config

Options inherited from parent commands

      --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

SEE ALSO