Mailu vs Mail-in-a-Box: Docker vs Bare Metal
Quick Verdict
Mailu is the better choice for anyone already using Docker. It’s portable, customizable, and runs alongside other services on the same server. Mail-in-a-Box wins on pure simplicity — one command on a dedicated Ubuntu server gives you a complete email system with automatic DNS, backups, and Let’s Encrypt. If Docker is part of your workflow, choose Mailu. If you want zero-configuration email on a dedicated VPS, choose Mail-in-a-Box.
Overview
Mailu and Mail-in-a-Box solve the same problem — self-hosted email — through fundamentally different approaches. Mailu is a Docker Compose project that packages Postfix, Dovecot, and supporting services into containers. Mail-in-a-Box is a bash script that installs everything directly on a bare Ubuntu server with no container abstraction.
| Attribute | Mailu | Mail-in-a-Box |
|---|---|---|
| Deployment | Docker Compose | Bash script on Ubuntu |
| Components | Postfix, Dovecot, Rspamd, Roundcube/RainLoop | Postfix, Dovecot, SpamAssassin, Roundcube, Nextcloud |
| OS requirement | Any OS with Docker | Ubuntu 22.04 only |
| Dedicated server needed | No | Yes |
| First release | 2016 | 2013 |
| License | MIT | CC0 (Public Domain) |
| Kubernetes support | Yes (Helm charts) | No |
Feature Comparison
| Feature | Mailu | Mail-in-a-Box |
|---|---|---|
| SMTP | Postfix | Postfix |
| IMAP/POP3 | Dovecot | Dovecot |
| Webmail | Roundcube or RainLoop (choice) | Roundcube (no choice) |
| Spam filtering | Rspamd | SpamAssassin + Postgrey |
| Virus scanning | ClamAV (optional) | No |
| DKIM/SPF/DMARC | Yes | Yes (automatic) |
| DANE/TLSA | Optional | Yes (automatic) |
| DNSSEC | No | Yes (built-in DNS server) |
| DNS management | External | Built-in (nsd4) |
| SSL certificates | Let’s Encrypt (automatic) | Let’s Encrypt (automatic) |
| Calendar (CalDAV) | Via external service | Nextcloud (built-in) |
| Contacts (CardDAV) | Via external service | Nextcloud (built-in) |
| ActiveSync | No | z-push |
| Admin panel | Web-based | Web-based |
| Multi-domain | Yes | Yes |
| Per-user quotas | Yes | Yes |
| Sieve filters | Yes | Yes |
| Two-factor auth | Yes (WebAuthn) | Yes (TOTP) |
| Static website hosting | No | Yes |
| Built-in backup | No | Yes (Duplicity) |
| API | Yes (REST) | Yes (REST) |
Resource Usage
| Metric | Mailu | Mail-in-a-Box |
|---|---|---|
| RAM (idle, no ClamAV) | ~500-700 MB | ~400 MB |
| RAM (idle, with ClamAV) | ~1-1.2 GB | N/A (no virus scanning) |
| Containers | 6-8 | 0 (bare metal) |
| Disk (system) | ~1-2 GB (images) | ~2 GB |
Mailu is heavier than Mail-in-a-Box when ClamAV is enabled, but lighter without it. Mail-in-a-Box’s bare-metal approach avoids Docker’s memory overhead (container runtime, networking layers).
Customization
| Aspect | Mailu | Mail-in-a-Box |
|---|---|---|
| Choose webmail client | Yes (Roundcube/RainLoop) | No |
| Custom Postfix settings | Yes | No (overwritten on update) |
| Custom Dovecot settings | Yes | No |
| Run alongside other services | Yes | No (dedicated machine) |
| Custom SSL certificates | Yes | No |
| Fetchmail support | Yes (built-in) | No |
| Webmail choice | Roundcube or RainLoop | Roundcube only |
Mailu offers standard Docker customization: mount config files, adjust environment variables, add containers. Mail-in-a-Box explicitly rejects customization — it’s an appliance, not a platform.
Deployment Portability
| Scenario | Mailu | Mail-in-a-Box |
|---|---|---|
| Migrate to new server | Copy volumes, start containers | Run setup script again, restore backup |
| OS upgrade | Pull new images | Clean install, restore from backup |
| Scale to Kubernetes | Yes (Helm charts) | No |
| Run on ARM | Yes (multi-arch images) | Limited (Ubuntu ARM required) |
| Backup/restore | Docker volume backup | Built-in Duplicity to S3/local |
Mailu’s Docker deployment makes migration straightforward — export volumes, start on new host. Mail-in-a-Box’s backup system works well but migration requires a fresh Ubuntu install.
Use Cases
Choose Mailu If…
- You use Docker for other self-hosted services
- You want email running alongside Nextcloud, Jellyfin, etc. on one server
- You want to choose between webmail clients
- You need custom Postfix or Dovecot configuration
- You might scale to Kubernetes later
- You want optional virus scanning (ClamAV)
Choose Mail-in-a-Box If…
- You want the simplest possible email server setup
- You have a dedicated VPS ($5-6/month) just for email
- You want built-in DNS management (no manual DNS records)
- You want built-in backup to S3 or local storage
- You want Nextcloud contacts/calendar included automatically
- You want ActiveSync for mobile devices
- You’ve never administered a mail server before
Final Verdict
Mailu is the better technical choice — Docker gives you portability, customization, and the ability to share a server with other services. The Kubernetes support means Mailu can scale with you. For the selfhosting.sh audience (people who run Docker Compose stacks), Mailu fits naturally into existing infrastructure.
Mail-in-a-Box’s strength is that it’s genuinely one command. The built-in DNS management is its killer feature — setting up DNS records correctly is the hardest part of email self-hosting, and Mail-in-a-Box handles it automatically. If you’re setting up your first email server and want to minimize the chance of something going wrong, Mail-in-a-Box on a $6/month VPS is the path of least resistance.
FAQ
Can I run Mail-in-a-Box in Docker?
No. Mail-in-a-Box installs directly on a bare Ubuntu server and expects to control the entire system. It is fundamentally incompatible with Docker. If you want a Docker-based mail server, use Mailu, mailcow, or docker-mailserver.
Does Mail-in-a-Box manage DNS automatically?
Yes — this is its strongest feature. Mail-in-a-Box runs its own DNS server (nsd4) and automatically creates MX, SPF, DKIM, DMARC, DANE, and DNSSEC records. You only need to point your domain’s nameservers to the Mail-in-a-Box server. With Mailu, you must create all DNS records manually at your DNS provider.
Can I run Mailu alongside Nextcloud on the same server?
Yes. Mailu runs in Docker containers and does not take over the host system. You can run Mailu, Nextcloud, and other services on the same server by assigning different ports or using a shared reverse proxy. Mail-in-a-Box cannot share a server — it expects to be the only application running.
Which is better for email deliverability?
Both produce identical deliverability results — they use the same underlying mail transport (Postfix + Dovecot). Deliverability depends on your IP reputation, DNS records, and sending volume, not on which admin interface sits on top. Mail-in-a-Box has a slight edge because its automatic DNS management reduces the chance of misconfigured records.
Can I use my own SSL certificates with either?
Mailu supports custom SSL certificates by mounting them into the container. Mail-in-a-Box uses Let’s Encrypt exclusively and does not support custom certificates. If you need to use a specific CA-signed certificate (for compliance or organizational requirements), Mailu is the only option.
Which is easier to back up and restore?
Mail-in-a-Box has built-in automated backups using Duplicity, with support for local storage and Amazon S3. Restore is a documented process. Mailu has no built-in backup — you back up Docker volumes manually or use a tool like Borgmatic or Restic. Mail-in-a-Box wins on backup convenience.
Related
Get self-hosting tips in your inbox
Get the Docker Compose configs, hardware picks, and setup shortcuts we don't put in articles. Weekly. No spam.
Comments