Self-hosted alternatives to Gmail
A complete email server under your control. Below are 12 open source options you host on your own server — with no monthly per-user fee and full control of your data.
docker-mailserver
★ 18,419Production-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) running inside a container. Only configuration files, no SQL database.
Postal
★ 16,616Complete and fully featured mail server for use by websites & web servers.
Mail-in-a-Box
★ 15,343Turns any Ubuntu server into a fully functional mail server with one command.
Stalwart Mail Server
★ 13,282All-in-one mail server with JMAP, IMAP4, and SMTP support and a wide range of modern features.
Mailcow
★ 12,987Mail server suite based on Dovecot, Postfix and other open source software, that provides a modern Web UI for administration.
Mailu
★ 7,327Simple yet full-featured mail server as a set of Docker images.
SimpleLogin
★ 6,743Open source email alias solution to protect your email address. Comes with browser extensions and mobile apps.
Maddy Mail Server
★ 6,015All-in-one mail server that implements SMTP (both MTA and MX) and IMAP. Replaces Postfix, Dovecot, OpenDKIM, OpenSPF, OpenDMARC with single daemon.
Mox
★ 5,726Complete 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,704Email forwarding service for creating aliases.
Modoboa
★ 3,509Mail hosting and management platform including a modern and simplified web user interface.
wildduck
★ 2,101Scalable no-SPOF IMAP/POP3 mail server.
Frequently asked questions
Is there a free self-hosted alternative to Gmail?
Yes. We've gathered 12 self-hosted, open source alternatives to Gmail — including docker-mailserver, Postal, Mail-in-a-Box. You run all of them on your own server.
What is the best open source alternative to Gmail?
docker-mailserver is one of the most popular (18,419 GitHub stars). The "best" depends on your case — compare the options below.
Do I need a server to replace Gmail?
Yes. You can use a home server (homelab) or a cheap VPS (from ~€4/mo). See the hosting suggestions on this page.