Deploy · Cloudflare Workers

Your email API on the edge. No servers, no Docker.

EmailFlare runs as a Cloudflare Worker — with D1 for storage, KV for caching, and the React admin UI served as a static asset. No Docker, no volumes, no servers to manage. One command sets everything up.

bash — emailflare worker deploy
# 1. Install all dependencies
$ just install
# 2. Configure Cloudflare credentials
$ cp scripts/config.example.toml scripts/config.toml
$ just worker-login
# 3. One-command deploy
$ just worker-setup
D1 database created: emailflare
KV namespace created: EMAILFLARE_CACHE
Secrets configured
Admin UI built
Deployed → https://emailflare.workers.dev
Why Cloudflare Workers

Email API at the edge.
Zero infrastructure overhead.

Cloudflare Workers bring EmailFlare closer to your users and further from your ops burden — no servers to provision, no containers to run, no volumes to back up.

Zero cold starts, global edge

Cloudflare Workers run on V8 isolates — no containers, no boot time. Your email API responds in milliseconds from data centres in 300+ cities worldwide.

🗄️

D1 SQLite — no database to manage

EmailFlare stores everything in Cloudflare D1: templates, API keys, domains, send logs. D1 is fully managed SQLite at the edge — no provisioning, no backups to configure.

📦

One command from zero to deployed

just worker-setup creates your D1 database, KV namespace, patches wrangler.jsonc, runs migrations, sets secrets, builds the admin UI, and deploys — all automatically.

🖥️

Admin panel included

The full React admin UI ships as a Worker static asset. No separate hosting needed — it's served directly from the same Worker deployment on your workers.dev subdomain.

🔄

Gradual rollout built in

Use just worker-rollout-upload to stage new versions with Cloudflare's gradual rollout feature. Ship confidently — roll back in seconds if something goes wrong.

💰

Cloudflare Workers free tier

Workers free tier covers 100,000 requests per day, and D1 includes 5 GB storage and 25 million row reads daily. For most teams, the cost of running EmailFlare on Workers is zero.

Comparison

Docker self-host vs. Cloudflare Workers

Both options ship with EmailFlare. Choose Docker for full control and on-prem deployments; choose Workers for zero-ops edge hosting.

Docker self-host

compose.yaml + .env.local

Full container stack — Hono API, React admin UI, SQLite storage on a server you control.

  • Full control over your infrastructure
  • On-premises or private cloud friendly
  • Railway, Fly, VPS, Docker Swarm — works anywhere
  • SMTP test mode with Mailpit bundled
  • Requires a server or PaaS platform
  • Volume management and backups on you
  • Container restarts required for updates
Cloudflare Workers

wrangler deploy

Serverless edge deployment — no containers, no servers, no volumes. D1 + KV + static assets.

  • No servers to provision or manage
  • Global edge — 300+ Cloudflare locations
  • D1 SQLite — managed, no backup config needed
  • Admin UI served as static asset from Workers
  • Gradual rollout with just worker-rollout-upload
  • Zero cost on Workers free tier for most teams
  • One command to update: just worker-update
Setup guide

Deploy to Workers in four steps.

The setup script handles everything automatically — D1, KV, secrets, admin build, and deploy. You just need your Cloudflare credentials ready.

1

Install dependencies

Clone the repo and run just install from the root. This installs dependencies for the setup scripts, the Worker, and the admin UI in one step.

git clone https://github.com/0xdps/emailflare.git cd emailflare just install
💡 You'll need just, Node.js 18+, and pnpm installed. Run npm i -g pnpm if pnpm isn't available yet.
2

Configure credentials

Copy the example config and fill in your Cloudflare API token, account ID, and the secrets EmailFlare will use at runtime.

cp scripts/config.example.toml scripts/config.toml

Edit scripts/config.toml — the key fields are:

[deploy] cloudflare_api_token = "your_cf_api_token" account_id = "your_account_id" [secrets] admin_token = "$(openssl rand -hex 32)" session_secret = "$(openssl rand -hex 32)"
🔐 Need to create a Cloudflare API token? See the Cloudflare API Token guide for the exact permissions required.
3

Authenticate with Cloudflare

Log in to Cloudflare via Wrangler. This opens a browser window — authorise the CLI and return to the terminal. You only need to do this once per machine.

just worker-login
💡 If you prefer not to use browser auth, you can set CLOUDFLARE_API_TOKEN in your environment instead. The setup script will use it automatically.
4

Run the setup script

just worker-setup does the full deploy — automatically:

just worker-setup D1 database created: emailflare KV namespace created: EMAILFLARE_CACHE wrangler.jsonc patched with IDs D1 migrations applied Secrets pushed to Worker Admin UI built Deployed → https://emailflare.workers.dev

After the first deploy, add ADMIN_ORIGIN to scripts/config.toml with your Worker URL, then run just worker-setup again to push the secret. This prevents cross-origin requests to the admin panel.

That's it. Open your workers.dev URL — the EmailFlare admin panel is live. Add a sending domain, generate an API key, and start sending email from the edge.

Continue setting up EmailFlare

Everything you need to get to a working deploy.