MailFlow brings together all your email accounts into one beautiful, fast interface. Self-hosted, secure, and entirely under your control.
Works with any IMAP/SMTP email provider
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.
Every account in a single, chronological feed. Stop switching tabs and start reading.
Gmail, iCloud, Outlook, Fastmail, or your own mail server. If it speaks IMAP, it works.
TOTP 2FA with Google Authenticator, Authy, or any compatible app. Your accounts stay yours.
Your webmail runs on your own server. No third-party clouds, no data harvesting.
Dark mode, light mode, multiple color schemes, typography controls, and flexible layouts.
Instant search across every connected account simultaneously, powered by PostgreSQL.
New mail appears the instant it arrives via WebSocket. No polling, no manual refresh.
Docker Compose gets you from zero to a running inbox in under five minutes.
Full WYSIWYG editor with font controls, text and highlight color, tables, emoji, links, and file attachments.
Messages grouped into reply chains. Sent replies appear inline so you never lose context.
Install MailFlow as an app on desktop or mobile. Push notifications work out of the box.
Full shortcut set for compose, navigation, and actions, all remappable per user. Plus a Cmd+K command palette.
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.
Automatic inbox tabs (Primary, Newsletters, Social, Notifications, and Other) sort incoming mail by type. An AI reclassify button fixes misdetections instantly.
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.
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 senders so their mail goes straight to trash. Mark messages as spam or not spam from the toolbar, context menu, or bulk actions.
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.
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.
MailFlow ships quality over velocity. This reflects what's in focus, updated as things move.
No dates, no commitments. Priorities shift as the community's needs become clear. Suggest something →
Flexible themes, layouts, and typography, all from one clean, fast interface.
Theme
Theme
Theme
Compose
Interface
Settings
Interface
Settings
Settings
No complex configuration. No ops expertise required.
Grab the compose file and fill in four secrets. No cloning or building required. Pre-built images are pulled automatically.
# 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
One command starts everything: the app, database, Redis, and nginx. Available on port 443 (self-signed HTTPS) and port 80 by default.
# Pull images and start all services
docker compose up -d
# Serves HTTPS:443 (self-signed) and HTTP:80 by default
Register the first user. They become admin automatically. Then connect your email accounts from the settings panel.
# 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
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 →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.
# 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.
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.
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.
Using MailFlow in a business? We ask businesses to buy a yearly license. It's how MailFlow stays maintained. Under the AGPL it isn't required, and nothing in MailFlow checks for it.
Renews yearly until you cancel. Cancel anytime. Need a quote or purchase order?
For teams that rely on MailFlow and want help keeping it running well. Includes a business license.
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
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.
For platforms where each customer runs their own MailFlow, such as app marketplaces.
Up to 5 client instances, covered by business licenses. Issues you open are looked at first.
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.
docker compose up -d. Full instructions are in the documentation.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
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.