Skip to content

docker-mailserver

Containerized mail server built on Postfix and Dovecot, configured with plain files

Permissive (OSI) · MIT
  • Self-hosted

Listed by , founder & editor

76

Health

Thriving

Overview

Stars

19,775

Last commit

today

Nov 2026

Repository age

11 years

since Mar 2015

Latest version

v17.0.0

Nov 2026

Contributors

–

22 active in 90 days

Releases

3

last 12 months

Language

Shell

docker-mailserver packages a full mail server into a single container. It uses configuration files only, with no SQL database, which keeps deployment and upkeep simple. A setup script helps with configuration and maintenance.

The bundle includes Postfix for SMTP and Dovecot for IMAP, POP3, SASL, LDAP, Sieve and quotas. For spam and malware it offers Rspamd, SpamAssassin, Amavis and ClamAV with automatic updates. OpenDKIM and OpenDMARC handle sender authentication. Fail2ban, Postscreen and Postgrey add protection, and Fetchmail and Getmail6 can pull mail from other accounts. Certificate handling is flexible.

The project is written mostly in shell, uses the MIT license, and has been developed since 2015. You run it on your own server with Docker. It suits people who want to host their own mail instead of paying for a hosted mailbox service.

Who it's for

Self-hosters running mail for a domain

One container gives you SMTP, IMAP, spam filtering and DKIM without assembling each part.

Skip if: You do not want to manage DNS records, deliverability and security yourself.

Small teams that want files-only configuration

With no SQL database, settings live in files you can keep in version control.

Skip if: You need a web admin panel for managing mailboxes.

Admins with an existing LDAP directory

Dovecot support for LDAP lets you connect to current accounts.

Skip if: You need groupware features like shared calendars.

The problem it solves

Hosted email costs money per mailbox and keeps your mail on someone else's servers. Building a mail server by hand means wiring many separate services together. This project ships them preconfigured in one container.

Strengths

  • Config-file based, with no SQL database to maintain
  • Includes Postfix, Dovecot, Rspamd, ClamAV, OpenDKIM, OpenDMARC and Fail2ban
  • Dovecot provides IMAP, POP3, LDAP, Sieve and quotas
  • Setup script eases configuration and maintenance
  • Maintained since 2015 with an MIT license

Trade-offs

  • No built-in web interface for administration
  • Running your own mail means handling DNS and deliverability yourself
  • Requires Docker knowledge to deploy and upgrade
  • Mail only; no calendar or contacts server

docker-mailserver replaces

Self-host docker-mailserver

Self-hostable
Yes
Docker Compose
The repository ships a Compose file

In the community

Frequently asked questions

Is docker-mailserver free?

Yes. It is open source under the MIT license.

Can I self-host it?

Yes. It is built to run on your own server with Docker.

Does it need a database?

No. It uses only configuration files, not an SQL database.

What spam and virus protection is included?

Rspamd, SpamAssassin, Amavis, ClamAV, Postscreen, Postgrey and Fail2ban are part of the bundle.

Other Gmail alternatives

Compare all 10 Gmail alternatives →

Similar tools in Email software

FairEmail

Email software

Android email client for people who want privacy and many accounts in one inbox

4.8k 714 3 days ago Active GPL-3.0

Replaces Microsoft Outlook

Proton Mail Bridge

Email software

Desktop app that lets Outlook, Thunderbird and Apple Mail read Proton Mail over IMAP

1.6k 254 17 days ago Active GPL-3.0

opentrashmail

Email software

968 78 33 days ago Slowing Apache-2.0

Postal

Email software

Self-hosted mail server with SMTP and API delivery for apps and websites

17k 1.3k 3 days ago Active MIT

Replaces Mailgun

Billion Mail

Email software

16k 1.8k 5 months ago Dormant AGPL-3.0