Put Pantry online
Pantry runs on your own computer first. To use it from anywhere, put it online: Run Edit Run can do it with you, or you can do it yourself on your own Cloudflare account.
Let Run Edit Run do it
We set it up with you and keep it updated. It stays yours, on your computer or your own cloud.
What stays yours
- The code: Pantry is MIT licensed, so you can change it and run it without us.
- The data: it stays on your computer or in your own Cloudflare account.
- If you stop, your repository and your Cloudflare account stay yours.
For now, sign-ups are by request. The link asks for access with Pantry and Assisted already chosen, and we email you about the next steps.
Do it yourself
Put Pantry on your own Cloudflare account from a terminal. rer deploy does the work from the run-pantry folder on your computer.
What you need
- Pantry on this computer, started with the line on Run Pantry. It installs
rer; if you started with npx instead, putnpx -y @runeditrun/rerwherever this page saysrer. - A Cloudflare account (sign up). Pantry runs on Cloudflare Workers with a D1 database, 2 R2 buckets and a schedule; Cloudflare's pricing lists what each plan includes. Turn on R2 once in the dashboard (R2 Object Storage) before the first deploy.
- A Resend, SendGrid or Cloudflare Email Sending account with a domain of your own verified there, so the hosted Pantry can email sign-in links.
Give your Cloudflare account a workers.dev address
In the Cloudflare dashboard, open Workers & Pages. The first time, Cloudflare asks you to choose your account's
workers.devsubdomain, for exampleyourname. Pantry will answer at:https://pantry-production.yourname.workers.devWithout it, rer deploy stops with
workers-subdomain-missing.Find your account ID and make an API token
- In Workers & Pages, copy your Account ID.
- Open API Tokens (My Profile → API Tokens), choose Create Token, then Create Custom Token.
- Name it
Pantry deployand add these account permissions: Workers Scripts: Edit, D1: Edit and Workers R2 Storage: Edit. Under Account Resources, choose your account. No zone permission is needed. - Choose Continue to summary, then Create Token, and copy the token. Cloudflare shows it once.
If a permission is missing, the deploy stops with an error such as
token-scope-missing-d1: add that permission to the token and run the same command again.Write the deploy file
In the
run-pantryfolder, create a file named.env.pantrywith these lines, each value replaced with yours:OWNER_EMAIL=you@example.com CLOUDFLARE_ACCOUNT_ID=your account ID CLOUDFLARE_API_TOKEN=the token MAIL_PROVIDER=resend MAIL_API_KEY=your mail provider's API key MAIL_FROM=hello@example.comOWNER_EMAILis your own mailbox: the hosted Pantry's owner, where your sign-in links go. Without it, rer deploy uses the owner Pantry on this computer was set up with, which is a placeholder ending in.testif you started it with the one line, and no mail reaches that.MAIL_PROVIDERisresend,sendgridorcloudflare. Withcloudflare, addMAIL_ACCOUNT_ID=and your Cloudflare account ID too.MAIL_FROMis a sender address on the domain you verified with your mail provider.
Make it readable only by you; rer deploy refuses it otherwise. Never add it to a commit.
chmod 600 .env.pantryDeploy
Stop Pantry on this computer first: rer deploy refuses while it runs. To start it again later, run the same line from the same folder; its data stays as you left it.
rer dev --stop rer deploy --env-file .env.pantryrer deploy builds Pantry, creates its Worker, a D1 database, 2 R2 buckets and a schedule on your account and checks that it answers. It ends with these lines:
Your application is live on your Cloudflare account at https://pantry-production.yourname.workers.dev. Claimed the hosted owner (you@example.com); the one-time setup token was removed. Sign in by email at https://pantry-production.yourname.workers.dev.Open that address and sign in with your owner email: Pantry emails you a sign-in link. If it does not arrive, look for the message in your mail provider's dashboard. The hosted Pantry starts with its own, empty data; the data on this computer stays where it is.
Keep it current
- Update Pantry: in the
run-pantryfolder, rungit pull, thenrer deploy --env-file .env.pantryagain. The hosted data stays. - Change one setting: put the new value in
.env.pantry, then runrer deploy --set-secret NAME --env-file .env.pantrywith the setting's name. - Keep the
.rerfolder. It records what rer deploy created on your account, so later deploys update the same Pantry. Deploy from the same folder each time. - Take it down:
rer deploy --remove --yes --env-file .env.pantrydeletes the Worker and everything rer created for it, with its data, and checks that none of it remains. Save what you need first.