All-in-one self-hostable domain service platform combining short links, disposable email inboxes, subdomain DNS management, file storage and an open API, with an admin panel.
hieunc229/mailflare
A self-hosted alternative to Google Workspace with custom-domain email, calendar, file drive, booking pages and AI agents, running on Cloudflare or Docker.
Open-source alternative to:Google Workspace
Microsoft 365
- Stars
- 5,737
- Forks
- 885
- Open issues
- 35
- Last commit
- 24 hours ago
What is it?
Mailflare is a self-hosted suite for running email and collaboration tools on your own domain. It bundles custom-domain mailboxes, routing rules, a calendar with email invitations, a public booking page, file storage and built-in AI agents that can search mail, draft replies and manage events.
The app runs as a Cloudflare Worker or as a single Docker container. Mail can be sent and received through Cloudflare Email Routing, Resend or Amazon SES, and files can be stored in Cloudflare R2, Backblaze B2 or AWS S3. The database can be Cloudflare D1, PostgreSQL, MySQL, Turso / libSQL or a local SQLite file, selected through the DATABASE_URL setting.
The interface is available in 34 languages, including Simplified Chinese, and the admin area covers users, API keys, webhooks, audit logs and backups. Existing mail can be imported from IMAP, Gmail Takeout, .eml and .mbox files.
Key features
- 01Custom-domain mailboxes with send and receive via Cloudflare, Resend or Amazon SES.
- 02Routing rules to store, forward, reject or sort incoming mail.
- 03Calendar with repeating events, time zones and email invitations.
- 04Public booking links that let others reserve time on your calendar.
- 05File drive with storage on R2, B2 or S3.
- 06AI agents that search mail and draft replies, with MCP support for other AI tools.
Use cases
- Running company email on your own domain without paying for Google Workspace seats.
- Hosting a small team's mail, calendar and shared files on Cloudflare Workers.
- Deploying a single-container self-hosted setup on a personal server with SQLite.
- Letting clients book meetings through a public calendar link.
Quick start
- 1
Clone the repository and install dependencies
- 2
Copy the local development env file and install packages
cp .dev.vars.example .dev.vars && npm install - 3
Run the local database migration and start the dev server
npm run db:migrate:local && npm run dev - 4
Open localhost:3000 and add your Cloudflare credentials to .dev.vars
Things to know
- Full deployment needs a Cloudflare account and a scoped CF_TOKEN API token.
- Sending mail through Cloudflare requires the $5/month Paid Worker plan; Resend or Amazon SES offer alternatives.
- New Amazon SES accounts start in a sandbox until AWS grants production access.
- License is AGPL-3.0, which requires sharing source code of modified versions run as a network service.
In collections
Topics
FAQ
- What is mailflare?
- A self-hosted alternative to Google Workspace with custom-domain email, calendar, file drive, booking pages and AI agents, running on Cloudflare or Docker. Mailflare is a self-hosted suite for running email and collaboration tools on your own domain. It bundles custom-domain mailboxes, routing rules, a calendar with email invitations, a public booking page, file storage and built-in AI agents that can search mail, draft replies and manage events.
- Is mailflare free to use? What license does it have?
- mailflare is open source under the AGPL-3.0 license. Check the license terms before using it in commercial products.
- Is mailflare still maintained?
- Actively maintained. The last commit to mailflare was on Nov 6, 2026.
- What can I use mailflare for?
- Running company email on your own domain without paying for Google Workspace seats. Hosting a small team's mail, calendar and shared files on Cloudflare Workers. Deploying a single-container self-hosted setup on a personal server with SQLite. Letting clients book meetings through a public calendar link.
- How do I install mailflare?
- Clone the repository and install dependencies Copy the local development env file and install packages: cp .dev.vars.example .dev.vars && npm install Run the local database migration and start the dev server: npm run db:migrate:local && npm run dev Open localhost:3000 and add your Cloudflare credentials to .dev.vars
- Where can I get mailflare?
- The source code and installation instructions are on GitHub: https://github.com/hieunc229/mailflare
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A self-hostable email service built on Cloudflare Workers, letting you create multiple mailboxes under one domain with sending, attachments and a responsive web UI.
Open-source groupware and CRM platform combining email, calendar, contacts, file sharing, invoicing and support ticketing, self-hosted or cloud.
Open-source notes and knowledge base app with a three-pane layout, instant multi-device sync, and built-in MCP for AI agents, runnable on Cloudflare or Docker.
A self-hosted team and personal knowledge base that runs entirely on Cloudflare Workers, D1 and R2, with a Memos-compatible API and MCP endpoints.
Self-hosted, cookie-free web analytics that deploys entirely into your own Cloudflare account, with no third-party services in the data path.