Develop Against Local vs. Remote R2 Storage

r2

// what it does

Plain `wrangler dev` runs your Worker locally and its R2 binding hits a local simulated bucket (empty by default, persisted under `.wrangler/state`) — fast, free, offline. Add `--remote` to run on Cloudflare's edge against the real bucket and its data, and use `-c` to point at a specific config when you juggle multiple environments.

// shell

$ wrangler dev
$ wrangler dev --remote
$ wrangler dev -c wrangler.staging.jsonc --remote

// gotcha

Local and remote R2 are completely separate stores: objects written in local dev never appear in the real bucket and vice-versa, and the local bucket starts empty. Reach for `--remote` when you need real objects, real CORS, or to reproduce production.