docker-mailserver is inspired by the renowned ISPMail guide.
This project lets you run your own email services, giving you independence from large providers. It is a secure, customizable, and feature-rich solution for managing your email infrastructure.
Container images are built on Alpine Linux or vendor base images and are kept lightweight.
- Secure email protocols: POP3, IMAP, and SMTP with user authentication
- Web-based management interface for account, domain, and alias administration
- Intuitive webmail interface
- Fetchmail integration to retrieve emails from external providers
- DKIM message signing for email authenticity
- Server-side mail filtering with configurable rules via a web frontend
- Spam filter training by simply moving emails to or from the junk folder
- Real-time spam prevention using RBLs (Real-Time Blackhole Lists)
- Selective greylisting for likely spam
- Support for catch-all email addresses
- Support for send-only accounts restricted from receiving emails
- Restriction of sender addresses for enhanced security
- Configurable address extensions using the '-' delimiter
- Quota management with notifications when quotas are exceeded
- Enforced TLS for secure communication
- Full-text search (FTS) support for efficient message searching
- Continuous self-monitoring via Docker healthcheck
- Developed with a strong focus on quality assurance
Download the latest release from the Releases page and unpack the archive (release-vX.X.X.tar.gz). If you are an advanced user, you can also download the source code from GitHub:
git clone https://github.com/jeboehm/docker-mailserver.gitDo not use the latest container image tag for production deployments. Use a specific version instead.
For example, use jeboehm/mailserver-mta:6.3 instead of jeboehm/mailserver-mta:latest.
- Copy the file
.env.distto.envand open it in a text editor. Change the variables in it according to your needs. They are described in the docs. - To download the Docker images, run
bin/production.sh pull. - To start the services, run
bin/production.sh up -d --wait. This will wait for all services to be ready before continuing. - After a few seconds, you can access the services listed in the section Ports overview.
- Start the installation wizard by running
bin/production.sh run --rm web setup.sh. This will ask you a few questions to set everything up and create your first email address and an admin user. - Now you can log in to the management interface with your new account credentials.
Kubernetes deployment is fully supported. You can use the kustomization.yaml file to deploy the mailserver to your Kubernetes cluster.
Important: Installing on Kubernetes requires an existing MySQL-compatible database (for example, MySQL or Percona XtraDB).
The provided kustomization does not provision a database. Configure the database connection in your .env and supply
credentials as Kubernetes Secrets before applying the manifests. See the
Kustomize External Database and HTTPS Ingress Example
and the documentation Use another MySQL instance for details.
- Copy the file
.env.distto.envand open it in a text editor. Change the variables in it according to your needs. They are described in the docs. - Create a namespace for the mailserver by running
kubectl create namespace mail. - To create self-signed TLS certificates, run
bin/create-tls-certs.sh. You'll need them when you don't plan to use tools likecert-manager. - Create a Kubernetes secret for the TLS certificates by running
kubectl create -n mail secret tls tls-certs --cert=config/tls/tls.crt --key=config/tls/tls.key. - Apply the kustomize manifests by running
kubectl apply -n mail -k .. - When the pods are up and healthy, start the installation wizard by executing
setup.shin the php-fpm container of the web pod. This will ask you a few questions to set everything up and create your first email address and an admin user. - Now you can log in to the management interface with your new account credentials on the configured ingress.
| Service | Address |
|---|---|
| POP3 (STARTTLS required) | 127.0.0.1:110 |
| POP3S | 127.0.0.1:995 |
| IMAP (STARTTLS required) | 127.0.0.1:143 |
| IMAPS | 127.0.0.1:993 |
| SMTP | 127.0.0.1:25 |
| Mail Submission (STARTTLS required) | 127.0.0.1:587 |
| Management Interface | http://127.0.0.1:81/manager/ |
| Webmail | http://127.0.0.1:81/webmail/ |
| Rspamd web interface | http://127.0.0.1:81/rspamd/ |
- Upgrade Guide
- Service Architecture
- Installation:
- Configuration:
- Developer Guide
- Issues
- Container Images:
- Components:



