Overview
What you deploy to run Flaresend, which Cloudflare products it uses, and what you need before you start.
Flaresend is not a hosted service. You deploy it to your own Cloudflare account, and every email your apps send goes out through your account's Cloudflare Email Service.
What you deploy
| Worker | Required | What it does |
|---|---|---|
flaresend (apps/mailer) | Yes | The mailer. Serves the HTTP API, the MailerRpc and AdminRpc service-binding entrypoints, the four queue consumers and the cron job. It is the only thing in the account that sends email. |
flaresend-dashboard (apps/dashboard) | No | The admin dashboard, a Next.js app behind Cloudflare Access. It talks to the mailer over the MAILER_ADMIN service binding and holds no API key. |
The CLI (packages/cli) is a third way to manage the mailer. It runs on your machine and calls the admin HTTP API.
Cloudflare products it uses
| Product | Name in the account | Used for |
|---|---|---|
| Email Service (Email Sending) | binding EMAIL | Sending the email, and publishing delivery events |
| D1 | database flaresend, binding DB | Projects, keys, emails, recipients, events, webhooks, templates, contacts, analytics |
| R2 | bucket flaresend-payloads, binding PAYLOADS | Email bodies and attachments, deleted after 30 days by a lifecycle rule |
| Queues | flaresend-send, flaresend-events, flaresend-webhooks, flaresend-dlq | Sending with retries, delivery events, webhook deliveries, and the dead letter queue |
| Rate Limiting | binding RATE_LIMITER | A per-project cap of 300 sends per 60 seconds |
| Cron Triggers | */5 * * * * | Scheduled sends more than 12 hours out, broadcasts, the daily analytics rollup |
| Access | (dashboard only) | The dashboard's login |
What you need
- A Cloudflare account with Email Service available.
- Your sending domains on Cloudflare DNS, in the same account. Cloudflare Email Service requires Cloudflare DNS, so a domain whose DNS is on Route 53, Namecheap or anywhere else cannot send. The domain can stay registered there: point its nameservers at Cloudflare. See Domains.
- Node.js 22 (the repo's
.nvmrcsays22) and pnpm 10. - macOS, Linux or WSL. On plain Windows the mailer deploys, but the dashboard does not build.
- A clone of the repository and
pnpm install --frozen-lockfileat its root. - The Workers Paid plan. Cloudflare Email Service needs it to send to any address. On the free plan it only sends to addresses verified in your account.
With those in place, npx wrangler login and then pnpm bootstrap set up everything. See Deploy.
Transactional email only
Cloudflare Email Service is for transactional email. Marketing and bulk campaigns are not permitted. Broadcasts are off per project by default and each one is capped at BROADCAST_MAX_RECIPIENTS (500 unless you change it).
Next steps
Deploy
Run pnpm bootstrap, or create the resources, onboard a domain, set secrets and deploy by hand.
Configuration
Every variable, secret and binding the mailer reads.
Dashboard
Deploy the admin dashboard behind Cloudflare Access.
CLI
Manage projects, keys, emails and suppressions from a terminal.
Architecture
Tables, queues, retries and the cron job.
Local development
Run the mailer on your machine and fake delivery events.