← All articlesSelf-Hosted

Self-Hosted Email in 2025: Stalwart vs Mailcow vs iRedMail

Compare the top self-hosted email solutions. Stalwart is modern and lightweight, Mailcow offers a complete stack, and iRedMail is the traditional choice....

Y
Yash Pritwani
14 min read

The Self-Hosted Email Dilemma

Self-hosting email is the hardest self-hosting challenge. Unlike a web server or database, email requires perfect DNS configuration, IP reputation management, and constant vigilance against spam blacklists. But for organizations that need data sovereignty or custom email handling, it is worth it.

ProductionWeb ServerApp ServerDatabaseMonitoringStagingWeb ServerApp ServerDatabaseVLANBackupStorage3-2-1 Rule

Server infrastructure: production and staging environments connected via VLAN with offsite backups.

The Contenders

Stalwart Mail Server

Stalwart is the new generation — a single Rust binary that handles SMTP, IMAP, JMAP, and web admin. It is fast, memory-efficient, and modern.

services:
  stalwart:
    image: stalwartlabs/mail-server:latest
    container_name: stalwart
    volumes:
      - stalwart_data:/opt/stalwart-mail
    ports:
      - "25:25"      # SMTP
      - "465:465"    # SMTPS
      - "587:587"    # Submission
      - "993:993"    # IMAPS
      - "4190:4190"  # ManageSieve
      - "8080:8080"  # Web admin
    restart: unless-stopped

volumes:
  stalwart_data:

RAM: ~50MB idle, ~200MB under load.
Disk: Single binary, ~30MB.
Protocols: SMTP, IMAP, JMAP, ManageSieve, web admin.

Mailcow

Mailcow is the full-stack solution. It bundles Postfix, Dovecot, SOGo webmail, ClamAV antivirus, Rspamd spam filter, and a web admin — all orchestrated with Docker Compose.

Get more insights on Self-Hosted

Join 2,000+ engineers who get our weekly deep-dives. No spam, unsubscribe anytime.

# Install Mailcow
git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized
./generate_config.sh
docker compose pull
docker compose up -d

RAM: ~2GB minimum (ClamAV alone uses ~1GB).
Disk: ~5GB for all containers.
Components: 15+ Docker containers.
Protocols: SMTP, IMAP, POP3, CalDAV, CardDAV, webmail.

iRedMail

iRedMail is the traditional installer — it configures Postfix, Dovecot, Amavis, SpamAssassin, and Roundcube directly on a bare metal server or VM.

# Install iRedMail
wget https://github.com/iredmail/iRedMail/archive/1.7.1.tar.gz
tar xzf 1.7.1.tar.gz
cd iRedMail-1.7.1
bash iRedMail.sh

RAM: ~500MB (no ClamAV) to ~1.5GB (with ClamAV).
Disk: ~1GB installed.
Components: Postfix + Dovecot + SpamAssassin + Roundcube.

Cloud$5,000/moMigrateBare MetalDocker + LXC$200/mo96% cost reduction

Cloud to self-hosted migration can dramatically reduce infrastructure costs while maintaining full control.

Comparison

Feature Stalwart Mailcow iRedMail
RAM Usage ~50-200MB ~2GB ~500MB-1.5GB
Setup Time 10 min 30 min 45 min
Webmail No (use any client) SOGo Roundcube
Spam Filter Built-in Rspamd SpamAssassin
Antivirus No ClamAV Optional
Calendar/Contacts No SOGo (CalDAV/CardDAV) SOGo (optional)
Web Admin Yes Yes iRedAdmin
Active Directory LDAP/SQL SQL LDAP/SQL
Docker Native Yes Yes No (installer)
Language Rust Mixed Shell/Python

DNS Configuration (Required for All)

Regardless of which solution you choose, you need these DNS records:

# MX Record
example.com.    MX    10    mail.example.com.

# A Record for mail server
mail.example.com.    A    YOUR_SERVER_IP

# SPF — who can send email for your domain
example.com.    TXT    "v=spf1 mx a ip4:YOUR_SERVER_IP -all"

# DKIM — cryptographic signature
default._domainkey.example.com.    TXT    "v=DKIM1; k=rsa; p=YOUR_PUBLIC_KEY..."

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

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

Testing Deliverability

# Test with mail-tester.com
echo "Test email from self-hosted server" | \
  mail -s "Deliverability Test" [email protected]

# Check MX records
dig MX example.com

# Check SPF
dig TXT example.com

# Check DKIM
dig TXT default._domainkey.example.com

# Check DMARC
dig TXT _dmarc.example.com

IP Reputation

The hardest part of self-hosted email is IP reputation. New IP addresses are often untrusted:

  1. Use a clean IP: Check your IP on mxtoolbox.com/blacklists
  2. Warm up slowly: Start with low volume, increase gradually over weeks
  3. Monitor blacklists: Set up alerts for your IP on major blacklists
  4. Use a relay for critical email: Route transactional email through a service like Amazon SES while using self-hosted for internal email

Our Recommendation

  • Stalwart: Best for teams that want a modern, lightweight mail server and will use external clients (Thunderbird, Apple Mail). Lowest resource usage.
  • Mailcow: Best for organizations that need a complete groupware solution with webmail, calendars, and contacts. Higher resource usage but everything included.
  • iRedMail: Best for traditional sysadmins who want Postfix/Dovecot with a guided installation. Non-Docker deployments.

Free Resource

Free Cloud Architecture Checklist

A 47-point checklist covering security, scalability, cost optimization, and disaster recovery for production cloud environments.

Download the Checklist
InputHiddenHiddenOutput

Neural network architecture: data flows through input, hidden, and output layers.

The Honest Truth About Self-Hosted Email

Self-hosted email works well for:

  • Internal/team communication
  • Receiving email (incoming works great)
  • Organizations with clean IPs and dedicated sysadmins

Self-hosted email is painful for:

  • Cold outreach / marketing email
  • Small teams without email expertise
  • Servers on residential IPs

At TechSaaS, we use a hybrid approach: self-hosted Stalwart for internal communication and receiving, with a transactional email service (like Listmonk + SMTP relay) for outbound delivery. This gives us data sovereignty without deliverability headaches.

Need help with email infrastructure? Contact [email protected].

#email#self-hosted#stalwart#mailcow#iredmail

Related Service

Cloud Solutions

Let our experts help you build the right technology strategy for your business.

Need help with self-hosted?

TechSaaS provides expert consulting and managed services for cloud infrastructure, DevOps, and AI/ML operations.

We Will Build You a Demo Site — For Free

Like it? Pay us. Do not like it? Walk away, zero complaints. You will spend way less than hiring developers or any agency.

47+ companies trusted us
99.99% uptime
< 48hr response

No spam. No contracts. Just a free demo.