---
title: "Self-host"
description: "Run OneSend on your own Cloudflare account (Workers and D1), with Docker or with Node.js: sending, team inbox, spam filter, calendar, booking pages and Drive. $9.99 once, every update included."
url: https://onesend.email/self-host/
---
# The whole workspace, on your own Cloudflare account or server

Sending through your providers, a team inbox on your own domains with a spam filter, calendars, booking pages and Drive, on infrastructure you control. $9.99 once for one installation, with every future update included.

[Buy for $9.99](#buy) [Cloudflare guide](https://onesend.email/docs/cloudflare/)

## What you pay for

One payment, one installation, and every release after it. The software runs on infrastructure you control.

### $9.99 once

One payment buys one license key. One key activates one installation: one Cloudflare account, one server, or one cluster that shares a database.

### Every update included

Every future release of the self-hosted edition, with no renewal and no subscription. You choose when to deploy each one.

### Your account, your data

Mail, calendars, files, provider keys and logs stay in your Cloudflare account or on your server. No limits on domains, mailboxes, providers or sending.

Without a key it runs for evaluation: the dashboard, test API keys and the Sandbox provider work, and live email does not. OneSend is proprietary software under the [OneSend License](https://onesend.email/legal/license/).

## What is included

One license is the whole product, not a tier. Use only sending, or move your team's mail, calendars and files onto the same installation. [All features](https://onesend.email/features/)

### Sending

- One API for 25 providers, with routing and failover
- Domains with MX, SPF, DKIM and DMARC status, and tracking per domain
- Templates, campaigns and automations
- One log and analytics for every provider
- REST API, SDKs, CLI and an MCP server

### Team inbox

- Mailboxes and a catch-all on your own domains
- Your Gmail, Outlook, Zoho and IMAP accounts in the same inbox
- One mailbox on several domains
- Shared, members-only and personal mailboxes. Admins cannot read personal mail
- Routing rules, labels, assignment, notes and snooze
- Search, undo send and send later
- Import .eml and .mbox files, including Gmail Takeout
- IMAP and SMTP for mail apps (Docker and Node.js)

### Spam filter

- Scores sender authentication, known senders, links and attachments
- Learns from Report spam and Not spam in each mailbox
- Runs on your installation. Nothing is sent to an outside service

### Calendar

- Personal and shared calendars
- Repeating events and reminders
- Invitations and RSVP that work with Google, Outlook and Apple calendars
- .ics import and export, and subscription links

### Booking pages

- A public page for each person
- Meeting types with durations, buffers and notice
- Open times in the visitor’s time zone
- Taken times are never offered, so nothing is booked twice

### Drive

- Personal and shared drives
- Resumable uploads, versions and previews
- Sharing with members, and public links with a password and expiry
- Attach from Drive in mail, and save attachments to Drive

## What works where

The same software runs in all three ways. Cloudflare runs it for you without a server, but it cannot accept the direct connections that mail apps use. Docker and Node.js can, and you run the server.

| Feature | Cloudflare | Docker | Node.js |
|---|---|---|---|
| Mail on your own domains |  |  |  |
| Sending through your providers, with routing and failover | Works | Works | Works |
| Receiving mail on your domains | Cloudflare Email Routing | MX record and port 25 | MX record and port 25 |
| Team inbox, spam filter, calendar, booking pages and Drive | Works | Works | Works |
| Templates, campaigns, lists and automations | Works | Works | Works |
| Your other email accounts |  |  |  |
| Gmail, Outlook and Zoho accounts in the inbox | Works | Works | Works |
| iCloud, Yahoo, Fastmail and other IMAP accounts | –Not available | Works | Works |
| New mail from IMAP accounts within seconds | –Not available | Works | Works |
| A campaign to more than about 3,500 recipients at once | Can reach Cloudflare’s per-run limit; the job is retried | Works | Works |
| Mail apps |  |  |  |
| IMAP and POP3 for desktop and phone mail apps | –Not available | Works | Works |
| SMTP submission from mail apps and devices | –Not available | Works | Works |
| Running it |  |  |  |
| What you need | Cloudflare Workers Paid | A server with Docker | A server with Node.js 22.13+ |
| HTTPS | Included | You add it (reverse proxy) | You add it (reverse proxy) |
| Database | D1 | SQLite or PostgreSQL | SQLite, PostgreSQL, libSQL or PGlite |
| Backups | D1 Time Travel, 30 days | You back up the volume | You back up the database |
| Installer | install.sh sets it all up | install.sh sets it all up | npm run setup |

Every option needs a sending provider for live mail (your own account with Amazon SES, Postmark, Resend or another) and a domain you can add DNS records to. The Connect Google, Microsoft and Zoho buttons need your own [OAuth app](https://onesend.email/docs/oauth-apps/) with each of them; until then those accounts connect with an app password over IMAP, on Docker and Node.js. Gmail, Outlook and Zoho are checked for new mail every few minutes. Details: [what is not available on Cloudflare](https://onesend.email/docs/cloudflare/#what-is-not-available-on-the-cloudflare-edition), [connected accounts](https://onesend.email/docs/unified-inbox/).

Pricing

## One payment, one installation

No subscription and no charge per email. The earlier you buy, the less you pay.

Founding price · First 15 buyers

$9.99once

- One license key for one installation
- Every future update included
- Sending, team inbox, calendars, booking pages and Drive
- Cloudflare Workers and D1, Docker or Node.js

The key is shown after payment and sent by email. Payments are handled by Dodo Payments, the merchant of record. Prices in USD, plus tax where it applies. Full refund within 14 days of purchase: email us at [support@onesend.email](mailto:support@onesend.email).

### The price goes up as more people buy

1. FoundingFirst 15 buyers$9.99Now
2. EarlyNext 50 buyers$14.99Now
3. StandardAfter that$24.99Now

Buying now saves $15.00 on the standard price.

### Already bought? Download with your license key

Enter the key from your purchase email to get the current release and earlier ones, with their SHA-256. Every update is included: come back here for new versions. A link works for an hour.

Or install from a terminal: it asks for the key, downloads the newest release, checks it and can set it up on Cloudflare or Docker.

```bash
curl -fsSL https://onesend.email/install.sh | sh
```

## Connect any of the 25 providers

Add the provider accounts you already have, in any combination. Provider keys are encrypted with your server secret and stay in your installation.

- Resend
- Amazon SES
- Brevo
- Mailgun
- Postmark
- SendGrid
- Cloudflare Email
- SMTP2GO
- MailerSend
- Mailjet
- SparkPost
- ZeptoMail
- Elastic Email
- Plunk
- Mailtrap
- MailChannels
- AhaSend
- Lettermint
- Postal
- Mandrill
- SocketLabs
- Infobip
- Scaleway
- Azure Communication Services
- Any SMTP server

Logos are trademarks of their owners. OneSend is not affiliated with or endorsed by them.

Option 1

## Your Cloudflare account

The main way to run it. One Worker runs the API, dashboard, jobs and inbound mail, with D1 as the database, Queues for jobs, R2 for attachments, imports and Drive files, and Email Routing for receiving. Nothing runs on a server of yours.

- A Cloudflare account on the Workers Paid plan (from $5 a month, billed by Cloudflare). The Free plan’s CPU and D1 limits are too low.
- Node.js 22.13 or later and the unpacked download with npm install done. Wrangler comes with it.
- `npm run cf:setup` creates the D1 database, a queue and an R2 bucket, writes `wrangler.jsonc` and stores the secret.
- `npm run cf:deploy` builds the dashboard and the template snapshot, then deploys the Worker (the same step as `npm run deploy -w @onesend/worker-cf`). Tables are created on the first request.

Not on Cloudflare: IMAP and POP3 for mail apps, SMTP submission, the built-in SMTP receiver, and connected IMAP accounts (iCloud, Yahoo, Fastmail); Gmail, Outlook and Zoho accounts work. They need a server that accepts connections, so use Docker or Node.js for them. Mail comes in through Email Routing instead. Starting one campaign to more than about 3,500 recipients can reach Cloudflare's per-run limit, and the job is then retried; see the guide's limits.

[Cloudflare guide](https://onesend.email/docs/cloudflare/)

```bash
npx wrangler login
npm run cf:setup    # creates D1, a queue and R2, stores the secret
npm run cf:deploy   # builds the dashboard and deploys the Worker
```

```bash
cd apps/worker-cf
npx wrangler secret put ONESEND_LICENSE_KEY   # paste the key
```

Option 2

## Docker

Docker builds the image from the download. It runs in production mode and exposes HTTP on 3000, SMTP submission on 2587, the inbound SMTP receiver on 2525, and IMAP (1143, 1993) and POP3 (1110, 1995) for mail apps. Data is kept in a volume.

Docker reads its settings from `.env`, so create it before the first start, with a generated `ONESEND_SECRET`. The installer command above does all of this for you.

Start from the release you [download with your license key](#download), unpacked. Questions: [support@onesend.email](mailto:support@onesend.email).

[Docker instructions](https://onesend.email/docs/getting-started/#option-b-docker)

```bash
tar -xzf onesend-selfhost-<version>.tar.gz   # downloaded with your license key
cd onesend-selfhost-<version>
cp .env.example .env
# the server secret (required), your license key and a one-time setup code for the owner account
sed -i.bak "s|^ONESEND_SECRET=.*|ONESEND_SECRET=$(openssl rand -base64 32)|" .env && rm .env.bak
echo "ONESEND_LICENSE_KEY=OS-XXXXX-XXXXX-XXXXX-XXXXX" >> .env
echo "ONESEND_SETUP_CODE=$(openssl rand -hex 6)" >> .env && grep _SETUP_CODE .env
docker compose up -d --build
# With PostgreSQL in a second container instead of SQLite:
docker compose -f docker-compose.yml -f docker-compose.postgres.yml up -d --build
```

Option 3

## Node.js

`npm run setup` asks where the server runs, which database to use and who can create accounts. It generates `ONESEND_SECRET`, creates the tables and writes `.env`. Open the dashboard on port 3000 and create the owner account.

`npm run doctor` checks the configuration, database, ports and public URL at any time.

Start from the release you [download with your license key](#download), unpacked. Questions: [support@onesend.email](mailto:support@onesend.email).

```bash
tar -xzf onesend-selfhost-<version>.tar.gz   # downloaded with your license key
cd onesend-selfhost-<version>
npm install
npm run setup       # asks a few questions, writes .env and creates the tables
npm run build:web   # builds the dashboard
npm start           # starts the server on port 3000
```

## Requirements for Docker and Node.js

- Node.js 22.13 or later, or Docker.
- A database. With nothing configured it uses a SQLite file, so there is nothing to install.
- No Redis. Jobs, quota counters and idempotency keys live in the database.
- For production: a domain, HTTPS in front of the server, and a backed-up secret.

## Databases

- SQLite (default)
- PostgreSQL, including Neon, Supabase and Amazon RDS
- Turso and libSQL
- Cloudflare D1
- PGlite

Set `DATABASE_URL`, or choose one in `npm run setup`. SQLite supports one server process; use PostgreSQL for several.

## After you install

The installer sets up the database, storage and the server. These steps connect it to your mail, once.

1. **Create the owner account.** Open your installation and sign up with the setup code the installer printed. Without the code nobody can claim a new installation, even when its address is already public.
2. **Add a sending provider and your domain.** Connect your provider account, add the domain and publish the DNS records it shows (SPF, DKIM, DMARC). Add the license key too, if the installer did not.
3. **Receive mail.** Create the mailboxes, then send the domain's mail to your installation: [how](#receiving).
4. **Docker and Node.js: put HTTPS in front** and set the public URL before others use it: [an example](#https).
5. **Optional:** a model key for the AI features under Settings, and [OAuth apps](https://onesend.email/docs/oauth-apps/) for the Connect Google, Microsoft and Zoho buttons.

## Receiving mail

Sending works without it. To receive a domain's mail, add the domain, create its mailboxes or a catch-all, then send the domain's mail to your installation.

- **Cloudflare:** turn on Email Routing for the domain and route its addresses, or a catch-all, to the Worker. Cloudflare adds the MX records.
- **Docker and Node.js:** point the domain's MX record at your server's host name and forward port 25 to the built-in receiver (2525 by default).
- Port 25 must reach your server from the internet. Home connections and some hosting companies block it: ask yours, or receive through your sending provider’s inbound mail instead.
- Create the mailboxes before you change MX. If the domain receives mail somewhere else today, changing MX moves all of it.
- The domain page shows MX, SPF, DKIM and DMARC as they stand, and the tracking settings for that domain.

[Inbox guide](https://onesend.email/docs/inbox/) [Mail apps](https://onesend.email/docs/mail-clients/)

## The public URL

Booking pages, public Drive links, invitation answer links and calendar subscription links are opened by people outside your workspace, so they use your installation's public address.

- Set `ONESEND_PUBLIC_URL` to the HTTPS address people will use. On Cloudflare, add a custom domain to the Worker first.
- Set it before you share links: links already sent keep the address they were made with.
- Behind a reverse proxy, also set `ONESEND_TRUST_PROXY`, so limits such as wrong link passwords count each visitor's own address.

```bash
# Docker and Node.js: .env
ONESEND_PUBLIC_URL=https://mail.example.com

# Cloudflare: "vars" in apps/worker-cf/wrangler.jsonc
"ONESEND_PUBLIC_URL": "https://mail.example.com"
```

## The license key

The key is shown after payment and sent by email. Add it once; the server keeps it encrypted.

- In the dashboard under **Settings → License**, or with `ONESEND_LICENSE_KEY` before you deploy.
- To move it, choose Remove from this server on the old installation, then add it on the new one.
- The server checks its license every few days and keeps working for up to 30 days without a connection.
- Staging and test deployments that never deliver live email do not need their own key.

[License key reference](https://onesend.email/docs/self-hosting/#license-key)

## Updates

Every release of the self-hosted edition is included. Back up first, then update. Migrations run by themselves.

```bash
tar -xzf onesend-selfhost-<new>.tar.gz   # downloaded with your license key
cp onesend-selfhost-<old>/apps/worker-cf/wrangler.jsonc onesend-selfhost-<new>/apps/worker-cf/
cd onesend-selfhost-<new> && npm install
npm run cf:deploy   # prints a D1 restore point, then deploys
```

[Download](#download) the new release with your license key and unpack it next to the old one. Docker: copy `.env` across, then `docker compose up -d --build` (the data stays in its volume). Node.js: copy `.env` across (and the data folder, when it is inside the old one), then `npm install`, `npm run build:web` and restart.

[Upgrading](https://onesend.email/docs/self-hosting/#upgrading)

## Move data between databases

`npm run db:copy` copies every table between any pair of SQLite, PostgreSQL, PGlite and libSQL or Turso. Use it to grow from SQLite to PostgreSQL, or to move to a new server. It does not support D1 yet.

[Moving to another database](https://onesend.email/docs/self-hosting/#moving-to-another-database)

```bash
npm run db:copy -- --from <source-database-url> --to <target-database-url>
npm run db:copy -- --dry-run   # shows tables and row counts, writes nothing
```

## Before you go to production

### Keep the secret safe

Set `NODE_ENV=production` and a generated `ONESEND_SECRET` from a secret store. Back it up with the database: it encrypts provider keys.

### Put TLS in front

Run behind a reverse proxy with HTTPS, set the public URL, and configure TLS before exposing SMTP ingress or the mail-app ports.

### Create the owner first

On a fresh install the first account becomes the owner. The installer sets a one-time setup code, `ONESEND_SETUP_CODE`, so only you can create it.

## HTTPS for Docker and Node.js

The server speaks plain HTTP on port 3000. Put a reverse proxy in front for HTTPS. With Caddy it is three lines, and the certificate is issued and renewed for you. Then set `ONESEND_PUBLIC_URL` to the HTTPS address and `ONESEND_TRUST_PROXY=1`, and keep port 3000 closed to the internet. Cloudflare needs none of this.

```bash
# /etc/caddy/Caddyfile (Caddy gets the certificate by itself)
mail.example.com {
  reverse_proxy localhost:3000
}
```

[Full hardening checklist](https://onesend.email/security/policy/#hardening-checklist-for-self-hosted-installs)

## Reference

- [Cloudflare edition](https://onesend.email/docs/cloudflare/): bindings, limits, deploys, custom domains and what is not available.
- [Getting started](https://onesend.email/docs/getting-started/): run from source or Docker, connect a provider, send a first email.
- [Self-hosting reference](https://onesend.email/docs/self-hosting/): environment variables, databases, TLS, key rotation, backups and upgrades.
- [Troubleshooting](https://onesend.email/docs/troubleshooting/): common errors and how to fix them.
- [OneSend for Mac](https://onesend.email/mac/): a private inbox for the email accounts you already have, on your Mac. Sold separately, and it can connect to your server.

## Rather not run it yourself?

The hosted cloud runs the same platform for you. The waitlist is open.

[About the cloud](https://onesend.email/cloud/) [Read the docs](https://onesend.email/docs/)
