Where Does hcloud Store Tokens and Contexts?
hcloud keeps API tokens and contexts in a TOML config file under XDG config, overridable by flag.
Last updated
hcloud configuration is one TOML file. API tokens and named contexts live there under the XDG config home. A flag overrides the path for portable setups.
That single file is the whole backup. Tokens grant full API access, so permissions matter more than usual. Contexts let one file serve personal and work projects side by side.
Where hcloud stores this, by platform
~/.config/hcloud/cli.toml
Tokens and contexts in one TOML file. Override path with flags for portable use. Tighten permissions given full API access.
~/.config/hcloud/cli.toml
Same XDG path on Mac. Contexts switch token and defaults together. Copy the file to migrate everything.
C:\Users\<you>\.config\hcloud\cli.toml
Same default under the user profile on Windows. Rotate tokens when machines change hands. One file serves all contexts.
Frequently asked questions
How do I move hcloud to a new machine?
Copy the TOML file to the new machine with tight permissions. Tokens and contexts travel together. Rotate tokens afterward if the old machine leaves your control.
Can hcloud hold multiple tokens?
Yes through named contexts in the same file. Switching contexts swaps token and defaults together. The active context setting selects among them.
Notice an outdated path? Let us know.