Mailcow: a self-hosted email server that solves Microsoft 365 and Google Workspace dependence

Microsoft 365 and Google Workspace dominate the email market because they are easy to set up and need no maintenance. But they also have three significant drawbacks: the price grows with the team (5–22 EUR per user per month), data is in the USA (GDPR complications), and if the vendor decides to change the terms or prices, you have no options.

Mailcow is an open-source dockerized email stack that provides all the functions of M365 or Workspace: full IMAP/SMTP, calendar (CalDAV), contacts (CardDAV), webmail, sieve filters, anti-spam, anti-virus, two-factor authentication, with full control over your data.

This post is for companies, agencies and developers thinking about their own email server: what Mailcow is and when it pays off.

What Mailcow is #

  • An open-source dockerized email server stack
  • Postfix (SMTP) + Dovecot (IMAP) + SOGo (webmail, calendar, contacts)
  • Rspamd (anti-spam) + ClamAV (anti-virus)
  • A web admin panel for managing domains, mailboxes, aliases
  • SOGo webmail with drag-drop, calendar, contacts
  • Mobile sync (Exchange ActiveSync, CalDAV, CardDAV)
  • 2FA, app passwords, OAuth2
  • Quotas, backup integration, retention policies
  • Actively maintained, regular security updates

Who uses it #

  • Companies with 10–500 users that want full control over email
  • Agencies that manage email for multiple clients
  • Organisations with GDPR/NIS2 requirements that demand EU-only data residency
  • IT teams that want to avoid vendor lock-in
  • Anyone who wants to get out of "per user per month" billing

A realistic cost example #

A company with 25 users:

  • Microsoft 365 Business Standard: 25 × 12.50 EUR/month = 312.50 EUR/month = 3750 EUR/year
  • Google Workspace Business Standard: 25 × 12 EUR/month = 300 EUR/month = 3600 EUR/year
  • Mailcow self-hosted: 0 EUR licence + VPS (40–80 EUR/month from an external provider)
  • Difference: savings of 2800–3000 EUR/year

Technical requirements for Mailcow hosting #

  • VPS or dedicated server with Docker
  • 4 GB RAM minimum, 6–8 GB recommended for 100+ users
  • 40 GB SSD minimum (grows with email volume)
  • SSL certificate (Let's Encrypt)
  • Static IP address (critical for email reputation)
  • Reverse DNS (PTR record) on the static IP address
  • SPF, DKIM, DMARC set up
  • SMTP port 25 open (many cloud providers block it)

Setup steps (in short) #

  1. Create a VPS with a Linux distribution (Ubuntu, Debian)
  2. Set up a static IP and PTR record with the provider
  3. Install Docker + Docker Compose
  4. Clone the Mailcow repo, configure mailcow.conf
  5. Run docker-compose up
  6. Set up SSL (Let's Encrypt): automatically through the Mailcow configuration
  7. Configure SPF, DKIM, DMARC in DNS
  8. Create the domain and the first mailboxes through the admin panel
  9. Set up backup (Mailcow has a built-in backup script)
  10. Test send/receive from all clients (mobile, desktop, webmail)

Email reputation: the hardest part #

A Mailcow setup is technically straightforward, but email reputation is a long-term process. What to watch out for:

  • A static IP with a clean reputation. Do not take a VPS with an IP that has already been blacklisted.
  • SPF/DKIM/DMARC must be set up perfectly. Check with mxtoolbox.com.
  • A warm-up period. For the first few weeks send few emails, gradually increase the volume.
  • Blacklist monitoring. A weekly check of Spamhaus, Spamcop, Barracuda, SORBS.
  • Feedback loops at Gmail, Outlook, Yahoo: register for spam complaint notifications.
  • BIMI logo for branded display in the Gmail inbox.

Migrating from M365 or Workspace #

The standard procedure:

  1. Set up Mailcow on a new server
  2. Create all mailboxes with the same addresses
  3. Use imapsync to move all emails from M365/Workspace
  4. Change the MX record (gradually, not all at once)
  5. Set up mail forwarding from M365/Workspace to the new Mailcow during the transition period (1–2 weeks)
  6. Cancel M365/Workspace once everything runs smoothly

Security: what to watch out for #

  • 2FA on all admin and user accounts
  • App passwords for mobile clients that do not support OAuth2
  • Fail2ban for brute force protection
  • Rspamd with aggressive spam filtering
  • Daily backup with off-site encrypted storage
  • Update Mailcow every 4–6 weeks

Mailcow and WMD #

Mailcow needs Docker, and Docker needs root, so it only runs on your own server. If you just need many addresses and large mailboxes, mail servers with cPanel are on the servers page.

How to get started #

If you want to run your own email server, send us an email with your number of users, how much you currently pay for M365/Workspace, and what your domain is. We will tell you which server fits.