Complete and fully featured mail server for use by websites & web servers. .
docker-mailserver
MIT Docker Ready ★ 19,785 Stars Active · 2026-11-27Production-ready fullstack but simple mail server (SMTP, IMAP, LDAP, Antispam, Antivirus, etc.) running inside a container. Only configuration files, no SQL database. ).
- Tech Stack / Runtime
- Docker · Shell
- Open-Source License
- MIT
- GitHub Health
- ★ 19,785 · 2,133 forks
Quick Docker Compose Reference for docker-mailserver
services:
mailserver:
image: ghcr.io/docker-mailserver/docker-mailserver:latest
container_name: mailserver
# Provide the FQDN of your mail server here (Your DNS MX record should point to this value)
hostname: mail.example.com
env_file: mailserver.env
# More information about the mail-server ports:
# https://docker-mailserver.github.io/docker-mailserver/latest/config/security/understanding-the-ports/
ports:
- "25:25" # SMTP (explicit TLS => STARTTLS, Authentication is DISABLED => use port 465/587 instead)
- "143:143" # IMAP4 (explicit TLS => STARTTLS)
- "465:465" # ESMTP (implicit TLS)
- "587:587" # ESMTP (explicit TLS => STARTTLS)
- "993:993" # IMAP4 (implicit TLS)
volumes:
- ./docker-data/dms/mail-data/:/var/mail/
- ./docker-data/dms/mail-state/:/var/mail-state/
- ./docker-data/dms/mail-logs/:/var/log/mail/
- ./docker-data/dms/config/:/tmp/docker-mailserver/
- /etc/localtime:/etc/localtime:ro
restart: always
stop_grace_period: 1m
# Uncomment if using `ENABLE_FAIL2BAN=1`:
# cap_add:
# - NET_ADMIN
# The image does not configure a healthcheck (it is not part of the OCI image spec), `dms-healthcheck` checks all enabled services:
healthcheck:
test: dms-healthcheck
start_period: 30s docker-mailserver System Requirements & Self-Hosting Guide
Deploy docker-mailserver (4 GB+ RAM) →Recommended VPS
4 GB+ RAM
2 – 4 vCPU · $6 – $12/mo VPS
Deployment Method
Intermediate
Docker / Docker Compose (Recommended)
Commercial Use (MIT)
Yes — free for personal, internal company, and commercial use with attribution.
Maintenance Status
Active
Last commit: 2026-11-27
Frequently Asked Questions about docker-mailserver
Is docker-mailserver free to self-host for commercial use?
docker-mailserver is released under the MIT license. Yes — free for personal, internal company, and commercial use with attribution. It has 19,785 GitHub stars and was last updated on 2026-11-27.
What VPS specifications do I need to self-host docker-mailserver?
Based on its Docker runtime and Communication - Email - Complete Solutions workload, we recommend at least 4 GB+ RAM and 2 – 4 vCPU (typically $6 – $12/mo VPS).
Does docker-mailserver support Docker deployment?
Yes — docker-mailserver supports Docker / Docker Compose (Recommended), making it intermediate to spin up on any Linux VPS.
Deploy docker-mailserver on your own VPS
Run docker-mailserver privately with full data control. Recommended starting footprint: 4 GB+ RAM ($6 – $12/mo VPS).
Best Value · 1-Click Docker
1 vCPU · 4 GB RAM · 50 GB NVMe
Includes built-in Docker & Coolify templates — ideal for beginners.
Lowest Cost / Performance
2 vCPU · 4 GB RAM · 40 GB NVMe
Unbeatable EU/US cloud pricing for high-traffic self-hosted stacks.
$200 Free Credit
1 vCPU · 1 GB RAM · 25 GB SSD
Clean developer UX with 1-click Marketplace Docker droplets.
More Open-Source Communication - Email - Complete Solutions
View all →All-in-one mail server with JMAP, IMAP4, and SMTP support and a wide range of modern features. .
Turns any Ubuntu server into a fully functional mail server with one command. .
Mail server suite based on Dovecot, Postfix and other software, that provides a modern Web UI for administration. .
Simple yet full-featured mail server as a set of Docker images. .
Email alias solution to protect your email address. Comes with browser extensions and mobile apps. .