7 self-hosted options
Open-source alternatives to Gmail
The best open-source alternative to Gmail is docker-mailserver (MIT, 19,681 GitHub stars, Docker image). Mail-in-a-Box stands out for a permissive CC0-1.0 license, and Stalwart Mail Server stands out for the most commits in the last 12 months (715).
About Gmail: Google's email service with web and mobile apps.
Updated · data from GitHub, refreshed daily
Top picks
- Rank 1:
docker-mailserver
docker-mailserver/docker-mailserver
Production-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) running inside a container. Only configuration files, no SQL database.
Active · last commit Oct 25, 2026
Email ServersShellDockerStands out for the most GitHub stars.
- Rank 2:
Mail-in-a-Box
mail-in-a-box/mailinabox
Turns any Ubuntu server into a fully functional mail server with one command.
Active · last commit Oct 22, 2026
Email ServersPythonStands out for a permissive CC0-1.0 license.
- Rank 3:
Stalwart Mail Server
stalwartlabs/stalwart
All-in-one mail server with JMAP, IMAP4, and SMTP support and a wide range of modern features.
Active · last commit Oct 20, 2026
Email ServersRustDockerStands out for the most commits in the last 12 months (715).
At a glance
Gmail alternatives compared
Open-source apps come first, then source-available ones and apps whose license appsgit could not verify; within each group, projects with at least 12 commits in the last 12 months come before less active or archived ones, then by GitHub stars.
| App | Stands out for | License | GitHub stars | Commits (12 mo) | Last commit | Docker image |
|---|---|---|---|---|---|---|
| docker-mailserver | the most GitHub stars | MIT | 19,681 | 121 | Oct 25, 2026 | Yes |
| Mail-in-a-Box | a permissive CC0-1.0 license | CC0-1.0 | 15,450 | 23 | Oct 22, 2026 | No |
| Stalwart Mail Server | the most commits in the last 12 months (715) | AGPL-3.0 | 15,298 | 715 | Oct 20, 2026 | Yes |
| Mailcow | its JavaScript codebase | GPL-3.0 | 13,696 | 354 | Oct 25, 2026 | Yes |
| Mailu | a permissive MIT license | MIT | 7,592 | 259 | Oct 25, 2026 | Yes |
| Roundcube | – | GPL-3.0 | 7,242 | 315 | Oct 25, 2026 | No |
| SnappyMail | – | AGPL-3.0 | 1,717 | 88 | Oct 24, 2026 | No |
Full list
All 7 Gmail alternatives
Open any app for live stats, license details and a deploy option.
- 1
docker-mailserver
Production-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) running inside a container. Only configuration files, no SQL database.
Email ServersDockerStands out for the most GitHub stars. docker-mailserver has 19,681 GitHub stars, uses the MIT license, ships a Docker image and had 121 commits in the last year.
- 2
Mail-in-a-Box
Turns any Ubuntu server into a fully functional mail server with one command.
Email ServersStands out for a permissive CC0-1.0 license. Mail-in-a-Box has 15,450 GitHub stars, uses the CC0-1.0 license and had 23 commits in the last year.
- 3
Stalwart Mail Server
All-in-one mail server with JMAP, IMAP4, and SMTP support and a wide range of modern features.
Email ServersDockerStands out for the most commits in the last 12 months (715). Stalwart Mail Server has 15,298 GitHub stars, uses the AGPL-3.0 license, ships a Docker image and had 715 commits in the last year.
- 4
Mailcow
Mail server suite based on Dovecot, Postfix and other open source software, that provides a modern Web UI for administration.
Email ServersDockerStands out for its JavaScript codebase. Mailcow has 13,696 GitHub stars, uses the GPL-3.0 license, ships a Docker image and had 354 commits in the last year.
- 5
Mailu
Simple yet full-featured mail server as a set of Docker images.
Email ServersDockerStands out for a permissive MIT license. Mailu has 7,592 GitHub stars, uses the MIT license, ships a Docker image and had 259 commits in the last year.
- 6
Roundcube
Browser-based IMAP client with an application-like user interface.
Email ServersRoundcube has 7,242 GitHub stars, uses the GPL-3.0 license and had 315 commits in the last year.
- 7
SnappyMail
Simple, modern, lightweight & fast web-based email client (fork of RainLoop).
Email ServersSnappyMail has 1,717 GitHub stars, uses the AGPL-3.0 license and had 88 commits in the last year.
Is there a free alternative to Gmail?
Yes. All 7 apps on this page are open source and free to self-host, so you can replace Gmail without per-user fees. You pay only for the server.
Can I self-host an alternative to Gmail with Docker?
Yes. 4 of the 7 apps here publish a Docker image, including docker-mailserver, Stalwart Mail Server and Mailcow, so you can run them on a home server or VPS with Docker Compose.
Which Gmail alternative is the most actively developed?
Stalwart Mail Server (AGPL-3.0), with 715 commits in the last 12 months. Activity is a good sign that bugs and security issues get fixed.
How is this list ranked?
Open-source apps come first, then source-available ones and apps whose license appsgit could not verify; within each group, projects with at least 12 commits in the last 12 months come before less active or archived ones, then by GitHub stars.