Getting started
Prerequisites
Section titled “Prerequisites”- Bun (recommended) or Node.js 22+
- A Cloudflare account
Create a project
Section titled “Create a project”mkdir my-app && cd my-app && bun init -ymkdir my-app && cd my-app && npm init -ymkdir my-app && cd my-app && pnpm initmkdir my-app && cd my-app && yarn init -yInstall
Section titled “Install”bun add "alchemy@latest" "effect@rc" "@effect/platform-bun@rc" "@effect/platform-node@rc"npm install "alchemy@latest" "effect@rc" "@effect/platform-bun@rc" "@effect/platform-node@rc"pnpm add "alchemy@latest" "effect@rc" "@effect/platform-bun@rc" "@effect/platform-node@rc"yarn add "alchemy@latest" "effect@rc" "@effect/platform-bun@rc" "@effect/platform-node@rc"Create your Stack
Section titled “Create your Stack”Every Alchemy program starts with a Stack — create alchemy.run.ts:
import * as Alchemy from "alchemy";import * as Cloudflare from "alchemy/Cloudflare";import * as Effect from "effect/Effect";
export default Alchemy.Stack( "MyApp", { providers: Cloudflare.providers(), state: Cloudflare.state(), }, Effect.gen(function* () { const bucket = yield* Cloudflare.R2.Bucket("Bucket");
return { bucketName: bucket.bucketName, }; }),);Deploy
Section titled “Deploy”Run alchemy deploy to create the Bucket on Cloudflare:
bun alchemy deploynpx alchemy deploypnpm alchemy deployyarn alchemy deployConnect Cloudflare first with alchemy profile edit --add Cloudflare.
Sign in with OAuth in the browser or paste an API token. The
credentials are saved to your default
profile at ~/.alchemy/profiles.json. No
environment variables required. Logging in only ever happens through the
profile command; a deploy with nothing configured fails with the exact
command to run.
Once you’re authenticated, Alchemy shows a plan, asks for confirmation, and provisions the resource:
Plan: 1 to create + Bucket (Cloudflare.R2.Bucket) Proceed? ◉ Yes ○ No ✓ Bucket (Cloudflare.R2.Bucket) created { bucketName: "myapp-bucket-a1b2c3d4e5", }
That’s it — you have a live R2 Bucket on Cloudflare.
Full command reference: CLI.
Where next
Section titled “Where next”You have a live Stack. What is Alchemy? explains what just happened and the model the rest of the docs build on. The tutorial then builds a full app on Cloudflare, starting from this exact Stack.