Overview
Service status and mail ports
docker and docker-mailserver active, the digest-pinned container healthy, all five mail ports listening, and the dedicated ext4 data volume mounted.
Service status and mail ports
End-to-end mail-flow proof
Per-instance credentials
AWS outbound 25 and Fail2ban
This is a repackaged open source software product wherein additional charges apply for cloudimg support services.
docker-mailserver - Production-Ready Full-Stack Mail Server
Deploy a complete, self-hosted mail server on AWS in minutes. This image runs docker-mailserver preconfigured as a managed system service: a Postfix mail transfer agent for sending and receiving, Dovecot for IMAP mailbox access, Rspamd for spam scoring plus DKIM signing and verification, SPF and DMARC, and Fail2ban for brute-force protection - all from one digest-pinned upstream container, with no database to run and no web console to secure.
Why This Image Instead of a DIY Install
- Versus manual setup: Skip the hours of installing Docker, writing a compose stack, wiring up the five mail ports, provisioning a data disk, and hardening credentials. This image does all of that at launch.
- Secure by default: No mailbox and no credential ships in the image. On first boot, on your own instance, a single postmaster mailbox is created with a randomly generated password, a self-signed TLS certificate carrying your instance's own hostname is generated, and DKIM signing keys are generated per instance. Nothing is shared between customers.
- Not an open relay: The server rejects unauthenticated relay to external domains. This safety property is proven by an explicit end-to-end test at build time, not assumed.
Application Stack
- docker-mailserver run from the official ghcr.io image, pinned by container digest so the version never drifts
- Postfix SMTP, Dovecot IMAP, Rspamd (spam scoring, DKIM, DMARC, SPF), Fail2ban brute-force protection
- A dedicated EBS data volume holding the Maildir, mail state, mail logs and config (accounts, aliases, DKIM keys, TLS material) - independently resizable, kept off the OS disk
- systemd units that bring the stack up on boot and run per-instance first-boot initialisation
- ClamAV antivirus present in the image and disabled by default (memory-heavy); a single helper script and a guide section enable it
Mail Ports
The server publishes the five standard mail ports: 25 (inbound SMTP from other mail servers), 143 and 993 (IMAP, STARTTLS and implicit TLS), and 465 and 587 (authenticated submission, implicit and explicit TLS). Point any standard mail client at the instance on 587/993 with the full email address as the username.
What You Need to Configure (Please Read)
A mail server that the internet trusts needs DNS and platform setup that only you can do for your domain:
- DNS records: an MX record pointing at this server, plus SPF, DKIM (the image prints the DKIM record to publish) and DMARC records for good deliverability, and a reverse DNS (PTR) record for the sending IP.
- AWS outbound port 25: AWS throttles outbound port 25 on new accounts by default. To deliver mail directly to recipient mail servers you must request removal of that limit (the 'Request to remove email sending limitations' form) and set up reverse DNS. Until then - or as the recommended production path - relay outbound mail through an authenticated smarthost on port 587, which is never throttled. A one-command helper configures the relay.
Inbound mail and IMAP are unaffected by the port 25 throttle: this is a fully functional receiving and mailbox server the moment it launches.
Security
Per-instance secrets: The mailbox password, the TLS certificate and the DKIM signing keys are all generated on first boot on your own instance and are never shared. The image ships with no mailbox and no known login.
Encryption in transit: IMAP and submission are TLS-only. Replace the self-signed certificate with one for your own domain (the guide has the Let's Encrypt walkthrough).
Encryption at rest: The dedicated data volume holding mailboxes can use AWS EBS encryption. Enable it when launching or use encrypted snapshots.
Brute-force protection: Fail2ban is enabled and enforced, tuned so the instance can never ban itself off its own mail server.
Use Cases
- Host mailboxes for your own domain on infrastructure you control
- Receive and archive application and system notification mail
- Provide IMAP access and authenticated submission for a small team
24/7 cloudimg Support
Technical support by email and live chat covers deployment, DNS and deliverability setup, TLS certificates, outbound relay configuration, spam-filter tuning and mailbox administration.
All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Highlights
- Complete self-hosted mail server, ready in minutes: Postfix SMTP, Dovecot IMAP, Rspamd spam filtering with DKIM/DMARC/SPF, and Fail2ban brute-force protection launch as a managed service from one digest-pinned upstream container. Skip the hours of installing Docker, wiring the five mail ports and hardening credentials that a DIY deployment requires - a fully functional receiving and IMAP mailbox server is answering within minutes of launch.
- Secure by default with per-instance secrets and no open relay: the image ships with no mailbox and no known credential. On first boot your instance generates its own postmaster password, a TLS certificate carrying its own hostname, and DKIM signing keys - nothing is shared between customers. The server rejects unauthenticated relay to external domains, a safety property proven by an explicit end-to-end test at build time, not assumed.
- Production-grade storage and honest operations: mailboxes, logs and config live on a dedicated EBS data volume you can resize independently, kept off the OS disk. The listing and paired guide state plainly what you must configure - MX, SPF, DKIM, DMARC and reverse DNS, and the AWS outbound port 25 request or an authenticated relay on 587. Backed by 24/7 cloudimg support via email and live chat.
Details
Introducing multi-product solutions
You can now purchase comprehensive solutions tailored to use cases and industries.
Features and programs
Financing for AWS Marketplace purchases
Pricing
Free trial
- ...
Dimension | Description | Cost/hour |
|---|---|---|
m5.large Recommended | m5.large | $0.08 |
t2.micro | t2.micro instance type | $0.04 |
t3.micro | t3.micro instance type | $0.04 |
r5n.2xlarge | r5n.2xlarge instance type | $0.24 |
i7ie.3xlarge | i7ie.3xlarge instance type | $0.24 |
t3.xlarge | t3.xlarge instance type | $0.12 |
m8i.32xlarge | m8i.32xlarge instance type | $0.24 |
r6id.xlarge | r6id.xlarge instance type | $0.12 |
r6in.4xlarge | r6in.4xlarge instance type | $0.24 |
r8id.24xlarge | r8id.24xlarge instance type | $0.24 |
Vendor refund policy
Refunds available on request.
How can we make this page better?
Legal
Vendor terms and conditions
Content disclaimer
Delivery details
64-bit (x86) Amazon Machine Image (AMI)
Amazon Machine Image (AMI)
An AMI is a virtual image that provides the information required to launch an instance. Amazon EC2 (Elastic Compute Cloud) instances are virtual servers on which you can run your applications and workloads, offering varying combinations of CPU, memory, storage, and networking resources. You can launch as many instances from as many different AMIs as you need.
Version release notes
Initial release of docker-mailserver 15.1.0, a production-ready full-stack mail server.
Additional details
Usage instructions
Connect via SSH on port 22 as the default login user for your operating system variant (the user guide lists it per variant). This is a headless mail server with no web console. Retrieve the per-instance postmaster mailbox and its generated password with: sudo cat /root/docker-mailserver-credentials.txt. Prove mail flows end to end at any time with: sudo /usr/local/sbin/dms-selftest.sh. Point a mail client at the instance public IP on 587 (submission, STARTTLS) or 465 (implicit TLS) for sending, and 993 (implicit TLS) or 143 (STARTTLS) for IMAP, using the full email address as the username. Add mailboxes with: sudo docker exec -ti mailserver setup email add you@your-domain. Set your public mail hostname and regenerate the certificate with: sudo /usr/local/sbin/dms-set-domain.sh mail.your-domain. To send mail, either request removal of the AWS outbound port 25 limit and set up reverse DNS, or relay through an authenticated smarthost with: sudo /usr/local/sbin/dms-set-relay.sh smtp.example.net 587 user password. Mail data lives on a dedicated EBS volume mounted at /var/lib/docker-mailserver.
Resources
Vendor resources
Support
Vendor support
cloudimg Support - 24/7 Technical Assistance
cloudimg provides round-the-clock technical support for this docker-mailserver image via email and live chat. Our engineers assist with:
- Initial deployment and instance sizing guidance
- DNS and deliverability setup (MX, SPF, DKIM, DMARC, reverse DNS)
- AWS outbound port 25 removal and authenticated relay configuration
- TLS certificate installation for your own domain
- Spam-filter (Rspamd) and Fail2ban tuning
- Mailbox administration and backup guidance
- Troubleshooting connectivity and delivery issues
Response Times: Critical issues receive a one-hour average response time.
Contact: Email support@cloudimg.co.uk or reach us via live chat.
Deployment Prerequisites
- Instance type: m5.large or larger is recommended (enabling ClamAV antivirus needs 8 GB RAM).
- EBS data volume: Mailboxes, logs and config live on a dedicated data volume. Size it for your retention requirements.
- Security groups: Open 25, 143, 465, 587 and 993 to the sources that need them; open 22 to your management CIDR only.
- DNS + reverse DNS: Configure MX, SPF, DKIM, DMARC and a PTR record for reliable delivery.
Getting Started
- Launch the AMI and confirm the dedicated data volume is attached.
- Retrieve the per-instance postmaster credentials with: sudo cat /root/docker-mailserver-credentials.txt.
- Set your public mail hostname: sudo /usr/local/sbin/dms-set-domain.sh mail.your-domain.
- Add your own mailboxes: sudo docker exec -ti mailserver setup email add you@your-domain.
- Configure outbound delivery: request the AWS port 25 removal, or set an authenticated relay on 587.
For deliverability planning, production architecture, or any issues including requesting refunds, contact support@cloudimg.co.uk .
AWS infrastructure support
AWS Support is a one-on-one, fast-response support channel that is staffed 24x7x365 with experienced and technical support engineers. The service helps customers of all sizes and technical abilities to successfully utilize the products and features provided by Amazon Web Services.