Open-source alternatives to Gmail
The most popular self-hosted, open-source alternatives to Gmail (email hosting) are docker-mailserver (19,616 GitHub stars), Postal (16,873 GitHub stars) and Mail-in-a-Box (15,441 GitHub stars). SelfHostHub lists 12 options below, taken from its Complete Solutions category; 8 support Docker and all of them can run on your own server.
Comparison of self-hosted Gmail alternatives
| Project | GitHub stars | Licence | Language / platform | What it does |
|---|---|---|---|---|
| docker-mailserver | 19,616 | MIT | Docker | Production-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) running inside a container. Only configuration files, no SQL database. |
| Postal | 16,873 | MIT | Docker, Ruby | Complete and fully featured mail server for use by websites & web servers. |
| Mail-in-a-Box | 15,441 | CC0-1.0 | Shell | Turns any Ubuntu server into a fully functional mail server with one command. |
| Stalwart Mail Server | 15,153 | AGPL-3.0 | Rust, Docker | All-in-one mail server with JMAP, IMAP4, and SMTP support and a wide range of modern features. |
| Mailcow | 13,631 | GPL-3.0 | Docker, PHP | Mail server suite based on Dovecot, Postfix and other open source software, that provides a modern Web UI for administration. |
| Mailu | 7,564 | MIT | Docker, Python | Simple yet full-featured mail server as a set of Docker images. |
| SimpleLogin | 7,060 | MIT | Docker, Python | Open source email alias solution to protect your email address. Comes with browser extensions and mobile apps. |
| Maddy Mail Server | 6,110 | GPL-3.0 | Go | All-in-one mail server that implements SMTP (both MTA and MX) and IMAP. Replaces Postfix, Dovecot, OpenDKIM, OpenSPF, OpenDMARC with single daemon. |
| Mox | 5,905 | MIT | Go | Complete e-mail solution with IMAP4, SMTP, SPF, DKIM, DMARC, MTA-STS, DANE and DNSSEC, reputation-based and content-based junk filtering, Internationalization (IDNA), automatic TLS with ACME and Let's Encrypt, account autoconfiguration, and webmail. |
| AnonAddy | 4,906 | MIT | PHP, Docker | Email forwarding service for creating aliases. |
| Modoboa | 3,543 | ISC | Python | Mail hosting and management platform including a modern and simplified web user interface. |
| wildduck | 2,110 | EUPL-1.2 | Nodejs, Docker | Scalable no-SPOF IMAP/POP3 mail server. |
Star counts and licences come from the awesome-selfhosted dataset and may lag GitHub slightly.
Browse the full categories
Frequently asked questions
What is the best open-source alternative to Gmail?
By GitHub stars, docker-mailserver is the most popular self-hosted alternative to Gmail listed here, followed by Postal and Mail-in-a-Box. The best fit depends on the features and stack you need.
Is there a free self-hosted alternative to Gmail?
Yes. All 12 projects on this page are open source and can be self-hosted at no licence cost; you pay only for your own server.
Which licences do these Gmail alternatives use?
The most common licences among them are MIT (6), GPL-3.0 (2) and CC0-1.0 (1).
Can I run a Gmail alternative with Docker?
8 of the 12 alternatives list Docker as a supported platform.