
docker-mailserver
A self-hosted email server packaged as a Docker container, with SMTP, IMAP and anti-spam built in.
- Stars
- 19.7k
- Forks
- 2.1k
- Licence
- MIT
- Language
- Shell
- Last update
- 6 days ago
- Type
- App
What it is
docker-mailserver is a full email server that runs inside a Docker container. It bundles common mail components such as Postfix for sending and receiving, Dovecot for IMAP and POP3 access, and several spam and virus filters. It is configured through files rather than a database, which the project describes as keeping setup simple and versioned.
- Host email for a personal or small-organization domain
- Send and receive mail with IMAP clients such as desktop or phone mail apps
- Filter incoming mail for spam and viruses using Rspamd, SpamAssassin and ClamAV
- Fetch mail from other accounts with Fetchmail or Getmail6
- Authenticate users through LDAP or OAuth2 (XOAUTH2 or OAUTHBEARER)
Great for
- People who want to run their own mail server on a machine they control
- Admins who already use Docker and want mail in a container
- Teams that want anti-spam, anti-virus and DKIM/DMARC handled in one package
- Users who prefer file-based configuration over a SQL database
Not ideal for
- Anyone who wants email hosting without running servers, since the README assumes you operate the server yourself
- Beginners with no experience of DNS, TLS certificates or mail deliverability, because setup involves those topics and the README points to documentation for initial setup
- People needing a managed or hosted service with support contracts, since the README says the issue tracker is not for personal support
How to get it
- 1
Run with Docker
You'll need: Docker
Clone the repository
git clone https://github.com/docker-mailserver/docker-mailserver.git - 2
Run it
- Read the documentation's initial setup guide linked in the README
- Choose the image version that matches the documentation you are following
- Configure your domain, DNS records and certificates as the guide describes
- Start the container and create a mail account
- Connect a mail client to test sending and receiving
- 3
Get the most out of it
- Use the environment variables reference to tune behavior without editing many files
- Enable LetsEncrypt or manual certificates for TLS
- Use the built-in setup script for account and alias management
- Add custom SpamAssassin rules if default filtering needs adjusting
- Use Sieve filtering and quotas for per-user mail rules and limits
Downloads
Strengths
- Bundles many mail components into one container, so there is less to wire together by hand
- Configuration is kept in files, with no SQL database to maintain
- Large community interest, with about 19,700 GitHub stars and an MIT license
Trade-offs
- Running a mail server is demanding; the README points to documentation for initial setup and expects you to match docs to your image version
- Support is limited to the issue tracker and documentation, which the README says is not for personal support
- The project is maintained by volunteers since 2021, so response times are not guaranteed
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| docker-mailserver (this) | 19.7k | App | advanced | 6 days ago | People who want to run their own mail server on a machine they control |
| postal | 16.9k | App | advanced | 7 days ago | Teams that want to run their own transactional email sending infrastructure |
| cloud-mail | 15.3k | App | intermediate | 12 days ago | People who want their own email service on a domain they control |
| ProxmoxVE | 30k | Dev tool | beginner | 4 days ago | Homelab users who run Proxmox VE and want quick installs of common self-hosted services |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.