Self-hosting
Deploy Pile on your own Cloudflare account — worker, D1, Durable Objects, and secrets.
Self-hosting
Pile is a single Cloudflare Worker with a D1 database for global metadata and a WorkspaceDO Durable Object class for per-workspace state.
Requirements
- A Cloudflare account with Workers, D1, and Durable Objects enabled
- Node 22+ and pnpm
wrangler(bundled as a dev dependency)
Deploy
Create the D1 database
wrangler d1 create pile-globalPut the returned database_id into wrangler.toml under [[env.production.d1_databases]].
Apply migrations
wrangler d1 migrations apply pile-global --env production --remoteDurable Object SQLite needs new_sqlite_classes in the [[migrations]]
block — the repo’s wrangler.toml already has it.
Set secrets
wrangler secret put BETTER_AUTH_SECRET
wrangler secret put TOKEN_HASH_SECRETIntegration secrets (Slack, GitHub, email providers) are optional — a
missing key just disables that capability. Check wrangler.toml and
.dev.vars.example for the full list.
Build and deploy
pnpm install
pnpm -C apps/web run build # member console assets
pnpm exec wrangler deploy -e productionVerify
curl -fsS https://<your-worker>/healthLocal dev
pnpm install
pnpm run dev # wrangler dev + miniflare
packages/docs is a second worker (pile-docs) built with blume build and deployed with pnpm -C packages/docs run deploy — the docs you’re reading now.
CI note
This repo ships through an external artifacts→CI pipeline: pushes to main run deps → build → migrate → deploy in containers. If you self-host, wrangler deploy is enough; the pipeline is optional infrastructure.