FTC disclosure: This article contains affiliate links. If you purchase through these links, we may earn a commission at no additional cost to you.
Self-Hosted Email Solutions: Compare Mailcow, Mailu, Docker Mailserver, and Mail-in-a-Box
Compare four self-hosted email stacks by operational burden, Docker complexity, DNS expectations, and the kind of operator each path fits best.

Short answer: Choose Mailcow for the most complete UI-led Docker stack; choose Mailu for a focused, comparatively lean Docker mail platform; choose Docker Mailserver for configuration-first control; and choose Mail-in-a-Box for a more opinionated path with fewer design decisions.
For Internet-facing email, a VPS is the safer default than home hosting because stable addressing, configurable reverse DNS, permitted mail traffic, and uptime matter more than the project name. Home hosting is useful for learning, but ISP restrictions, residential IP reputation, port forwarding, power, and reverse-DNS limits can dominate the outcome.
This page remains a four-way comparison hub. For Mailu-specific requirements, configuration files, DNS, backups, and first deployment, see the Mailu self-hosted Docker setup and beginner guide.
The 4 self-hosted email solutions worth your time
Use this table to narrow the shortlist before reading the detailed sections.
| Solution | Best operator fit | Operational burden | Docker, storage, and RAM | Home or VPS | Backup and deliverability focus | Beginner verdict |
|---|---|---|---|---|---|---|
| Mailcow | Integrated UI-led platform | Medium to high; many services | Heavier Docker footprint; plan disk and RAM growth | VPS preferred | Back up mail data, configuration, and database; monitor queues and reputation | Best all-around starting point if resources are available |
| Mailu | Focused, modular Docker mail stack | Medium; careful config and DNS work | Generated Compose files; 1 GB RAM + 1 GB swap without ClamAV, 3 GB + 1 GB swap with it | Home for learning; VPS for public delivery | Back up /mailu, mailu.env, Compose files, certificates, and database data | Strong focused choice for a careful Docker operator |
| Docker Mailserver | Versioned configuration | Medium to high; more underlying mail decisions | Docker-based; size the host around enabled services | VPS usually simpler | Configuration and mail volumes need tested, off-host backups | Better for experienced Docker users |
| Mail-in-a-Box | Opinionated guided install | Medium; less assembly, less flexibility | Opinionated host layout; follow supported-server guidance | VPS is the natural fit | Follow project backup and recovery guidance; DNS still determines delivery | Good when simplicity matters more than customization |
Option 1: Mailcow
Mailcow's official install docs are the first official docs to read if the goal is a balanced starting point for features and usability.
Why this matters
Mailcow is a good fit when you do not want to stitch together SMTP, IMAP, spam filtering, antivirus, webmail, and an admin panel by hand. Think of it as buying a well-organized toolbox instead of a pile of loose parts.
When Mailcow is the right pick
Choose Mailcow if:
- you want an all-in-one Docker-based mail platform
- you value a web UI for domains, mailboxes, and policies
- you are comfortable giving a small VPS or dedicated node to email
- you want a strong documentation trail and plenty of community examples
When to think twice
Mailcow is not tiny. It uses multiple containers and persistent volumes, so you need to care about RAM, disk, updates, and backups from day one.
Option 2: Mailu
Mailu's official Docker Compose setup guide is the key reference for a focused Docker mail platform. Mailu combines mail protocols, webmail, administration, aliases, quotas, TLS, authentication records, and filtering into a coordinated stack.
Mailu-specific summary
Mailu is the strongest fit of these four when the operator wants a focused mail platform, generated Compose configuration, and explicit control over the service stack without assembling every component from scratch. It suits a careful Docker operator better than someone seeking a maintenance-free mailbox provider.
article_topic // Self-Hosted Email Solutions
Don't leave without the setup notes.
Get practical homelab guides, failure logs, and beginner-friendly build notes in your inbox.
Enter your email address to receive the Homelab Addiction newsletter.
- Choose Mailu when a modular Docker workflow and configuration review matter more than a one-click appliance experience.
- Choose Mailu on a VPS when public delivery is the goal and the provider supports port 25, PTR/reverse DNS, stable addressing, and required ports.
- Use Mailu at home mainly for learning or controlled internal use unless ISP, IP reputation, reverse DNS, power, and mail policies are suitable.
- Budget for operations including DNS, TLS, spam controls, storage growth, off-host backups, restore testing, upgrades, and queue monitoring.
Mailu's published requirements list 1 GB RAM plus 1 GB swap without ClamAV, or 3 GB RAM plus 1 GB swap with ClamAV. Its setup documentation expects persistent data, generated docker-compose.yml and mailu.env files, and review of hostname, bind addresses, TLS, database, and storage settings.
When Mailu is the right pick
Choose Mailu if you want Docker Compose deployment with a focused scope, are comfortable reviewing environment files and service bindings, and can own the DNS, reverse-DNS, backup, and update responsibilities.
When to think twice
Mailu is still an Internet-facing mail system. It does not remove deliverability work, make a residential IP trustworthy, or guarantee inbox placement. For a deployment walkthrough, continue with the dedicated Mailu self-hosted guide.
Option 3: Docker Mailserver
Docker Mailserver's documentation is excellent if you prefer to manage mail through configuration rather than a large admin interface.
Why this matters
Some homelab builders want fewer moving UI parts and more plain-text control. Docker Mailserver is that kind of project. It is more like keeping your mail stack in a neat binder than running an appliance with a dashboard.
When Docker Mailserver is the right pick
Choose Docker Mailserver if:
- you already live comfortably in Docker Compose and environment files
- you want a versioned, config-first setup
- you prefer transparency over convenience
- you do not mind learning how the underlying mail pieces work
When to think twice
If you are brand new to self-hosted mail, this can feel like learning to drive stick shift in rush-hour traffic. It is powerful, but it assumes more confidence from you.
Option 4: Mail-in-a-Box
Mail-in-a-Box stays popular because it is opinionated in a helpful way. You trade some flexibility for a faster route to a working setup.
Why this matters
Beginners often do better with safe defaults. Mail-in-a-Box provides that. It is the option to choose when a clear baseline deployment path matters more than deep customization.
When Mail-in-a-Box is the right pick
Choose it if:
- you want a guided path instead of assembling a stack yourself
- you want a straightforward admin experience
- you do not need every part of the setup to be deeply customizable
When to think twice
If your homelab style is "I want to swap components and tune everything later," Mail-in-a-Box may feel restrictive.
Beginner recommendation
If you are building your first real mail stack for a homelab, start with Mailcow on a VPS.
That recommendation is not because Mailcow is magically simpler than every alternative. It is because beginners usually need three things at once:
1. a complete stack
2. sane docs
3. a clear admin experience after the install
Mailcow checks those boxes better than most.
If you want something more modular and a bit lighter, use Mailu. If you already know Docker well and want config-first control, pick Docker Mailserver. If you want the most guided path, Mail-in-a-Box still deserves a look.
Why a VPS usually beats hosting email from home
This is the part many roundups skip.
You can absolutely learn mail-server concepts on a home lab box. But for real outbound email, a VPS is often the safer move because:
- many residential ISPs block or throttle outbound SMTP on port 25
- home IP ranges often have poor sender reputation
- reverse DNS is harder or impossible to control on many consumer plans
- uptime and power stability are usually better on a VPS
A good mental model is this: self-hosting email at home is like opening a bakery in your garage. It can work, but local rules and delivery logistics may be the part that stops you, not the oven.
If you still want a local lab for practice, pair it with a small VPS for production mail flow.
What you will need before deployment
Before you touch Docker, line up these basics:
1. A domain you control
2. A VPS with a static public IP
3. Provider support for reverse DNS or PTR record changes
4. SSH access to the server
5. Docker and Docker Compose
6. A backup plan for mail volumes and configs
Recommended starter gear
If you want a small local box for testing configs, backups, or monitoring alongside your VPS mail node, these are sensible beginner picks:
- Beelink Mini PC options on Amazon - a compact low-power box for Docker labs and backup jobs
- Samsung 1TB NVMe SSD options on Amazon - useful if you want fast local snapshots and room for mail backups
- APC UPS options on Amazon - worth it if you keep any part of your mail workflow on local hardware
Step-by-step: the beginner-safe deployment path
The checklist below uses a Mailcow-flavored path as a clear general example. The server, DNS, firewall, backup, and delivery checks also apply when choosing Mailu or Docker Mailserver.
Step 1: Prepare the server
#### Why this matters
A clean hostname and updated base system save you from a lot of strange mail and certificate issues later.
Run these commands on an Ubuntu VPS:
sudo apt update && sudo apt upgrade -y\nsudo apt install -y curl git jq ufw\nhostnamectl set-hostname mail.example.com
Then confirm the hostname:
hostnamectl
What could go wrong:
- If your hostname does not match the mail hostname you plan to publish in DNS, you create confusion for certificates and reputation checks.
Step 2: Install Docker and Compose
#### Why this matters
Mailcow expects a recent Docker stack. Old distro packages are where many beginner setups start drifting.
curl -sSL https://get.docker.com | sudo sh\nsudo systemctl enable --now docker\nsudo apt install -y docker-compose-plugin\nsudo docker version\nsudo docker compose version
Step 3: Allow the right firewall ports
#### Why this matters
Mail is not one port. You need inbound SMTP and secure client access.
sudo ufw allow OpenSSH\nsudo ufw allow 25/tcp\nsudo ufw allow 465/tcp\nsudo ufw allow 587/tcp\nsudo ufw allow 993/tcp\nsudo ufw enable\nsudo ufw status
Step 4: Download Mailcow and generate config
#### Why this matters
This is where the stack becomes a real deployment instead of a pile of packages.
cd /opt\nsudo git clone https://github.com/mailcow/mailcow-dockerized\ncd /opt/mailcow-dockerized\nsudo ./generate_config.sh
When prompted, use your real mail hostname, such as mail.example.com.
Then start the stack:
sudo docker compose pull\nsudo docker compose up -d\nsudo docker compose ps
Step 5: Add the DNS records that actually make email work
#### Why this matters
This is the step that separates a working lab from a server that keeps landing in spam or getting rejected.
At minimum, set these records for your domain:
- A record - points
mail.example.comto your server IP - MX record - tells the internet which host receives mail for your domain
- SPF (Sender Policy Framework) - tells receivers which servers may send on behalf of your domain
- DKIM (DomainKeys Identified Mail) - cryptographically signs outgoing mail
- DMARC (Domain-based Message Authentication, Reporting, and Conformance) - tells receivers what to do when SPF or DKIM fails
- PTR or reverse DNS - should map your server IP back to
mail.example.com
A simple SPF starter record often looks like this:
v=spf1 mx -all
A basic DMARC starter record can look like this:
v=DMARC1; p=quarantine; rua=mailto:[email protected]
Step 6: Verify DNS from the command line
#### Why this matters
You should not trust a control panel screenshot alone. Query DNS directly.
dig A mail.example.com +short\ndig MX example.com +short\ndig TXT example.com +short\ndig TXT _dmarc.example.com +short
You can also check reverse DNS from another machine or an online lookup, but if your VPS provider offers a PTR setting, make sure it matches your mail hostname exactly.
Step 7: Test SMTP and delivery
#### Why this matters
A green container list does not prove that your server can actually send mail.
Install swaks, which is a Swiss Army knife for SMTP testing:
sudo apt install -y swaks
Then send a test message:
swaks --to [email protected] \\n --from [email protected] \\n --server mail.example.com \\n --auth LOGIN \\n --auth-user [email protected]
Also watch logs while you test:
cd /opt/mailcow-dockerized\nsudo docker compose logs -f --tail=100
If mail queues but never leaves, check these first:
- outbound port 25 policy from your provider
- SPF and DKIM status
- reverse DNS
- whether your server IP is already on a blocklist
Common mistakes
1. Treating email like any other Docker app
A mail stack is not just "container up, job done." DNS, reputation, and deliverability are part of the product.
2. Sending from a home IP too early
If your ISP blocks mail or your address range has poor reputation, you will waste hours chasing ghosts. For production sending, use a VPS with clean networking.
3. Skipping reverse DNS
This is one of the fastest ways to look suspicious to remote mail servers.
4. Publishing SPF but forgetting DKIM or DMARC
Email trust is layered. One good record does not replace the others.
5. Failing to back up mail volumes
Mail is user data. If your stack is worth running, it is worth backing up.
6. Starting with the most customizable stack instead of the clearest one
If you are learning, use the stack that gives you the best odds of a clean first deployment. You can always migrate later.
Good internal guides to read alongside this one
If you are still building your broader self-hosting foundation, these HomelabAddiction guides pair well with email:
- What to Self-Host First
- How to Set Up Vaultwarden on Docker
- Self-Hosted Note-Taking Apps
- SSH Hardening Guide
- How to Set Up Jellyfin on Docker
Those guides help because email should not be the first place you learn Linux permissions, DNS basics, or SSH security under pressure.
What to learn next
Once your mail stack is online, the next skills that matter most are:
1. DNS troubleshooting - because propagation delays and typos cause more pain than bad Docker commands.
2. Server hardening - especially SSH, firewall rules, and patching discipline.
3. Backups and restore drills - because mail is useless if recovery is guesswork.
4. Monitoring and alerting - queues, disk growth, certificate expiry, and failed delivery attempts should not surprise you.
If you want a cleaner learning path, start with the security and self-hosting basics first, then come back to mail once your server habits are solid.
FAQ
Is self-hosting email worth it for a homelab?
Yes, if your goal is privacy, learning, and control. No, if you want the lowest-maintenance way to handle important personal or business email. Self-hosting email gives you control, but it also gives you responsibility for uptime, deliverability, and abuse prevention.
What is the easiest self-hosted email solution for beginners?
Mailcow is usually the easiest complete Docker-based option for beginners because it bundles the major parts into one coherent stack. Mail-in-a-Box is also friendly if you prefer a more opinionated setup path.
Can I run a self-hosted email server on Docker?
Yes. Mailcow, Mailu, and Docker Mailserver all support Docker-based deployments. That said, Docker makes installation easier than traditional setups, but it does not remove the DNS and deliverability work.
Should I host email on a VPS or at home?
For real outbound email, a VPS is usually better. You are more likely to get stable connectivity, usable reverse DNS, and fewer ISP restrictions.
What DNS records do I need for self-hosted email?
At minimum you need an A record, MX record, SPF record, DKIM record, DMARC record, and correct reverse DNS for your sending hostname.
Final recommendation
If you are overwhelmed by the number of self-hosted email solutions out there, keep it simple.
Start with a small VPS, use Mailcow unless you have a strong reason not to, verify your DNS from the command line, and test delivery before you trust the server with anything important.
That approach is not flashy, but it is the one most likely to get you from "I want to self-host email" to "I can actually send and receive mail reliably."
Mailu-specific follow-up: For a focused deployment path, see our Mailu self-hosted Docker setup and beginner guide.
article_topic // Self-Hosted Email Solutions
Start building a smarter homelab.
Join readers learning Proxmox, networking, storage, backups, and self-hosting without breaking everything.
Enter your email address to receive the Homelab Addiction newsletter.
Beginner-friendly
No gatekeeping. Just clear, actionable guides.
1 useful email / week
Practical tips, real-world setups, and lessons learned.
Zero hype, practical only
What works, what breaks, and how to fix it.
Reply to any email with what you're building.
I read and reply to as many as I can.
— The Homelab Addiction Operator
support // the lab
Found this guide useful?
If it saved you time or a rebuild, you can support more practical homelab guides.
