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 account — then read, search, and reply from one fast, clean browser interface you control completely.

MIT License 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 your favourite email providers

Gmail
iCloud Mail
Outlook
Fastmail
Any IMAP

Everything you need.
Nothing you don't.

Built for people who want a beautiful webmail experience without handing their inbox to a third party.

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, 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.

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

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

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 handled by Caddy.

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
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.