Best Self-Hosted Email Server in 2026: 12 Options Compared
I compared 12 self-hosted email servers, including mailcow, Stalwart, Mailu and Mox, on GitHub activity, RAM, Docker and ARM support, plus port 25 and DNS.
The best self-hosted email server for most people in 2026 is mailcow if your VPS has 6 GiB of RAM or more, Stalwart if you want one modern binary with JMAP and room to scale, and docker-mailserver or Mox on a small VPS. Mail-in-a-Box is still the easiest path for one domain on a fresh Ubuntu box. All are free and open source. None of them can fix outbound port 25 or sender reputation for you, and those decide whether your mail reaches an inbox.
I pulled GitHub data for every project on 30 November 2026 and checked each one’s official docs for RAM, components, Docker and ARM. This post covers mailbox servers. For newsletters and campaigns, see Best Open-Source Bulk Email Senders on GitHub.
TL;DR
- mailcow: the most complete package, with webmail, calendars and an admin UI. Needs 6 GiB RAM. Best for a small business.
- Stalwart: one Rust binary with SMTP, IMAP, JMAP, CalDAV and CardDAV. 43 releases in 12 months. Best for modern protocols or clustering.
- docker-mailserver: one container, configured with files and a CLI. Runs in 512 MB with ClamAV off.
- Mox: all-in-one Go server with webmail and MTA-STS built in. Starts at 512 MB, still versioned 0.0.x.
- Mailu: Docker images with a web admin and ARM builds. 1 GB RAM without antivirus.
- Mail-in-a-Box: one command on fresh Ubuntu 22.04, and it runs your DNS too.
- Postal is for sending app mail, not for mailboxes.
- If your host blocks outbound port 25 and won’t lift it, you need a relay whatever you pick.
GitHub activity compared (30 November 2026)
Collected with the gh CLI on 30 November 2026. Open issues exclude pull requests. Releases count published GitHub releases since 30 November 2025. Contributors include anonymous commit authors.
| Project | Stars | Open issues | Last commit | Latest release | Releases (12 mo) | License | Language | Contributors |
|---|---|---|---|---|---|---|---|---|
| docker-mailserver | 19,786 | 75 | 2026-11-26 | v17.0.0 (2026-11-05) | 3 | MIT | Shell | 376 |
| Postal | 16,992 | 51 | 2026-11-20 | 3.5.0 (2026-11-20) | 5 | MIT | Ruby | 56 |
| Stalwart | 16,626 | 26 | 2026-11-30 | v1.2.2 (2026-11-30) | 43 | AGPL-3.0 or SELv2 | Rust | 57 |
| Mail-in-a-Box | 15,485 | 548 | 2026-11-08 | v77 (2026-09-26) | 4 | CC0-1.0 | Python | 244 |
| mailcow-dockerized | 13,896 | 423 | 2026-11-19 | 2026-11b (2026-11-19) | 19 | GPL-3.0 | PHP | 393 |
| Mailu | 7,647 | 54 | 2026-11-29 | 2024.06.76 (2026-11-28) | 31 | MIT | Python | 268 |
| maddy | 6,145 | 84 | 2026-11-19 | v0.9.8 (2026-11-19) | 10 | GPL-3.0 | Go | 92 |
| Mox | 5,985 | 199 | 2026-10-27 | v0.0.17 (2026-08-19) | 2 | MIT | Go | 29 |
| Modoboa | 3,542 | 35 | 2026-11-27 | 2.13.1 (2026-11-25) | 18 | ISC | Python | 142 |
| WildDuck | 2,114 | 7 | 2026-11-25 | v1.55.3 (2026-11-02) | 50 | EUPL-1.2 | JavaScript | 53 |
| iRedMail | 1,859 | 5 | 2026-11-27 | tag 1.8.11 (2026-11-23) | 0 (tags only) | GPL-3.0 | Shell | 19 |
Mailu’s version looks old because it keeps shipping patch builds on its 2024.06 branch (31 in the past year). iRedMail publishes tags, not GitHub releases, so its “0” doesn’t mean idle. One project from old threads is dead: hardware/mailserver is archived, with its last commit on 1 November 2019.
What each server bundles and needs
RAM is the minimum each project states in its own docs. “Not stated” means I found no figure in official documentation.
| Project | Stated minimum RAM | Stack | Webmail | Admin UI | JMAP | Docker | ARM |
|---|---|---|---|---|---|---|---|
| mailcow | 6 GiB + 1 GiB swap | Postfix, Dovecot, Rspamd, ClamAV, SOGo, MariaDB, Redis | SOGo | Yes | No | Yes (only) | ARM64 |
| Stalwart | Not stated (default caches total ~2.4 GiB) | Single Rust binary, built-in spam filter | No | Yes | Yes | Yes | aarch64, ARMv7 |
| docker-mailserver | 512 MB (ClamAV off), 2 GB recommended | Postfix, Dovecot, Rspamd, Amavis, SpamAssassin, ClamAV, Fail2ban | No | No (CLI) | No | Yes (only) | arm64 images |
| Mox | 512 MB | Single Go binary | Yes | Yes | No | Possible, not recommended | arm64 build target |
| Mailu | 1 GB + 1 GB swap; 3 GB with ClamAV | Postfix, Dovecot, Rspamd, nginx, optional ClamAV | Roundcube or SnappyMail | Yes | No | Yes (only) | arm64, armv7 |
| Mail-in-a-Box | 512 MB, 1 GB recommended | Postfix, Dovecot, SpamAssassin, Roundcube, Nextcloud, nsd4 DNS | Roundcube | Yes | No | No | x86 only (tested) |
| iRedMail | 4 GB | Postfix, Dovecot, Amavisd, Roundcube or SOGo, iRedAdmin | Roundcube or SOGo | Yes (Pro is paid) | No | No | Not stated |
| Modoboa | 2 GB (to compile during install) | Postfix, Dovecot, Amavis or Rspamd, OpenDKIM, Radicale | Yes | Yes | No | No official image | Not stated |
| maddy | Not stated | Single Go daemon (IMAP storage is beta) | No | No | No | Yes | arm64 images |
| WildDuck | Not stated | Node.js, MongoDB, Redis, plus Haraka and ZoneMTA | No | API | No | Yes (amd64 only) | No (Docker) |
| Postal | 4 GB, 2 cores, 25 GB disk | Ruby, MariaDB 10.6+ | n/a (sending) | Yes | No | Yes (only) | amd64 images |
mailcow-dockerized
mailcow is a Docker Compose stack of about 18 containers: Postfix 3.10, Dovecot 2.3, Rspamd, ClamAV, SOGo, nginx, MariaDB, Redis and an ACME client for certificates. SOGo adds webmail, calendars, contacts and ActiveSync, and the admin UI covers domains, mailboxes, DKIM keys and quarantine.
The official prerequisites ask for “Minimum 6 GiB + 1 GiB swap”, 20 GiB of disk and x86_64 or ARM64, with 8 GiB recommended for 5 to 10 users. It needs a full VM like KVM: “Do not try to install mailcow on a Synology/QNAP device (any NAS), OpenVZ, LXC or other container platforms.” Setup is a clone, ./generate_config.sh and docker compose up -d, per the install guide.
It’s the closest thing to a self-hosted Google Workspace, and it ships monthly. The catch is RAM. The docs call ClamAV and the full-text search engine “greedy with RAM”; you can turn them off with SKIP_CLAMD and SKIP_FTS. It also has 423 open issues.
Stalwart
Stalwart is a Rust mail and collaboration server shipped as one binary. Its README lists JMAP, IMAP4rev2, POP3, SMTP, CalDAV, CardDAV and WebDAV, plus a built-in spam filter that can optionally use an LLM classifier. Storage defaults to embedded RocksDB and can move to PostgreSQL, MySQL, SQLite or FoundationDB, with S3-compatible blob storage. That’s why I’d pick it for Kubernetes or multiple nodes.
It runs on Linux (x86_64, aarch64, ARMv7, ARMv6), macOS, FreeBSD, Windows and Docker, per the get started page. The Docker guide uses stalwartlabs/stalwart:v1, and a setup wizard opens on port 8080. The requirements page gives no RAM minimum but notes the default limits “add up to about 2.4 GiB on a host with 2 GiB of memory”, so shrink the caches on a small VPS.
The catches: it’s dual-licensed under AGPL-3.0 and a proprietary enterprise license that carries extra features, and it moves fast (a release landed the day I checked). Read the upgrade notes before bumping versions.
docker-mailserver
docker-mailserver (DMS) is one container with Postfix, Dovecot, Rspamd, Amavis, SpamAssassin, ClamAV, Fail2ban and Postscreen. There’s no web UI and no database. You add accounts with docker exec -ti mailserver setup email add user@example.com and keep the rest in files, which suits a homelab kept in git.
The DMS FAQ recommends 1 vCore and 2 GB RAM, with 512 MB possible if ClamAV stays off (the default). ClamAV alone takes about 850 MB. Images cover amd64 and arm64, and there’s an active Helm chart.
It has the most stars here and only 75 open issues. You’ll add webmail yourself. My longer walkthrough is docker-mailserver: self-hosted mail server with Docker.
Mox
Mox does everything in one Go program: SMTP, IMAP4, webmail, an admin UI, SPF, DKIM, DMARC reports, MTA-STS, DANE, TLS-RPT and ACME certificates. Its junk filter learns from what users move in and out of Junk. No Postfix, no Dovecot.
The README says “You can start with a machine with 512MB RAM, any CPU will do.” Running ./mox quickstart you@example.com writes the config, creates the account and prints every DNS record you need, which prevents a lot of mistakes.
The catches: it’s still v0.0.17, and the README says “Mox is young, so don’t expect no bugs at all.” Docker works with host networking but isn’t recommended, and it runs on Unix systems only.
Mailu
Mailu is a set of Docker images with an nginx front container routing traffic to Postfix, Dovecot, Rspamd and an admin app. You pick Roundcube or SnappyMail and can add ClamAV, Radicale and Fetchmail. The setup generator writes your compose file.
The Compose requirements are 1 GB RAM plus 1 GB swap without antivirus, or 3 GB with ClamAV. Its build workflow targets amd64, arm64 and armv7, making it the best fit here for a Raspberry Pi, and there’s a Helm chart repo. GitHub shows its license as “NOASSERTION”, but the README says Mailu’s own code is MIT.
Mail-in-a-Box
Mail-in-a-Box turns a fresh Ubuntu 22.04 machine into a mail server with one command:
1
curl -s https://mailinabox.email/setup.sh | sudo -E bash
It installs Postfix, Dovecot, Roundcube, Nextcloud for contacts and calendars, Z-Push for ActiveSync, SpamAssassin, Fail2ban and duplicity backups. It also runs its own DNS server (nsd4) and publishes SPF, DKIM, DMARC, DNSSEC, DANE and MTA-STS records, so pointing your nameservers at it handles most of the DNS checklist below.
The setup guide asks for 512 MB RAM (1 GB recommended) on a machine “dedicated to Mail-in-a-Box”. The installer is only tested on x86_64 and i686. It’s opinionated, tied to one Ubuntu release, not Docker, and has the most open issues here (548).
iRedMail
iRedMail is a shell installer for Postfix, Dovecot, Amavisd, Roundcube or SOGo, and the iRedAdmin panel. Its install guide says “At least 4 GB memory is required” with spam and virus scanning on. Quarantine management, the REST API and other admin features are in the paid iRedAdmin-Pro, and upgrades are more manual than pulling an image.
Modoboa
Modoboa is a Django admin panel with webmail and calendar. The modoboa-installer sets up PostgreSQL or MySQL, nginx, Postfix, Dovecot, Amavis or Rspamd, OpenDKIM and Radicale, and needs 2 GB RAM to compile dependencies. The installer still calls itself beta, tested on Debian 12+ and Ubuntu 24.04+.
maddy
maddy “replaces Postfix, Dovecot, OpenDKIM, OpenSPF, OpenDMARC and more with one daemon.” Its own site labels IMAP storage “beta” and points to Dovecot for stability. No webmail or admin UI. I’d use it as an outbound relay or homelab MTA.
WildDuck
Per its install doc, “WildDuck itself is only an IMAP and POP3 server”, storing mail in sharded, replicated MongoDB. Haraka handles inbound SMTP and ZoneMTA outbound. It’s built for providers who need no single point of failure; overkill for one domain.
Poste.io
Poste.io is one Docker image (analogic/poste.io) with Haraka, Dovecot, Rspamd, ClamAV, webmail and admin. It isn’t open source like the rest. The free edition is “For personal use only” and PRO is $349 a year. The site also warns to upgrade to 2.5.26 because older versions “are affected by critical vulnerabilities”.
Postal (for sending, not mailboxes)
Postal calls itself “Sendgrid, Mailgun or Postmark but open source”: transactional mail for apps, not inboxes. It needs 4 GB RAM, 2 cores, 25 GB disk and MariaDB 10.6+ per its prerequisites. For volume sending, also see how to self-host BillionMail.
The hard truth: port 25 and deliverability
To deliver to Gmail or Outlook, your server must connect out on TCP port 25. Most clouds block it by default. This is what each provider’s own docs said on 30 November 2026.
| Provider | Outbound port 25 by default | How to get it opened | Custom PTR (rDNS) |
|---|---|---|---|
| AWS EC2 | Blocked to public IPv4 and IPv6 | Request removal through AWS’s form | Yes, on Elastic IPs (docs) |
| Google Cloud | Blocked to destinations outside your VPC (some projects exempt) | No request process documented | Yes, after domain verification (docs) |
| Azure | Open on Enterprise Agreement and MCA-E; blocked on other types | Enterprise Dev/Test can self-exempt; others are told to use a relay on 587 | Yes, via CLI or PowerShell (docs) |
| DigitalOcean | Blocked (25, 465 and 587) | No unblock process documented | Automatic, from the Droplet name |
| Hetzner Cloud | Blocked (25 and 465) | Limit request after one month and a paid first invoice | Yes, in the console (docs) |
| Linode / Akamai | Blocked on some accounts created after 5 Nov 2019 | Support ticket with your use case | Yes |
| Vultr | Blocked on new instances | Support ticket, reviewed case by case | Yes (docs) |
| Oracle Cloud | Blocked for tenancies created after 23 Jun 2021 | Service limits request | Oracle creates it via service request (docs) |
| OVHcloud Public Cloud | Blocked | Contact support | Yes |
| OVHcloud VPS | Docs disagree: the global guide says not blocked, the US VPS FAQ says blocked | Contact support | Yes |
DigitalOcean says outright: “we strongly recommend against running your own mail server.” On a Droplet, your options are another host or an authenticated relay on port 587. Even with port 25 open, a new IP has no reputation and may inherit a bad one, so check it against public blocklists before you build on it.
DNS checklist for a self-hosted mail server
- A/AAAA for your mail hostname, such as
mail.example.com. - MX for your domain pointing at that hostname.
- PTR (reverse DNS) for the server IP, set at your host, resolving back to
mail.example.com. Gmail and Yahoo require valid forward and reverse DNS. - SPF: a TXT record such as
v=spf1 mx -all. - DKIM: the TXT key your server generates. Gmail wants at least 1024 bits and recommends 2048.
- DMARC: TXT at
_dmarc, starting atp=noneand tightening once reports look clean. The current spec is RFC 9989 (May 2026), which obsoletes RFC 7489. - MTA-STS (RFC 8461): a
_mta-stsTXT record plus a policy file over HTTPS, so senders insist on TLS to you. - TLS-RPT (RFC 8460): a
_smtp._tlsTXT record for TLS failure reports.
1
2
3
4
5
6
example.com. MX 10 mail.example.com.
example.com. TXT "v=spf1 mx -all"
mail._domainkey TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkq..."
_dmarc.example.com. TXT "v=DMARC1; p=none; rua=mailto:dmarc@example.com"
_mta-sts.example.com. TXT "v=STSv1; id=20261130"
_smtp._tls.example.com. TXT "v=TLSRPTv1; rua=mailto:tlsrpt@example.com"
Mox prints these and Mail-in-a-Box publishes them. mailcow, Mailu and Stalwart show them in the admin UI.
What Gmail, Yahoo and Microsoft require
Gmail’s guidelines apply to every sender: SPF or DKIM, valid forward and reverse DNS, TLS, and a spam rate below 0.3%. Senders of about 5,000+ messages a day to Gmail also need SPF and DKIM, DMARC (p=none is enough), From-domain alignment and one-click unsubscribe on marketing mail. The Gmail FAQ dates enforcement from 1 February 2024 and says “Starting November 2025, Gmail is ramping up its enforcement on non-compliant traffic.”
Yahoo asks the same of all senders, and for bulk senders SPF and DKIM, a passing DMARC policy of at least p=none, and one-click unsubscribe (RFC 8058 POST recommended) honored within 2 days.
Microsoft announced that from 5 May 2025, domains sending over 5,000 messages a day to Outlook.com addresses must pass SPF and DKIM and publish DMARC. Its support page now covers rejections with error 550 5.7.515.
A personal server is nowhere near bulk volume, but the all-sender rules still apply. PTR and TLS are what self-hosters miss most.
Which self-hosted email server should you pick?
Homelab, one user or a family: Mox if you want webmail and an admin page included, docker-mailserver if you want everything in config files. Use a VPS rather than a home connection, where port 25 and IP reputation are harder to get right.
Small business, 5 to 50 users: mailcow on an 8 GB VM for shared calendars, contacts and ActiveSync. Mailu is lighter if you can skip SOGo’s groupware.
Privacy-first: Stalwart or Mox. Single binaries in memory-safe languages, fewer moving parts to audit, and MTA-STS support built in.
Low-RAM VPS (1 GB): Mox, docker-mailserver without ClamAV, Mail-in-a-Box, or Mailu without antivirus. Not mailcow, iRedMail or Postal.
Kubernetes or multi-node: Stalwart with PostgreSQL or FoundationDB and S3. docker-mailserver and Mailu have Helm charts. WildDuck if you’re building a provider.
When not to self-host email
Skip it if your host blocks port 25 with no unblock path and you don’t want a relay, or if mail is business-critical and nobody will watch the server. A full disk, an expired certificate or a blocklisted IP can stop mail for days unnoticed. If you want cold outreach or newsletters at volume, a mailbox server is the wrong tool; start from the email outreach hub. Self-hosting fits when you want control, have a clean IP with rDNS, and will check DMARC reports and blocklists regularly.
FAQ
What is the best self-hosted email server?
mailcow-dockerized if you have 6 GiB or more of RAM, since it bundles mail, spam filtering, antivirus, webmail and groupware. On smaller servers, docker-mailserver or Mox. For JMAP or clustering, Stalwart.
What is the best open source self-hosted email server?
Every mailbox server here except Poste.io is open source. In the year to 30 November 2026, Stalwart (43 releases), Mailu (31) and mailcow (19) shipped most often, and docker-mailserver has the most stars (19,786).
Can I run a self-hosted email server with Docker?
Yes. mailcow, docker-mailserver, Mailu and Postal are Docker-only, and Stalwart, maddy and Poste.io have official images. Mail-in-a-Box, iRedMail and Modoboa install on the OS directly.
How do I set up a self-hosted SMTP server?
Get a VPS with outbound port 25 open and a custom PTR, add A and MX records, install a server from this list, then add SPF, DKIM, DMARC, MTA-STS and TLS-RPT. For outbound app mail only, Postal or maddy as a relay is lighter.
How much RAM does a self-hosted mail server need?
512 MB for Mox, Mail-in-a-Box or docker-mailserver without ClamAV. Mailu needs 1 GB plus swap (3 GB with antivirus), iRedMail 4 GB, mailcow 6 GiB plus swap.
Is self-hosting email worth it in 2026?
Yes, if your host allows port 25, your IP is clean with reverse DNS, and you’ll do basic monitoring. You get full control and unlimited mailboxes for the price of a VPS. Not if you need guaranteed inbox placement with zero maintenance.
How I collected this data
GitHub figures come from the GitHub REST API via gh on 30 November 2026: repo stats, open issues via the search API (pull requests excluded), the latest commit on each default branch, non-draft releases since 30 November 2025, and contributors with anon=1. Requirements and components come from each project’s docs and repos, linked above. Port 25 policies and inbox provider rules come from vendor documentation read the same day. Stars and releases change weekly, so treat this as a snapshot. More guides are in the self-hosted automation hub, including how to self-host n8n.
