WindowsmacOSLinux

Where Does Wrangler Store Config and State?

Wrangler projects center on wrangler.toml with local state in .wrangler, plus secrets and vars kept out of the repo.

Last updated

Wrangler keeps deployment config beside the code, which makes worker projects unusually portable. The wrangler.toml file names the worker, binds KV, R2, D1, and queues, and selects compatibility dates. Everything Cloudflare needs to build the worker reads from that file.

Local-only state stays out of version control by convention. The .wrangler folder holds dev session data, and .dev.vars holds local secrets for wrangler dev. Real secrets go up with wrangler secret and never touch disk in plain text.

Where Wrangler stores this, by platform

Windows
[ProjectDir]\wrangler.toml

Worker name, bindings, compatibility date, and env blocks. The .wrangler folder beside it holds local dev state. Keep .dev.vars out of git; it carries local-only secrets.

macOS
[ProjectDir]/wrangler.toml

Same project-relative layout on macOS. Multiple environments live as [env.name] blocks in the one file, selected with --env on the command line.

Linux
[ProjectDir]/wrangler.toml

Same arrangement. CI deploys need only the repo plus a CLOUDFLARE_API_TOKEN; no user-level config file is required on the build machine.

Frequently asked questions

Can I deploy from a fresh clone without extra files?

No. wrangler.toml and code ship; .dev.vars and .wrangler stay local. Secrets set with wrangler secret live in Cloudflare, never in a file, which is exactly why deploys from fresh clones still work.

How do local dev and deploy read the same config?

Run wrangler dev for the local runtime (state under .wrangler) and wrangler deploy for production. The same toml drives both; --env picks the environment block when you have several.

Notice an outdated path? Let us know.