Open source · Self-hosted · Privacy-first

All your email.
One beautiful home.

MailFlow brings together all your email accounts into one beautiful, fast interface. Self-hosted, secure, and entirely under your control.

Free to Self-Host 2FA Included Docker Ready Self-Hosted
mailflow.sh
Inbox 4
Starred
Sent
GitHub 2m
PR #247 merged into main
Your pull request has been merged by...
Stripe 15m
Payout of $1,240 sent
Your payout is on its way to your bank...
Vercel 1h
Deployment succeeded
mailflow-prod is now live at...
Notion 3h
5 updates in your workspace
Team members have made changes to...
PR #247 merged into main
G
GitHub
View pull request

Works with any IMAP/SMTP email provider

Gmail
iCloud Mail
Outlook
Fastmail
Any IMAP

Everything you need.
Nothing you don't.

Built for self-hosters, homelab users, and privacy-conscious teams. A modern alternative to Roundcube and Snappymail, beautiful webmail that stays on your own infrastructure.

Unified Inbox

Every account in a single, chronological feed. Stop switching tabs and start reading.

Any IMAP Server

Gmail, iCloud, Outlook, Fastmail, or your own mail server. If it speaks IMAP, it works.

Two-Factor Auth

TOTP 2FA with Google Authenticator, Authy, or any compatible app. Your accounts stay yours.

Fully Self-Hosted

Your webmail runs on your own server. No third-party clouds, no data harvesting.

Themes & Layouts

Dark mode, light mode, multiple color schemes, typography controls, and flexible layouts.

Full-Text Search

Instant search across every connected account simultaneously, powered by PostgreSQL.

Real-Time Sync

New mail appears the instant it arrives via WebSocket. No polling, no manual refresh.

One-Command Deploy

Docker Compose gets you from zero to a running inbox in under five minutes.

Rich Text Compose

Full WYSIWYG editor with font controls, text and highlight color, tables, emoji, links, and file attachments.

Conversation Threads

Messages grouped into reply chains. Sent replies appear inline so you never lose context.

Installable PWA

Install MailFlow as an app on desktop or mobile. Push notifications work out of the box.

Keyboard First

Full shortcut set for compose, navigation, and actions, all remappable per user. Plus a Cmd+K command palette.

Todoist Integration

Create Todoist tasks directly from emails with one click, with a deep link back to the original message. Link your account from the admin Apps tab.

Email Categorization

Automatic inbox tabs (Primary, Newsletters, Social, Notifications, and Other) sort incoming mail by type. An AI reclassify button fixes misdetections instantly.

AI Assistant

Connect any OpenAI-compatible provider: your own local model or a cloud API. Summarise long threads, draft replies, and ask questions about any message. Your mail stays on your server.

Inbox Rules

Automate actions based on sender, subject, recipient, headers, body, or attachments. Move, archive, delete, star, or mark read. Rules run the moment mail arrives.

Block List & Spam Feedback

Block senders so their mail goes straight to trash. Mark messages as spam or not spam from the toolbar, context menu, or bulk actions.

One-Click Unsubscribe

An unsubscribe button appears automatically in the message pane for detected newsletters. One click sends the unsubscribe request or opens the provider's unsubscribe page.

Send Later

Write now and choose when it goes. Your MailFlow server sends it at that time, even with the browser closed, and never sends it twice on its own.

Where we're headed.
Built in the open.

MailFlow ships quality over velocity. This reflects what's in focus, updated as things move.

Now
In active development
Next
Actively planned
Later
Longer horizon

No dates, no commitments. Priorities shift as the community's needs become clear. Suggest something →

See it in action.
Your inbox, your way.

Flexible themes, layouts, and typography, all from one clean, fast interface.

Light theme Theme
Catppuccin theme Theme
Gruvbox theme Theme
Compose window Compose
Collapsed sidebar Interface
Account management Settings
Folder navigation Interface
Appearance settings Settings
Layout options Settings

From zero to inbox
in three steps.

No complex configuration. No ops expertise required.

01

Download & configure

Grab the compose file and fill in four secrets. No cloning or building required. Pre-built images are pulled automatically.

terminal
# Download compose file and config template
curl -o docker-compose.yml https://raw.githubusercontent.com/maathimself/mailflow/main/docker-compose.ghcr.yml
curl -o .env               https://raw.githubusercontent.com/maathimself/mailflow/main/.env.example

# Fill in APP_URL, SESSION_SECRET, DB_PASSWORD, ENCRYPTION_KEY
02

Launch with Docker

One command starts everything: the app, database, Redis, and nginx. Available on port 443 (self-signed HTTPS) and port 80 by default.

terminal
# Pull images and start all services
docker compose up -d

# Serves HTTPS:443 (self-signed) and HTTP:80 by default
03

Add your accounts

Register the first user. They become admin automatically. Then connect your email accounts from the settings panel.

settings → accounts
# Supported providers
Gmail         → Google sign-in or App Password
iCloud Mail   → App-Specific Password
Outlook.com   → Microsoft sign-in, no setup
Microsoft 365 → Microsoft sign-in (own Entra app)
Custom IMAP   → Any server

What's actually
under the hood.

Standard hardening out of the box: bcrypt passwords, rate-limited auth, HttpOnly session cookies, HTML email sanitization, and TLS via self-signed cert or automatic Let's Encrypt with the built-in Caddy profile.

It's open source, so nothing is hidden. Read the code if you want to verify any of it.

View source →
bcrypt password hashing Cost factor 12, resistant to brute-force attacks
TOTP two-factor authentication Works with any TOTP app (Google Authenticator, Authy)
Rate-limited authentication 10 attempts per 15 minutes per IP address
Hardened session cookies HttpOnly, Secure, SameSite=Lax, stored in Redis
HTML email sanitization All email HTML sanitized before rendering, no XSS
TLS 1.2/1.3 only Modern cipher suite, HSTS, and full security headers
Invite-only registration Lock down your instance, only allow invited users
TOTP replay prevention One-time codes cannot be reused within their validity window
SSRF-safe host validation IMAP, AI, and subscription URLs are validated against private IP ranges before any connection is made
CSS exfiltration prevention External url() references are stripped from email style blocks at render time
Security response headers X-Frame-Options, Referrer-Policy, X-Content-Type-Options on every response
Open source & auditable Every line of code is public, no black boxes

Deploy in minutes.

A server with Docker installed is all you need. Works with a reverse proxy, or add automatic Let's Encrypt HTTPS with one extra flag.

bash
# 1. Download compose file and config template
curl -o docker-compose.yml https://raw.githubusercontent.com/maathimself/mailflow/main/docker-compose.ghcr.yml
curl -o .env               https://raw.githubusercontent.com/maathimself/mailflow/main/.env.example

# 2. Configure four required values in .env:
#    APP_URL         →  https://your-domain-or-ip
#    SESSION_SECRET  →  openssl rand -hex 32
#    DB_PASSWORD     →  openssl rand -hex 16
#    ENCRYPTION_KEY  →  openssl rand -hex 32

# 3. Launch (pre-built images, no build step)
docker compose up -d

Then open your server's address in a browser. The first account registered becomes admin.

Free to self-host.
Always.

MailFlow is free to self-host under the AGPL-3.0, for individuals and organizations alike. Businesses are asked to buy a yearly license to support development.

Open Source
Free
forever

Self-host for yourself, your family or your organization under the AGPL-3.0. If you modify MailFlow and offer it to others over a network, you share your changes under the same license.

  • All features included
  • Unlimited accounts
  • Full source code access
  • Community support
Get started on GitHub →
Business support
$600
per year · starting price · plus tax

For teams that rely on MailFlow and want help keeping it running well. Includes a business license.

  • Help with setup and upgrades
  • Microsoft 365 and Google Workspace sign-in setup
  • Priority answers on issues
  • A say in the roadmap
Get in touch →
Private modifications license $500 per installation · one-time · plus tax

For a business that modifies MailFlow and runs it without publishing its changes. Most businesses don't need it. One installation per license. Read the license

For hosting providers and MSPs

Offer MailFlow to your customers. Partners are listed on mailflow.sh as places to get MailFlow, and get an email before each security release with its date and severity. You support your customers, and we support you.

Hosting partner
Revenue share

For platforms where each customer runs their own MailFlow, such as app marketplaces.

MSP Starter
$500/year

Up to 5 client instances, covered by business licenses. Issues you open are looked at first.

MSP Partner
$1,200/year

Up to 20 client instances, plus a yearly review of your setup. More than 20? We'll quote.

MSP plans are billed through Paddle, plus tax. Need to run a modified MailFlow without publishing your changes? We'll quote custom terms.

Become a partner →

Why paid options? MailFlow is built and maintained by one person. The AGPL keeps it free for everyone who self-hosts it. Business licenses and support plans from the businesses that use MailFlow are what keep it maintained. Other questions? Open an issue or get in touch.

Frequently asked questions.

What is MailFlow?
MailFlow is a self-hosted unified email client that lets you connect Gmail, iCloud Mail, Outlook, and any IMAP server into one clean, modern interface. It runs entirely in Docker, is open source under AGPL-3.0, and keeps all your email data on your own server.
Is MailFlow free?
Yes. MailFlow is free to self-host under the AGPL-3.0 open source license, for personal and business use. Businesses that use MailFlow are asked to buy a business license, $100 per instance per year plus tax, to support development. It's voluntary. Business support plans start at $600 per year plus tax. A separate commercial license is only needed to run a modified MailFlow without publishing the changes.
Does MailFlow work with Gmail?
Yes. Gmail connects with Sign in with Google when your MailFlow admin has set it up under Settings → Email providers, or with a Google app password otherwise. Accounts with two-factor authentication are fully supported.
Does MailFlow work with Outlook or Hotmail?
Yes. Personal Outlook.com, Hotmail, Live, and MSN accounts connect with no setup: sign in with Microsoft using a short code, after turning on IMAP in Outlook.com. Work and school Microsoft 365 accounts sign in through your organization’s own Microsoft Entra app, which an admin sets up once in MailFlow.
Does MailFlow work with iCloud Mail?
Yes. MailFlow supports iCloud Mail via an App-Specific Password, which you generate in your Apple ID settings.
What are the system requirements for MailFlow?
MailFlow requires Docker Engine 24+ and Docker Compose v2. No other dependencies are needed. It runs on any Linux server, VPS, NAS, or home lab machine.
How do I install MailFlow?
Download the compose file and environment template, fill in four values (APP_URL, SESSION_SECRET, DB_PASSWORD, ENCRYPTION_KEY), and run docker compose up -d. Full instructions are in the documentation.
Is MailFlow secure?
Yes. MailFlow encrypts all stored email credentials at rest using AES-256, supports two-factor authentication, runs entirely on your own infrastructure, and never routes your email through third-party servers.
Can multiple users share a MailFlow instance?
Yes. MailFlow supports multiple users on a single instance. The first registered user becomes admin and can invite others, close public registration, or set up Single Sign-On via OIDC.
How is MailFlow different from Roundcube or Snappymail?
MailFlow is a modern, Docker-native email client with a unified inbox for multiple accounts simultaneously, real-time IMAP sync, a built-in AI assistant, inbox rules, and a React-based interface. Roundcube and Snappymail are traditional single-account webmail clients built on older architectures.

Would you use
hosted MailFlow?

There's no hosted version of MailFlow today, and no launch date. If you would use one, leave your email. We may ask what you need, and we'll tell you if it happens.

Only emails about hosted MailFlow. Unsubscribe anytime. Privacy policy

Supported by the community

MailFlow is free to self-host, forever, and built and maintained by one person. If it saves you time or money, consider supporting continued development.