Creating Local R2 bindings
# workers-help
k
Hi, I know I need to initialize Buckets locally before attempting to bind them in workers run with
wrangler dev
. For the life of me, I can't find docs on what the
wrangler
command is for that. Plz help
h
Pick your package manager. NPM:
Copy code
sh
npx wrangler r2 bucket create somebucket
```PNPM: ```sh
pnpm wrangler r2 bucket create somebucket
```Yarn: ```sh
yarn wrangler r2 bucket create somebucket
k
Let me be more specific: I am trying to initialize an R2 bucket that is only supposed to exist locally, in a dev environment. How do I create a preview bucket, one that I would need to reference via
preview_bucket_name
As far as I can tell ^^^ deploys actual R2 buckets
h
Oh, if you have a binding to an R2 bucket in your
wrangler.toml
, then it will be created automatically for local dev
k
Ahhh, my b. Thx! Was confused because I feel like at some point I ran into this problem, and I needed to init something, but maybe I misremembered