Stalwart vs Mailu: Self-Hosted Email Compared
Quick Verdict
Stalwart started as a lean JMAP server and has become a full-featured all-in-one mail server written in Rust — one container, one binary, built-in spam filtering, full-text search, and CalDAV/CardDAV. Mailu wraps proven components (Postfix, Dovecot, Rspamd, SnappyMail) into a multi-container Docker stack with a web admin and setup wizard. For a personal mail server with 1-10 users, Stalwart wins on simplicity and resource efficiency. For a shared mail server that needs battle-tested components and a familiar webmail interface, Mailu is the more established choice.
Overview
Stalwart is a modern mail server written entirely in Rust. It runs as a single binary with embedded RocksDB storage — no external database, no Redis, no separate SMTP/IMAP daemons. Stalwart supports JMAP, IMAP, POP3, SMTP, CalDAV, CardDAV, and includes built-in spam filtering (with sieve support), DKIM signing, ARC, DMARC, full-text search, and encryption at rest. Configuration is done via a web admin UI or TOML files. Official site.
Mailu is a Docker-based mail server built from well-known open-source components: Postfix (SMTP), Dovecot (IMAP/POP3), Rspamd (spam), ClamAV (antivirus, optional), SnappyMail or Roundcube (webmail), and a custom Python admin interface. It uses a setup wizard at setup.mailu.io to generate your docker-compose.yml and mailu.env files. Mailu has been around since 2016 and is one of the most popular self-hosted mail solutions. Official site.
Feature Comparison
| Feature | Stalwart | Mailu |
|---|---|---|
| Architecture | Single Rust binary, one container | 5-8 Docker containers (Postfix, Dovecot, Rspamd, etc.) |
| SMTP | Built-in | Postfix |
| IMAP | Built-in | Dovecot |
| POP3 | Built-in | Dovecot |
| JMAP | Yes (full support) | No |
| CalDAV/CardDAV | Built-in | WebDAV via Radicale (optional) |
| Webmail | None built-in (use any IMAP client) | SnappyMail or Roundcube included |
| Admin UI | Web-based admin panel | Web-based admin panel |
| Spam filtering | Built-in (sieve rules, DNS blocklists) | Rspamd (industry-standard) |
| Antivirus | None built-in | ClamAV (optional, adds 2 GB RAM) |
| DKIM/SPF/DMARC | Built-in | Built-in (via Rspamd + Postfix) |
| Full-text search | Built-in (RocksDB FTS) | Dovecot Solr plugin (optional) |
| Encryption at rest | Built-in, per-user keys | Not included |
| Database | Embedded RocksDB (no external DB) | SQLite by default, PostgreSQL optional |
| Setup wizard | Web admin wizard on first launch | setup.mailu.io generates config files |
| License | AGPL-3.0 | MIT |
| Language | Rust | Python (admin) + C (Postfix/Dovecot) |
Installation Complexity
Stalwart deploys as a single container:
services:
stalwart:
image: stalwartlabs/stalwart:v0.15.5
container_name: stalwart
ports:
- "25:25"
- "465:465"
- "587:587"
- "143:143"
- "993:993"
- "4190:4190"
- "8080:8080"
volumes:
- stalwart-data:/opt/stalwart
restart: unless-stopped
volumes:
stalwart-data:
Open http://your-server:8080 → web setup wizard walks you through domain, admin account, and TLS. One container. Done.
Mailu requires generating config from the setup wizard, then deploying 5+ containers:
# Generated by setup.mailu.io — simplified example
services:
front:
image: mailu/nginx:2024.06.48
ports:
- "25:25"
- "80:80"
- "443:443"
- "465:465"
- "587:587"
- "993:993"
volumes:
- mailu-certs:/certs
- mailu-overrides:/overrides
env_file: mailu.env
restart: unless-stopped
admin:
image: mailu/admin:2024.06.48
volumes:
- mailu-data:/data
- mailu-dkim:/dkim
env_file: mailu.env
restart: unless-stopped
imap:
image: mailu/dovecot:2024.06.48
volumes:
- mailu-mail:/mail
env_file: mailu.env
restart: unless-stopped
smtp:
image: mailu/postfix:2024.06.48
volumes:
- mailu-mailqueue:/queue
env_file: mailu.env
restart: unless-stopped
antispam:
image: mailu/rspamd:2024.06.48
volumes:
- mailu-filter:/var/lib/rspamd
env_file: mailu.env
restart: unless-stopped
webmail:
image: mailu/webmail:2024.06.48
volumes:
- mailu-webmail:/data
env_file: mailu.env
restart: unless-stopped
redis:
image: redis:7-alpine
volumes:
- mailu-redis:/data
restart: unless-stopped
volumes:
mailu-certs:
mailu-data:
mailu-dkim:
mailu-mail:
mailu-mailqueue:
mailu-filter:
mailu-webmail:
mailu-overrides:
mailu-redis:
Plus a mailu.env file with 20+ environment variables for domain, secrets, TLS, and component configuration.
Winner: Stalwart. One container vs 7+ containers. One volume vs 9 volumes. No external env file. Stalwart’s simplicity advantage is dramatic.
Performance and Resource Usage
| Metric | Stalwart | Mailu (without ClamAV) | Mailu (with ClamAV) |
|---|---|---|---|
| RAM (idle, 1-5 users) | 100–200 MB | 500–800 MB | 2–3 GB |
| RAM (50 users) | 200–500 MB | 800 MB–1.5 GB | 3–4 GB |
| Containers | 1 | 6-7 | 7-8 |
| Disk (base install) | ~100 MB | ~500 MB | ~1.5 GB |
| Startup time | 2-3 seconds | 15-30 seconds (all containers) |
Stalwart’s Rust-based architecture gives it a significant resource advantage. A small VPS with 1 GB RAM can comfortably run Stalwart with room for other services. Mailu needs at least 2 GB without antivirus, 4 GB with ClamAV enabled.
Spam Filtering
Mailu uses Rspamd, which is the industry standard for self-hosted spam filtering. Rspamd has been battle-tested for years, has extensive documentation, and integrates with ClamAV for attachment scanning. It supports Bayesian filtering, fuzzy hashing, neural networks, and dozens of built-in modules.
Stalwart’s built-in spam filtering uses DNS blocklists, sieve rules, SPF/DKIM/DMARC validation, and configurable scoring. It is effective for personal use but less sophisticated than Rspamd. If you receive high spam volumes or need fine-grained control, Mailu’s Rspamd is stronger.
Winner: Mailu. Rspamd is more mature and configurable for spam filtering.
Webmail
Mailu includes a webmail client (SnappyMail or Roundcube) accessible at your mail domain. No additional setup required — log in and read email from a browser.
Stalwart does not include a webmail client. You use it with any IMAP client (Thunderbird, Apple Mail, FairEmail) or connect a separate webmail like Roundcube or SnappyMail yourself. This is a deliberate design choice — Stalwart focuses on being a mail server, not a web application.
If browser-based email access is important, Mailu has it out of the box. With Stalwart, you add it yourself or use desktop/mobile IMAP clients.
Community and Ecosystem
| Dimension | Stalwart | Mailu |
|---|---|---|
| GitHub stars | ~6,000 | ~6,000 |
| First release | 2022 | 2016 |
| Development pace | Very active (weekly releases) | Moderate (quarterly releases) |
| Documentation | Good (stalw.art/docs) | Good (mailu.io/docs) |
| Community forum | GitHub Discussions | GitHub Issues |
| Production users | Growing | Thousands |
Mailu has 8 years of production history. Many guides, blog posts, and community answers exist for common Mailu problems. Stalwart is newer but developing rapidly — it shipped JMAP, CalDAV, CardDAV, and encryption at rest in its first two years.
Use Cases
Choose Stalwart If…
- You want a single-container mail server with minimal maintenance
- You run a personal or small-team mail server (1-20 users)
- You want JMAP support (modern email API, faster than IMAP)
- Built-in CalDAV/CardDAV matters (contacts and calendar without extra containers)
- You are comfortable using IMAP clients and don’t need built-in webmail
- You run on a small VPS with limited RAM (1-2 GB)
Choose Mailu If…
- You want built-in webmail accessible from any browser
- You need mature, battle-tested spam filtering (Rspamd)
- ClamAV antivirus scanning matters for your use case
- You host email for multiple domains with many users
- You prefer a setup wizard that generates your entire configuration
- You want a proven solution with 8 years of community support
Final Verdict
If you want minimal infrastructure and maximum performance, Stalwart is the right tool. One container, Rust-native performance, and built-in features that Mailu distributes across 7 containers. It is the better choice for personal email and small teams.
If you want a complete email platform with webmail, proven spam filtering, and optional antivirus — and you have 2-4 GB of RAM to spare — Mailu delivers a more traditional, feature-complete experience. Eight years of production usage means most problems are documented and solved.
Both require the same DNS setup (MX, SPF, DKIM, DMARC, PTR records). Self-hosting email is hard regardless of which server you choose. The server software is the easy part — deliverability is the hard part.
FAQ
Can I add webmail to Stalwart?
Yes. Deploy SnappyMail or Roundcube as a separate container and point it at Stalwart’s IMAP/SMTP ports. It works but requires manual setup — Mailu includes this out of the box.
Which has better email deliverability?
Deliverability depends on DNS configuration, IP reputation, and authentication (SPF, DKIM, DMARC) — not the mail server software. Both Stalwart and Mailu support all required authentication protocols. Your server’s IP address and PTR record matter far more than the MTA.
Can Mailu run without ClamAV?
Yes. ClamAV is optional. Without it, Mailu needs about 1-2 GB of RAM instead of 3-4 GB. Most personal mail servers skip ClamAV since modern email clients handle malware scanning.
Is JMAP worth it?
JMAP (JSON Meta Application Protocol) is faster and more efficient than IMAP for synchronization. If your email client supports it (e.g., Thunderbird 128+), JMAP means faster sync and lower bandwidth. If your clients only support IMAP, it doesn’t matter — Stalwart supports both.
Which is easier to migrate to?
Both support standard IMAP import. Moving from one to the other means exporting via IMAP and importing on the new server. Mailu has community-contributed migration scripts for common scenarios.
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