MailFlow, Selfhosted, Unified Webmail

goldfish85431 pts0 comments

MailFlow — Self-Hosted Unified Email

Open Source & Self-Hosted

All your email.

One beautiful home.

MailFlow is a self-hosted, open-source webmail client. Connect Gmail, iCloud,<br>Outlook, and any IMAP account — then read, search, and reply from one fast,<br>clean browser interface you control completely.

Get Started on GitHub

Explore features →

Free to Self-Host

2FA Included

Docker Ready

Self-Hosted

mailflow.sh

Inbox

Starred

Sent

Accounts

work@gmail

me@icloud

outlook

Search

GitHub<br>2m

PR #247 merged into main

Your pull request has been merged by...

Stripe<br>15m

Payout of $1,240 sent

Your payout is on its way to your bank...

Vercel<br>1h

Deployment succeeded

mailflow-prod is now live at...

Notion<br>3h

5 updates in your workspace

Team members have made changes to...

PR #247 merged into main

GitHub

[email protected]

View pull request

Works with your favourite email providers

Gmail

iCloud Mail

Outlook

Fastmail

Any IMAP

Everything you need.<br>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.

Gallery

See it in action.<br>Your inbox, your way.

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

mailflow.sh

Theme<br>Default dark theme

Click any screenshot to enlarge

Theme

Light theme

Theme

Catppuccin theme

Theme

Gruvbox theme

Compose

Compose

Interface

Collapsed sidebar

Settings

Account management

Interface

Folder navigation

Settings

Appearance settings

Settings

Layout options

From zero to inbox<br>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<br>git clone https://github.com/maathimself/mailflow<br>cd mailflow

# Create your config file<br>cp .env.example .env

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

# Build and start all services<br>docker compose up -d --build

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

Security

What's actually<br>under the hood.

Standard hardening out of the box — bcrypt passwords, rate-limited auth, HttpOnly<br>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<br>Cost factor 12 — resistant to brute-force attacks

TOTP two-factor authentication<br>Works with any TOTP app (Google Authenticator, Authy)

Rate-limited authentication<br>10 attempts per 15 minutes per IP address

Hardened session cookies<br>HttpOnly, Secure, SameSite=Lax — stored in Redis

HTML email sanitization<br>All email HTML sanitized before rendering — no XSS

TLS 1.2/1.3 only<br>Modern cipher suite, HSTS, and full security headers

Invite-only registration<br>Lock down your instance — only allow invited users

Open source & auditable<br>Every line of code is public — no black boxes

Quick Start

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

Copy

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

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

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

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

View full documentation →

Report an issue

Licensing

Free to...

mailflow email theme self docker inbox

Related Articles