Self-hosting
Run EmitKit on your own Cloudflare account: requirements, first deploy and updates.
You need a Cloudflare account on the Workers Paid plan (Queues and the CPU used by password hashing need it), a zone on Cloudflare DNS, and a HeroUI Pro licence to build the UI.
-
Clone and install
git clone https://github.com/emitkithq/emitkit-v3 && cd emitkit-v3 npx heroui-pro@latest login # or export HEROUI_AUTH_TOKEN=... pnpm install -
Create a deploy token with the permissions listed under Configuration, scoped to your account and zone.
-
Configure
.env.local(gitignored):CLOUDFLARE_API_TOKEN=... CLOUDFLARE_ACCOUNT_ID=... EMITKIT_DOMAIN=example.com # optional: EMITKIT_APP_HOST, EMITKIT_API_HOST, EMITKIT_SITE_HOST, # EMITKIT_REDIRECT_HOSTS, EMITKIT_EMAIL_FROM, EMITKIT_ALLOW_SIGNUP=false ...The chosen hostnames must not already have A/AAAA/CNAME records (a wildcard record is fine).
-
Deploy
pnpm build && pnpm exec alchemy deploy --stage prod --env-file .env.local --yesThe first deploy creates Alchemy’s state store (a Worker in your account), the D1 database (and migrates it), the Analytics Engine dataset, the queue and consumer, the Email Sending subdomain with its DNS records, a read-only Analytics token, and the Worker with its custom domains and hourly cron. Later deploys use
pnpm release, which refuses to run if that state has gone missing. -
Sign up at
https://app.<domain>and follow the getting-started flow. To close sign-ups afterwards, setEMITKIT_ALLOW_SIGNUP=falseand deploy again.
Variations
- No Analytics Engine: set
EVENT_STOREtod1inalchemy.run.tsto keep events in D1 for 90 days. You can then drop the dataset and the analytics token. - Different product name or several installs per account: set
EMITKIT_WORKER_NAME(and a different--stage) for each install. - No Workers AI: remove the
AIbinding. Emoji suggestions fall back to keyword matching.
Updating
git pull && pnpm install && pnpm release
Migrations are applied on deploy. Read the changelog and commit messages for anything that needs manual steps. Deployment covers deploying on every push, and Recovery covers backups and rollbacks.