Free, open-source alternatives to Gmail

Google's email service. 8 apps you can run yourself instead of Gmail, sorted by how well they replace it. Each one is open source, so your data stays with you.

  1. MailcowBest match

    Mail server suite based on Dovecot, Postfix and other open source software, that provides a modern Web UI for administration.

    13.6k starsGPL-3.0Updated 6 October 2026
  2. Stalwart Mail Server

    All-in-one mail server with JMAP, IMAP4, and SMTP support and a wide range of modern features.

    15.1k starsAGPL-3.0Updated 11 October 2026
  3. Mail-in-a-Box

    Turns any Ubuntu server into a fully functional mail server with one command.

    15.4k starsCC0-1.0Updated 26 September 2026
  4. Mailu

    Simple yet full-featured mail server as a set of Docker images.

    7.6k starsMITUpdated 12 October 2026
  5. 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.

    19.5k starsMITUpdated 4 October 2026
  6. Mox

    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.

    5.9k starsMITUpdated 9 October 2026
  7. Maddy Mail Server

    All-in-one mail server that implements SMTP (both MTA and MX) and IMAP. Replaces Postfix, Dovecot, OpenDKIM, OpenSPF, OpenDMARC with single daemon.

    6.1k starsGPL-3.0Updated 3 October 2026
  8. Modoboa

    Mail hosting and management platform including a modern and simplified web user interface.

    3.5k starsISCUpdated 9 October 2026

Side by side

AppStarsLicenseActivityRuns on
Mailcow13,600GPL-3.0Docker, PHP
Stalwart Mail Server15,074AGPL-3.0Rust, Docker
Mail-in-a-Box15,438CC0-1.0Shell
Mailu7,551MITDocker, Python
docker-mailserver19,511MITDocker
Mox5,896MITGo
Maddy Mail Server6,108GPL-3.0Go
Modoboa3,542ISCPython

Why replace Gmail?

Gmail works, but your data lives in someone else's account, the price can change at any time, and features can disappear. An open-source app you run yourself is yours: you choose where it runs, who can see the data, and when to update.

Questions

What is the best free alternative to Gmail?

Mailcow is the closest open-source replacement for Gmail in our list. Stalwart Mail Server and Mail-in-a-Box are worth a look too, depending on what you need.

Can I self-host an alternative to Gmail?

Yes. All 8 apps on this page are open source and can run on your own server, usually with Docker, or on a managed host that installs them for you.