Self-host Stalwart Mail Server
v1.0.3Rust all-in-one mail and groupware server with anti-spam
- Stars
- 15 817
- Ports
- 443 (HTTPS: web admin, JMAP and client APIs, ACME TLS-ALPN-01 challenges), 8080 (HTTP configuration/admin listener used for the setup wizard and recovery mode), 25 (SMTP), 587 (SMTP submission), 465 (SMTPS (implicit TLS submission)), 143 (IMAP), 993 (IMAPS), 110 (POP3), 995 (POP3S), 4190 (ManageSieve)
stalwartlabs/stalwartWhat is Stalwart Mail Server?
Stalwart, from Stalwart Labs, is an open-source groupware and email platform written in Rust that folds the MTA, message store, junk-mail filter, calendar, contacts and shared-file server into a single product. Clients keep working over what they already speak: JMAP for new apps, IMAP4 and POP3 for legacy mail, SMTP for delivery, and CalDAV, CardDAV and WebDAV (plus their JMAP equivalents) for collaboration. Sender authentication and transport security are handled internally through DKIM, SPF, DMARC and ARC, DANE, MTA-STS and TLS reporting, with ACME renewing certificates automatically and DKIM keys generated, rotated and published for you. Junk mail is stopped at SMTP time by a self-training statistical classifier with DNSBLs, Pyzor digests, greylisting, spam traps, sender-reputation tracking and optional LLM-assisted analysis; SpamAssassin or Rspamd can be attached over milter instead. Data lives wherever you want it: RocksDB, SQLite, PostgreSQL, MySQL or FoundationDB for records, S3 or Azure Blob for attachments, Redis for shared cache, and full-text search either through the internal engine or an external index service such as Meilisearch, Elasticsearch or OpenSearch (a SQL store can also serve this role). Clustering works peer-to-peer by default, though a coordinator-based setup using a message broker or Redis is also offered, so a hosting provider can grow to millions of mailboxes while a small box with a couple of GB runs a household domain; mailboxes can additionally be encrypted at rest with each user's OpenPGP or S/MIME key. A web admin (reached at /admin, with a five-screen first-run wizard), a CLI, SCIM provisioning, LDAP/OIDC/SQL directories and 2FA cover operations. Self-hosting is via a shell installer on Linux/macOS/FreeBSD, a zip-built Windows service, or the multi-architecture container image. The Community build is free under AGPL-3.0 with no mailbox cap; an Enterprise edition under the SELv2 licence is sold per mailbox, and the server is still on 0.x releases before its planned 1.0.
Stalwart Mail Server alternatives
docker-mailserverSelf-hosted, open-source mail server image (Postfix, Dovecot, Rspamd, ClamAV, Fail2ban) with SMTP, IMAP, LDAP and OAuth2 login, configured by files only.Comparedocker-mailserver with Stalwart Mail Server
MoxOpen-source, self-hosted all-in-one email server with SMTP, IMAP4, webmail, junk filtering and automatic ACME TLS, set up for your own domain via quickstart.CompareMox with Stalwart Mail Server
MailFlowA self-hosted webmail app that merges multiple email accounts into one inbox with real-time sync, AI features, and offline-capable PWA.CompareMailFlow with Stalwart Mail Server
mailcueMailCue is a self-hosted, open-source email testing server with Postfix, Dovecot, DKIM, DMARC, SpamAssassin, REST API, and React UI in one Docker container.Comparemailcue with Stalwart Mail Server
Hermes-Secure-Email-GatewaySelf-hosted email security gateway and mail server with spam filtering, encryption, DKIM/DMARC/ARC, Dovecot mailboxes, Nextcloud, and Authelia SSO in one Docker stack.CompareHermes-Secure-Email-Gateway with Stalwart Mail Server
Mail-in-a-BoxOpen-source, self-hosted mail server appliance: one script turns a fresh Ubuntu 22.04 VPS into a full mail stack with webmail, spam filtering, DNS and a control panel.CompareMail-in-a-Box with Stalwart Mail Server
rms-mail-publicSelf-hosted email with instant search on 100K+ emails, native AI, MCP server, Telegram bot, and browser-first architecture scaling from Raspberry Pi to enterprise.Comparerms-mail-public with Stalwart Mail Server
LanQin EmailLanQin Email is an open-source self-hosted webmail with multi-domain support, DKIM, anti-spam, and single-container Docker deployment.CompareLanQin Email with Stalwart Mail Server
Should you self-host Stalwart Mail Server?
Stalwart Mail Server scores 79/100 on selfhost.directory (how scoring works) and ranks #1 of 16 in Mail Server. It has 15 817 GitHub stars, +849 in the last 30 days.
It shipped 33 stable releases in the past year. The latest, v1.0.3, came out on 4 November 2026. New versions land roughly every 7 days.
Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is AGPL-3.0-only AND LicenseRef-SEL-licensed and written mostly in Rust.
Its closest alternative on selfhost.directory is docker-mailserver (78/100, 19 735 stars). Stalwart Mail Server scores higher overall. See Stalwart Mail Server vs docker-mailserver side by side.
Features
- Automatic TLS certificates (ACME)
- Built-in spam and phishing filter
- CalDAV
- CardDAV
- Clustering and high availability
- Encryption at Rest
- Full-text search in 17 languages
- IMAP
- JMAP
- Multi-tenancy
- POP3
- Sieve scripting
- SMTP server (MTA)
- Web-based administration
- WebDAV file storage and sharing
Stalwart Mail Server README
FAQ
What encryption methods are supported?
Two: PGP (AES256 or AES128 symmetric encryption) and S/MIME (AES256-CBC or AES128-CBC).
Is encryption at rest enabled by default?
It is enabled by default but only becomes active once the user uploads their S/MIME certificate or PGP public key; it can be turned off via the email.encryption.enable attribute.
What is encryption at rest?
It automatically encrypts plain-text messages with the user's PGP key or S/MIME certificate before they are written to disk.
Is greylisting supported?
Yes, greylisting can be implemented as a Sieve filter, with an example in the Sieve documentation.
Does it support relay hosts?
Yes, outbound relay hosts are supported for sending mail to external domains.
How is anti-spam handled?
A built-in filter using the FTRL-Proximal algorithm and feature hashing, plus DNSBLs and Pyzor, with optional milter integration to SpamAssassin or Rspamd.
How do I backup my data?
For external databases use their own backup procedures; for embedded stores like RocksDB or SQLite, copying /var/lib/stalwart gives a full backup.
How can I migrate from another server?
Stalwart ships a command line interface for migrating data from an earlier Stalwart version or from third-party mail servers.
How do I add a new domain?
Domains are created from the web admin regardless of directory backend and stored as a Domain object with per-domain settings for recipient resolution, DKIM signing, TLS issuance and DNS publication.
How do I create and manage users?
With the internal directory you create and manage accounts in the web admin; with an external directory such as LDAP or SQL you use that directory's own tools.
Does it have a web interface?
Yes, a browser-based interface lets users manage their accounts, settings and preferences.
Can it handle large volumes of users and emails?
Yes — with FoundationDB as the backend it can scale to millions of users without sacrificing performance.
Where is my data stored?
That depends on the storage backend you configure; the storage documentation covers the options.
Is my data safe?
Stalwart stores data on proven database systems such as RocksDB, FoundationDB and PostgreSQL, and every release is put through extensive stress testing before shipping.
Can Stalwart be used in production?
Yes — it runs in production systems worldwide with no reported data loss or crashes, but it is still on a 0.x version, so data layout and configuration may change before 1.0 and migrations could be needed.
More in Mail Server
wildduckWildDuck is a self-hosted, open-source IMAP/POP3 mail server backed by sharded MongoDB, with stateless instances, 2FA and full REST API control.
b1gMailOpen-source PHP email-service platform: webmail plus address book, calendar, tasks, notes, cloud drive, smart folders, filters and spam protection, managed via a web ACP.
billion-mailSelf-hosted open-source mail server and email marketing platform: Postfix, Dovecot and Rspamd with web admin, campaigns, analytics and Roundcube webmail.- chasquidA simple, secure, and easy-to-operate SMTP email server designed for individuals and small groups, written in Go.
Courier MTACourier Mail Server is a self-hosted, integrated mail/groupware server that provides ESMTP, IMAP, POP3, webmail, and mailing list services using open commodity protocols like LDAP, SSL, and HTTP.
Cyrus IMAPSelf-hosted open-source IMAP server with CalDAV calendars, CardDAV contacts, and JMAP access. Production-ready since 1993.
docker-mailserverSelf-hosted, open-source mail server image (Postfix, Dovecot, Rspamd, ClamAV, Fail2ban) with SMTP, IMAP, LDAP and OAuth2 login, configured by files only.
DovecotSelf-hosted open-source IMAP/POP3 mail server for Linux with LMTP, ManageSieve, LDAP/PAM/OAuth2 auth, Sieve filtering, full-text search and official Docker images.
emailwizSelf-hosted mail server installer: one script sets up Postfix, Dovecot, SpamAssassin, OpenDKIM and fail2ban on Debian/Ubuntu and emits DKIM, SPF and DMARC records.- EximExim is a message transfer agent (MTA) developed at the University of Cambridge for use on Unix systems connected to the Internet. It is freely available under the terms of the GNU General Public License.
HarakaA self-hosted, open-source Node.js SMTP server with a JavaScript plugin system: filtering MTA or submission host with DKIM signing, DNSBL checks and virus scanning.
Hermes-Secure-Email-GatewaySelf-hosted email security gateway and mail server with spam filtering, encryption, DKIM/DMARC/ARC, Dovecot mailboxes, Nextcloud, and Authelia SSO in one Docker stack.
0 comments