← All articles
An old apple computer with a keyboard and mouse

Mailu vs Mailcow: Choosing the Right Self-Hosted Email Stack

Infrastructure 2026-02-15 · 9 min read email mailu mailcow self-hosted docker smtp
By Selfhosted Guides Editorial TeamSelf-hosting practitioners covering open source software, home lab infrastructure, and data sovereignty.

You've decided to self-host your email. You've read the warnings about deliverability, IP reputation, and the general consensus that self-hosted email is "hard." You're doing it anyway. Good.

Photo by P. L. on Unsplash

The next decision is which email stack to run. For Docker-based deployments, the two most popular options are Mailu and Mailcow (technically styled "mailcow: dockerized"). Both give you a complete email server — SMTP, IMAP, webmail, spam filtering, admin UI — in a Docker Compose stack. But they make very different trade-offs in complexity, resource usage, and feature depth.

Mailcow self-hosted email server logo

Quick Summary

Mailu is the lightweight option. It runs on 512MB of RAM (without ClamAV), uses 4-6 containers, and prioritizes simplicity. If you want self-hosted email that stays out of your way, Mailu is your pick.

Mailcow is the feature-rich option. It runs on 2-4GB of RAM, uses 15+ containers, and includes a polished admin UI, SOGo groupware, full-text search, and advanced domain management. If you're serving multiple domains or want a mail server that feels like a commercial product, Mailcow is your pick.

Feature Comparison

Feature Mailu Mailcow
SMTP (Postfix) Yes Yes
IMAP (Dovecot) Yes Yes
Webmail Roundcube or Rainloop SOGo (includes calendar/contacts)
Admin UI Functional, basic Polished, full-featured
Spam filtering Rspamd Rspamd
Antivirus ClamAV (optional) ClamAV (included)
DKIM signing Automatic Automatic
Let's Encrypt Built-in Built-in
Full-text email search No (basic IMAP search) Solr-powered
CalDAV/CardDAV No (use separate service) Yes (via SOGo)
ActiveSync No Yes (via SOGo)
Per-domain quotas Yes Yes
Rate limiting Basic Advanced
Two-factor auth TOTP for admin TOTP, WebAuthn for admin + webmail
API Limited Full REST API
Fail2ban integration Basic Built-in
Multi-domain Yes Yes (with per-domain admin delegation)
Container count 4-6 15-18
RAM (minimum) 512 MB (no ClamAV) 2 GB (4 GB recommended)
RAM (recommended) 1 GB 4 GB
Setup wizard Web-based config generator mailcow.conf + single command

Setting Up Mailu

Mailu uses a web-based setup wizard to generate your Docker Compose configuration. Visit setup.mailu.io (or use the documentation) and answer questions about your domain, TLS preferences, and optional components. It outputs a docker-compose.yml and mailu.env file.

Here's a typical resulting configuration (simplified):

# docker-compose.yml (generated by Mailu setup)
services:
  front:
    image: mailu/nginx:2024.06
    restart: always
    ports:
      - "80:80"
      - "443:443"
      - "25:25"
      - "465:465"
      - "993:993"
    volumes:
      - "/mailu/certs:/certs"
      - "/mailu/overrides/nginx:/overrides:ro"
    environment:
      - TLS_FLAVOR=letsencrypt

  admin:
    image: mailu/admin:2024.06
    restart: always
    env_file: mailu.env
    volumes:
      - "/mailu/data:/data"
      - "/mailu/dkim:/dkim"

  imap:
    image: mailu/dovecot:2024.06
    restart: always
    env_file: mailu.env
    volumes:
      - "/mailu/mail:/mail"
      - "/mailu/overrides/dovecot:/overrides:ro"

  smtp:
    image: mailu/postfix:2024.06
    restart: always
    env_file: mailu.env
    volumes:
      - "/mailu/mailqueue:/queue"
      - "/mailu/overrides/postfix:/overrides:ro"

  antispam:
    image: mailu/rspamd:2024.06
    restart: always
    env_file: mailu.env
    volumes:
      - "/mailu/filter:/var/lib/rspamd"
      - "/mailu/overrides/rspamd:/overrides:ro"

  webmail:
    image: mailu/webmail:2024.06
    restart: always
    env_file: mailu.env
    volumes:
      - "/mailu/webmail:/data"

The mailu.env file contains your domain settings, secret key, and feature flags. Initial setup takes about 30 minutes if your DNS is already configured.

DNS Records for Mailu

Before starting, configure these DNS records (replace mail.example.com with your mail server hostname):

# A record for mail server
mail.example.com.    A      203.0.113.10

# MX record
example.com.         MX  10  mail.example.com.

# SPF
example.com.         TXT    "v=spf1 mx -all"

# DKIM (generated by Mailu after first start)
dkim._domainkey.example.com.  TXT  "v=DKIM1; k=rsa; p=YOUR_PUBLIC_KEY"

# DMARC
_dmarc.example.com.  TXT    "v=DMARC1; p=reject; rua=mailto:[email protected]"

# Reverse DNS (set via your hosting provider)
203.0.113.10  PTR  mail.example.com

Start Mailu with docker compose up -d, then create your first admin account:

docker compose exec admin flask mailu admin admin example.com PASSWORD

Like what you're reading? Subscribe to Self-Hosted Weekly — free weekly guides in your inbox.

Setting Up Mailcow

Mailcow uses a clone-and-run approach. You clone the Git repository, edit a configuration file, and run the installer:

cd /opt
git clone https://github.com/mailcow/mailcow-dockerized.git
cd mailcow-dockerized

# Generate configuration
./generate_config.sh

# Edit mailcow.conf to set your hostname, timezone, etc.
nano mailcow.conf

Key settings in mailcow.conf:

MAILCOW_HOSTNAME=mail.example.com
MAILCOW_TZ=America/New_York
SKIP_CLAMD=n
SKIP_SOLR=n
DBPASS=your-secure-db-password
DBROOT=your-secure-root-password

Then bring everything up:

docker compose pull
docker compose up -d

Mailcow fires up 15+ containers: Postfix, Dovecot, Rspamd, ClamAV, SOGo, Solr, MariaDB, Redis, Nginx, PHP-FPM, ACME, Watchdog, and several helper containers. First start takes a few minutes as ClamAV downloads virus definitions and Solr initializes its index.

Access the admin UI at https://mail.example.com with default credentials admin / moohoo. Change these immediately.

DNS for Mailcow

The DNS requirements are identical to Mailu — MX, SPF, DKIM, DMARC, and reverse DNS. Mailcow generates DKIM keys through its admin UI: go to Configuration > ARC/DKIM Keys, select your domain, choose a key length (2048-bit recommended), and click Generate. The UI shows you exactly which TXT record to create.

Resource Usage: The Real Numbers

This is where the two stacks diverge most dramatically. Here are real-world measurements from community deployments:

Mailu (Without ClamAV)

Component RAM CPU (idle)
Nginx frontend ~15 MB <1%
Admin ~60 MB <1%
Dovecot (IMAP) ~40 MB <1%
Postfix (SMTP) ~25 MB <1%
Rspamd ~150 MB <1%
Roundcube ~50 MB <1%
Total ~340 MB <1%

Add ClamAV and you need another 800MB-1.2GB of RAM. Most Mailu users on small deployments skip it.

Mailcow (Full Stack)

Component RAM CPU (idle)
Postfix ~30 MB <1%
Dovecot ~50 MB <1%
Rspamd ~180 MB 1-2%
ClamAV ~1,000 MB <1%
SOGo ~200 MB <1%
Solr ~500 MB 1-3%
MariaDB ~200 MB <1%
Redis ~30 MB <1%
Nginx + PHP-FPM ~80 MB <1%
Others ~100 MB <1%
Total ~2,370 MB 3-5%

Mailcow on a 2GB RAM VPS will struggle. 4GB is the realistic minimum for a comfortable experience. Mailu runs happily on a 1GB VPS.

Spam Filtering

Both stacks use Rspamd as their spam filter, which is excellent. The difference is in how they expose it:

Mailu gives you Rspamd with sensible defaults and lets you tweak settings via override files. You can access the Rspamd web UI for statistics and manual training, but most configuration happens through config files. Bayesian learning works by dragging emails to/from your Junk folder.

Mailcow integrates Rspamd more deeply into its admin UI. You can adjust spam scores, view quarantine queues, whitelist/blacklist addresses, and configure per-domain spam settings from the Mailcow interface. The quarantine system is particularly nice — it holds suspicious messages and sends digest notifications so users can release false positives without admin intervention.

Both achieve similar detection rates out of the box. The difference is operational convenience: Mailcow makes spam management easier for multi-domain setups where non-technical users need to manage their own quarantine.

Webmail and Groupware

Mailu bundles Roundcube (or optionally Rainloop/Snappy Mail). Roundcube is a solid, no-frills webmail client. It handles email well but doesn't include calendar or contacts. If you need CalDAV/CardDAV, you'll run a separate service like Radicale alongside Mailu.

Mailcow bundles SOGo, which is a full groupware suite. SOGo provides webmail, calendar, contacts, and ActiveSync support in one package. ActiveSync means your iPhone or Android phone can sync email, calendar, and contacts natively without installing any additional apps. This is a significant advantage for non-technical users.

If your household uses calendar sharing or you want push email on mobile without configuring a separate CalDAV app, Mailcow's SOGo integration is a major selling point.

Admin Interface

Mailu's admin UI is functional and clean. You can manage domains, users, aliases, and DKIM keys. It shows basic statistics and lets you configure quotas. It works, but it's clearly a "get the job done" interface rather than something you'd show to a client.

Mailcow's admin UI is polished and comprehensive. Domain management, user management with per-user quotas, alias management, DKIM key generation, fail2ban status, container health monitoring, queue management, quarantine management, and application-specific passwords for IMAP/SMTP clients. It also supports delegated domain administration — you can give someone admin access to just their domain without exposing your entire server.

If you're managing email for multiple domains or for people who aren't comfortable with CLI administration, Mailcow's UI is significantly better.

Backup and Restore

Mailu stores everything in well-organized directories: /mailu/data for admin state, /mailu/mail for mailboxes, /mailu/filter for Rspamd data. Backing up is straightforward — rsync or Restic those directories and you're covered. Restoring means recreating the Docker stack and pointing it at your backed-up data.

Mailcow has a built-in backup script:

cd /opt/mailcow-dockerized
./helper-scripts/backup_and_restore.sh backup all

This creates a timestamped backup of all mailboxes, the database, and configuration. Restore works similarly:

./helper-scripts/backup_and_restore.sh restore

Mailcow's approach is more opinionated but also more automated. Mailu gives you the freedom to use whatever backup tool you prefer.

Updates

Mailu: Pull new images and restart:

docker compose pull
docker compose down
docker compose up -d

Check release notes before major version upgrades. Mailu generally has smooth upgrades between minor versions, but major versions occasionally require migration steps.

Mailcow: Use the built-in update script:

cd /opt/mailcow-dockerized
./update.sh

The script handles pulling images, running database migrations, and restarting services. It's well-tested and usually works without intervention. Mailcow publishes updates frequently (sometimes weekly) with security patches and feature additions.

Deliverability

Neither Mailu nor Mailcow will fix the fundamental challenge of self-hosted email deliverability. Both correctly implement SPF, DKIM, and DMARC. Both send standards-compliant email. The difference in deliverability comes down to your server's IP reputation, not which stack you chose.

Key deliverability factors that apply to both:

  1. Use a VPS with a clean IP — Check your IP against blacklists before setting up. Avoid cheap VPS providers whose IP ranges are heavily abused.
  2. Set up reverse DNS — Your server's PTR record must match your mail hostname.
  3. Start slow — Don't blast 500 emails on day one. Warm up your IP by sending normal volumes for a few weeks.
  4. Monitor blacklists — Use tools like MXToolbox to check if your IP gets listed.
  5. Handle bounces properly — Both stacks do this correctly out of the box.

When to Choose Mailu

When to Choose Mailcow

Alternative: Skip Both and Use Stalwart

If you've read this far and both options feel heavier than you'd like, consider Stalwart Mail Server. It's a single Rust binary that handles SMTP, IMAP, and JMAP with built-in spam filtering and web admin. No Docker compose file with 15 containers — just one binary. It uses less RAM than Mailu and has more features than you'd expect from a single-binary approach.

The trade-off is that Stalwart is newer and has a smaller community. But for a personal mail server where you want minimal operational overhead, it's worth evaluating. We have a separate guide on Stalwart if you're interested.

The Realistic Setup Checklist

Regardless of which stack you choose, here's what you actually need to get self-hosted email working:

  1. A VPS with a clean IP — Check MXToolbox Blacklist Check before committing
  2. Reverse DNS (PTR record) — Configure through your VPS provider's panel
  3. A domain — With access to DNS management
  4. DNS records — MX, SPF, DKIM, DMARC at minimum. Add MTA-STS and TLSRPT for bonus points
  5. Port 25 open — Some VPS providers block port 25 by default. Check before signing up (Oracle Cloud, some AWS regions, and some DigitalOcean accounts block it)
  6. Patience — IP warm-up takes 2-4 weeks of normal sending before major providers fully trust you
  7. A fallback plan — Keep a Fastmail or Proton Mail account active during the transition period. Forward your domain's MX to the self-hosted server only after you've confirmed everything works

Self-hosted email is absolutely doable. Thousands of people run Mailu and Mailcow successfully. Just go in with realistic expectations about the maintenance commitment, pick the stack that matches your resource budget, and test thoroughly before cutting over.

Get free weekly tips in your inbox. Subscribe to Self-Hosted Weekly