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 software, that provides a modern Web UI for administration.

    13.8k starsGPL-3.0Updated 18 November 2026
  2. Stalwart Mail Server

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

    16k starsAGPL-3.0Updated 16 November 2026
  3. Mail-in-a-Box

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

    15.5k starsCC0-1.0Updated 8 November 2026
  4. Mailu

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

    7.6k starsMITUpdated 18 November 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.8k starsMITUpdated 18 November 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.

    6k starsMITUpdated 27 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 16 November 2026
  8. Modoboa

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

    3.5k starsISCUpdated 18 November 2026

Side by side

AppStarsLicenseActivityRuns on
Mailcow13,842GPL-3.0Docker, PHP
Stalwart Mail Server16,042AGPL-3.0Rust, Docker
Mail-in-a-Box15,473CC0-1.0Shell
Mailu7,633MITDocker, Python
docker-mailserver19,767MITDocker
Mox5,952MITGo
Maddy Mail Server6,134GPL-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.

Guides

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.