Where Is the doctl Config File?
doctl stores API tokens and contexts in config.yaml inside a per OS config directory. A custom file can be selected with the config flag.
Last updated
doctl writes authentication contexts to config.yaml after auth init runs. The containing directory is created on first successful authentication.
The default path follows OS conventions and differs on Windows, macOS, and Linux. Snap installs on Linux may place the file under the snap data directory.
Where doctl stores this, by platform
%APPDATA%\doctl\config.yaml
%APPDATA% expands to C:\Users\<user>\AppData\Roaming where <user> is the account name. Created by auth init. Use the config flag to point to another file.
/Users/<user>/Library/Application Support/doctl/config.yaml
<user> is the macOS account name. Directory is created on first auth init run. Spaces in Application Support require quoting in shell commands.
/home/<user>/.config/doctl/config.yaml
<user> is the Linux login name. If XDG_CONFIG_HOME is set, the base is <xdg_dir>/doctl/config.yaml where <xdg_dir> is that variable value. Snap builds may use ~/snap/doctl/<revision>/.config/doctl/config.yaml where <revision> is the snap revision.
Frequently asked questions
How do I change the config location?
Pass a custom path with the config flag for a single run. The help output may show a generic Unix default even on other systems, so check the OS specific path above.
Where are tokens and contexts?
Inside config.yaml as access token and context entries. Multiple contexts can share one file. Delete or edit the file to remove stale tokens.
Notice an outdated path? Let us know.