Deploy in 5 minutes

The shortest path from a local project to a live Worker.

On this page

This page lists the commands that put a new project on Cloudflare. Deploy and operate explains each step.

You need the Workers Paid plan and wrangler login.

Steps

  1. Create the resources, if the scaffolder did not (--create-resources). Put the database ID into wrangler.jsonc.

    pnpm exec wrangler d1 create my-site
    pnpm exec wrangler r2 bucket create my-site
  2. Apply the migrations to the production database:

    pnpm db:migrate --remote
  3. Set the secret that signs sessions:

    pnpm exec wrangler secret put BETTER_AUTH_SECRET
  4. Build and deploy (the deploy script builds first):

    pnpm run deploy
  5. Open /admin on the workers.dev URL and create your admin account.

Create your admin account right after the first deploy. Until a user exists, /admin/create-first-user is open to anyone.

Next

Edit this page on GitHub