SelfHostHub

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

ProjectGitHub starsLicenceLanguage / platformWhat it does
docker-mailserver19,616MITDockerProduction-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) running inside a container. Only configuration files, no SQL database.
Postal16,873MITDocker, RubyComplete and fully featured mail server for use by websites & web servers.
Mail-in-a-Box15,441CC0-1.0ShellTurns any Ubuntu server into a fully functional mail server with one command.
Stalwart Mail Server15,153AGPL-3.0Rust, DockerAll-in-one mail server with JMAP, IMAP4, and SMTP support and a wide range of modern features.
Mailcow13,631GPL-3.0Docker, PHPMail server suite based on Dovecot, Postfix and other open source software, that provides a modern Web UI for administration.
Mailu7,564MITDocker, PythonSimple yet full-featured mail server as a set of Docker images.
SimpleLogin7,060MITDocker, PythonOpen source email alias solution to protect your email address. Comes with browser extensions and mobile apps.
Maddy Mail Server6,110GPL-3.0GoAll-in-one mail server that implements SMTP (both MTA and MX) and IMAP. Replaces Postfix, Dovecot, OpenDKIM, OpenSPF, OpenDMARC with single daemon.
Mox5,905MITGoComplete 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.
AnonAddy4,906MITPHP, DockerEmail forwarding service for creating aliases.
Modoboa3,543ISCPythonMail hosting and management platform including a modern and simplified web user interface.
wildduck2,110EUPL-1.2Nodejs, DockerScalable 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

All self-hosted Communication - Email - Complete Solutions

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.