Open Source & Self-Hosted

All your email.
One beautiful home.

MailFlow is a self-hosted, open-source webmail client. Connect Gmail, iCloud, Outlook, and any IMAP server — then read everything in one fast, clean interface that runs entirely on your own server.

MIT License 2FA Included Docker Ready Self-Hosted
mailflow.mx
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
View pull request

Works with your favourite email providers

Gmail
iCloud Mail
Outlook
Fastmail
Any IMAP

Everything you need.
Nothing you don't.

Built for people who want full control over their email without sacrificing experience.

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 email stays on your server. No third-party clouds, no data harvesting, no subscriptions.

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.

From zero to inbox
in three steps.

No complex configuration. No ops expertise required.

01

Clone & configure

Grab the repo and fill in two secrets — a session key and a database password. Everything else has sensible defaults.

terminal
# Clone the repository
git clone https://github.com/maathimself/mailflow
cd mailflow

# Create your config file
cp .env.example .env
02

Launch with Docker

One command starts everything — the app, database, Redis, and a reverse proxy that handles HTTPS automatically.

terminal
# Build and start all services
docker compose up -d --build

# First build takes ~3 minutes
# Caddy handles TLS automatically
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        → App Password
iCloud Mail  → App-Specific Password
Outlook      → OAuth2 / App Password
Custom IMAP  → Any server

Built to protect
what matters most.

Your email contains your most sensitive communications. MailFlow was built with security in mind from day one — because when your inbox lives on your server, you deserve to know exactly how it's protected.

And because MailFlow is open source, you don't have to take our word for it. Read the code. Audit it yourself.

Read the 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
Open source & auditable Every line of code is public — no black boxes

Deploy in minutes.

A server with Docker installed is all you need. Caddy handles TLS certificates from Let's Encrypt automatically — no manual cert setup.

bash
# 1. Get the code
git clone https://github.com/maathimself/mailflow
cd mailflow

# 2. Configure — only two values required:
#    SESSION_SECRET  →  openssl rand -hex 32
#    DB_PASSWORD     →  openssl rand -hex 16
cp .env.example .env

# 3. Launch (first build ~3 min, then instant)
docker compose up -d --build

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