Mailu vs Stalwart: Self-Hosted Email Compared
Stalwart is the faster, leaner, more modern option. Mailu is the more complete, easier-to-configure option. Which matters more depends on your email hosting goals.
Overview
Mailu is an integrated email suite built from established components — Postfix for SMTP, Dovecot for IMAP, Rspamd for spam filtering, and a web admin panel tying them together. It’s been around since 2016 and follows the traditional email server stack approach, wrapping everything in Docker containers with a guided setup wizard.
Stalwart is a from-scratch email server written in Rust, designed as a single binary that handles SMTP, IMAP, JMAP, and spam filtering without external dependencies. It’s newer (active development since 2023) and represents the “modern rewrite” approach to email hosting — one process, one config, no component orchestration.
Feature Comparison
| Feature | Mailu | Stalwart |
|---|---|---|
| SMTP | Postfix | Built-in (Rust) |
| IMAP | Dovecot | Built-in (Rust) |
| JMAP | No | Yes |
| Web admin | Yes (Flask-based) | Yes (built-in) |
| Webmail | Roundcube/Rainloop (bundled) | No (use any IMAP client) |
| Spam filter | Rspamd (integrated) | Built-in sieve + SpamAssassin-compatible |
| DKIM/SPF/DMARC | Automatic setup | Automatic setup |
| Setup wizard | Yes (web-based) | Manual config (TOML/YAML) |
| Architecture | 6-8 containers | Single binary/container |
| Storage backend | Filesystem (Maildir) | RocksDB, SQLite, PostgreSQL, S3 |
| Full-text search | Solr (optional) | Built-in (FTS) |
| CalDAV/CardDAV | Radicale (optional) | Yes (built-in) |
| Multi-domain | Yes | Yes |
| Clustering | No | Yes (multi-node) |
| Language | Python + C (Postfix/Dovecot) | Rust |
| License | MIT | AGPL-3.0 |
Setup Complexity
Mailu wins on initial setup. Run the setup wizard at https://setup.mailu.io, answer questions about your domain and configuration, and it generates a complete docker-compose.yml and .env file. Deploy and configure DNS records — you’re running email in under an hour.
The trade-off: Mailu runs 6-8 Docker containers (front, admin, imap, smtp, antispam, webmail, plus optional components). Each is a separate process with its own config, logs, and resource consumption. Debugging issues means understanding which component is misbehaving — is it Postfix rejecting connections, Dovecot failing auth, or Rspamd flagging legitimate mail?
Stalwart requires manual configuration — write a TOML file defining your domains, users, TLS certificates, and storage backend. No wizard, no pre-generated config. But the payoff: everything runs in one process. One log stream, one config file, one binary to update. When something breaks, there’s exactly one place to look.
Performance and Resource Usage
| Metric | Mailu | Stalwart |
|---|---|---|
| RAM (idle, single domain) | 400-600MB | 50-100MB |
| RAM (1000 mailboxes) | 800MB-1.2GB | 150-300MB |
| CPU (idle) | Higher (multiple processes) | Minimal |
| Disk (base install) | ~1GB | ~50MB |
| Container count | 6-8 | 1 |
| Startup time | 30-60 seconds | 2-3 seconds |
Stalwart’s resource advantage is dramatic. A Rust single-binary architecture versus a multi-container stack of C, Python, and Lua processes. On a 2GB RAM VPS, Stalwart leaves room for other services. Mailu on the same VPS leaves you watching memory usage nervously.
Spam Filtering
Mailu integrates Rspamd — one of the most sophisticated spam filters available. It includes machine learning classification, neural network analysis, DKIM/SPF/DMARC verification, rate limiting, greylisting, and per-user Bayes training. Rspamd is battle-tested across millions of mailboxes.
Stalwart has built-in spam filtering with Sieve scripts, DNS blocklists, SPF/DKIM/DMARC verification, and reputation scoring. It’s functional but less sophisticated than Rspamd. For high-volume or spam-heavy environments, Mailu’s Rspamd integration is meaningfully better.
Community and Ecosystem
Mailu has a larger community (8,000+ GitHub stars), more documentation, more guides online, and more people who’ve solved your specific problem on forums. The component-based architecture means you can swap parts — don’t like Roundcube? Use SOGo or remove webmail entirely.
Stalwart has a smaller but growing community (5,000+ GitHub stars). Documentation is good but fewer third-party guides exist. The single-binary approach means less flexibility in component choice — but also fewer components to configure.
Use Cases
Choose Mailu If…
- You want a guided setup wizard that generates working config
- You need built-in webmail (Roundcube)
- Spam filtering quality is critical (Rspamd is hard to beat)
- You want a proven, well-documented stack with a large community
- You’re comfortable with Docker multi-container deployments
Choose Stalwart If…
- You want minimal resource usage (ideal for small VPS or Pi)
- You prefer a single process/container over a multi-component stack
- You need JMAP support (modern email API)
- You want built-in CalDAV/CardDAV without extra containers
- You need clustering/multi-node email hosting
- You prefer Rust’s reliability and performance characteristics
Final Verdict
For most first-time self-hosted email setups, Mailu is the better starting point. The setup wizard eliminates configuration guesswork, Rspamd catches more spam, bundled webmail means one fewer thing to configure, and the documentation ecosystem is more mature.
Choose Stalwart if resource efficiency matters — running email on a 1GB VPS, alongside other services on a shared server, or on a Raspberry Pi. Stalwart does more with dramatically less. It’s also the better choice for anyone who wants JMAP (the modern IMAP replacement) or needs clustering for multi-node deployments.
Both are actively maintained and improving. Stalwart is the newer project with more momentum; Mailu is the established player with more real-world deployments.
FAQ
Can I migrate from Mailu to Stalwart later?
Yes. Email data is stored in standard formats. Export mailboxes from Dovecot (Mailu) using doveadm and import into Stalwart via IMAP migration tools. DNS records (MX, SPF, DKIM, DMARC) remain the same — just update where they point.
Does Stalwart include webmail?
No. Stalwart provides IMAP/JMAP/SMTP — you connect any email client (Thunderbird, Apple Mail, K-9 Mail) or deploy a separate webmail like Roundcube or Snappymail. This keeps Stalwart lean but means one more component to set up if you want browser-based email.
Which has better deliverability?
Deliverability depends on your DNS setup (SPF, DKIM, DMARC), IP reputation, and sending practices — not the mail server software. Both Mailu and Stalwart handle DKIM signing and SPF verification. Your deliverability will be identical if configured correctly.
Is self-hosted email worth the effort?
It depends on your tolerance for maintenance. Self-hosted email requires managing DNS records, monitoring deliverability, handling spam filtering, and ensuring uptime. If email goes down, you miss messages. For a personal domain or small team, it’s rewarding. For a business that depends on email reliability, consider whether the control is worth the operational burden.
Related
Get self-hosting tips in your inbox
Get the Docker Compose configs, hardware picks, and setup shortcuts we don't put in articles. Weekly. No spam.
Comments