LinuxmacOSWindows

Where Does Wrangler Store Config and Local State?

Wrangler keeps login data in a global config directory and keeps Worker settings and local state inside the project. Local secrets live in dev vars files next to the Worker config.

Last updated

Global Wrangler auth data lives in a TOML file under the global config directory. The exact base follows OS conventions with legacy fallback to a dot directory in the home folder.

Project work uses wrangler.toml or wrangler.jsonc plus .dev.vars for local secrets and .wrangler/state for local persistence. Those project paths are relative and behave the same on Windows, macOS, and Linux.

Where Wrangler stores this, by platform

Linux
/home/<user>/.config/.wrangler/config/default.toml

<user> is the Linux login name. Newer builds migrate to /home/<user>/.config/wrangler/config/default.toml where the app directory drops the leading dot. If /home/<user>/.wrangler exists, that legacy home directory takes precedence. Base changes with XDG_CONFIG_HOME when set to <xdg_dir>.

macOS
/Users/<user>/.config/.wrangler/config/default.toml

<user> is the macOS account name. Same migration to a wrangler directory without leading dot applies. Use the config option to point at a specific Worker config file instead of auto discovery.

Windows
C:\Users\<user>\AppData\Roaming\.wrangler\config\default.toml

<user> is the Windows account name. Equivalent to %APPDATA%\.wrangler\config\default.toml. Opting into the keyring option writes default.enc next to default.toml and keeps the key in Credential Manager.

Linux
<project>/.wrangler/state

<project> is the Worker project directory. Same relative path on Windows and macOS. Default location for local persistence during dev. Can be changed with the persist to option.

Linux
<project>/.dev.vars

<project> is the Worker project directory. Same relative path on Windows and macOS. Holds local secrets for dev runs. Do not commit this file. An env specific variant uses suffix with the environment name.

Linux
<project>/wrangler.toml

<project> is the Worker project directory. Same relative path on Windows and macOS. JSON variants are wrangler.json and wrangler.jsonc. The config option selects an alternate file.

Frequently asked questions

Where are login tokens?

In default.toml under the global config directory for the default profile. Other profiles and non production environments use a different TOML name in the same config folder. The whoami command reports the active credential location.

Should .dev.vars and .wrangler be committed?

No. Add dev vars files and the .wrangler directory to ignore rules. They contain secrets and machine specific state. Keep wrangler.toml in version control and document required secret names.

Notice an outdated path? Let us know.