docker-mailserver logo

docker-mailserver

Website

Containerized mail server stack for SMTP and IMAP with anti-spam

18.8k stars 2k forks last commit first released MIT

Actively maintained

Last commit 31 Aug 2026.

docker-mailserver screenshot

docker-mailserver (DMS) is a production-ready, containerized email server appliance that bundles common mail components into a single Docker image. It is designed to be “full stack but simple”, emphasizing file-based configuration (no SQL database) to keep setups easy to version, deploy, and upgrade.

Key Features

  • SMTP server with Postfix
  • IMAP and POP3 server with Dovecot
  • Optional LDAP-backed authentication (including SASL)
  • Anti-spam stack integration (including Rspamd and SpamAssassin options)
  • Antivirus scanning with ClamAV
  • Email authentication protections with DKIM and DMARC support
  • Abuse and brute-force mitigation via Fail2ban and Postscreen
  • TLS certificate support including Let’s Encrypt, as well as manual/self-signed certificates
  • Included maintenance and administration helper script (setup.sh)

Use Cases

  • Self-hosting mail for a personal domain or homelab with a Docker-based workflow
  • Running small-to-medium organization mail services with common anti-spam and security components
  • Providing a reproducible, version-controlled mailserver configuration for teams and environments

Limitations and Considerations

  • Mail hosting requires careful DNS and deliverability configuration (SPF, DKIM, DMARC, rDNS) and ongoing monitoring to avoid delivery issues
  • Advanced customization may require inspecting the running container or using startup patch scripting for overrides

docker-mailserver is a practical option when you want a complete mail stack in a single container while retaining transparent, file-based configuration. It aims to reduce operational complexity without hiding the underlying building blocks that power a standard email system.

Categories:

Tags:

Tech Stack:

Share:

Similar to docker-mailserver

mailcow: dockerized logo

mailcow: dockerized

Docker-based email server suite with a web admin interface

13.4k
1.8k
Last commit

Mailcow is a dockerized mail server suite providing SMTP/IMAP, webmail, anti-spam/anti-virus, and domain/mailbox administration via a unified web UI.

GPL-3.0Actively maintained
Alternative to:
Microsoft Exchange Online logo
Microsoft Exchange Online
+16
iRedMail logo

iRedMail

Open-source full-featured mail server stack for Linux/BSD

1.8k
261
Last commit

Automated open-source mail server installer bundling Postfix, Dovecot, webmail, anti-spam/antivirus and LDAP/SQL backends for mainstream Linux/BSD.

GPL-3.0Actively maintained
Alternative to:
Microsoft Exchange Online logo
Microsoft Exchange Online
+16
Mailu logo

Mailu

Docker-based mail server with webmail and admin interface

7.5k
997
Last commit

Mailu is a full-featured mail server distributed as Docker images, providing SMTP/IMAP/POP3, webmail, administration UI, and built-in security and anti-spam features.

Actively maintained
Alternative to:
Microsoft Exchange Online logo
Microsoft Exchange Online
+19
emailwiz logo

emailwiz

Bash-based installer that deploys a secure Debian/Ubuntu mail server stack.

2.2k
342
Last commit

A Bash script that auto-implements a full mail server (Postfix, Dovecot, DKIM, SpamAssassin) with TLS and PAM-based logins on Debian/Ubuntu.

GPL-3.0Slowing down
Alternative to:
Microsoft Exchange Online logo
Microsoft Exchange Online
+14

Maddy Mail Server

Composable all-in-one SMTP/IMAP mail server with security features

6.1k
326
Last commit

Go-based, modular mail server implementing SMTP/LMTP/IMAP with built-in DKIM/SPF/DMARC, storage backends (SQLite/Postgres/S3), Prometheus metrics and Docker support.

GPL-3.0Actively maintained
Alternative to:
Microsoft Exchange Online logo
Microsoft Exchange Online
+10
Simple NixOS Mailserver logo

Simple NixOS Mailserver

NixOS module for running a complete email server stack

Simple NixOS Mailserver provides NixOS modules to deploy a full email server with SMTP/IMAP, spam filtering, DKIM/DMARC/SPF, and TLS automation.

Activity unknown
Alternative to:
Microsoft Exchange Online logo
Microsoft Exchange Online
+14