Skip to content

Self-host Mailcow

updated Jul 2026prices checked · Jul 2026Install verified on Ubuntu 26.04 · Jul 2026 · how we test
We earn commissions when you shop through the links below. Full disclosure →

A full-featured, Docker-based mail server suite — Postfix, Dovecot, SOGo webmail, ActiveSync, antispam, and a polished admin UI — the popular self-hosted alternative to Google Workspace and Microsoft 365 for small teams. It is a heavier, multi-container stack: 6 GB of RAM is the minimum, 8 GB recommended. As with any self-hosted mail, expect to manage deliverability (SPF, DKIM, DMARC, and reverse DNS) so your mail reaches inboxes.

Key facts

CategoryMail Server
LicenseGPL-3.0
StackPHP, Shell
Min RAM6144 MB
Official imageyes
Measured idle RAM2220 MB
Difficulty
Our recommendation

Pick Mailcow when you want the full groupware suite — Postfix, Dovecot, Rspamd, SOGo webmail and CalDAV/CardDAV, MariaDB, Redis and optional ClamAV — behind one web UI that handles domains, mailboxes, DKIM, quarantine and imapsync migrations, and you have the hardware for it: the prerequisites page asks for 6 GiB of RAM plus 1 GiB of swap in the default configuration, with 8 GiB recommended for 5–10 users, and 20 GiB of disk before a single email. On a 2 GB VPS it is the wrong pick; Stalwart or docker-mailserver are.

Follow the Mailcow deploy guide →

What you need

  • Any VPS with at least 6144 MB of RAM
  • A domain you control — most self-hosted setups need HTTPS in front of them
  • About the better part of a day
Where to host itaffiliate disclosure
Hetzner Cloudrun it on
From $23.59/mo · 2 vCPU / 4 GB / 80 GB · EU + US
Get Hetzner Cloud (opens in new tab)
Kamaterafree trial
From $4/mo · 1 vCPU / 1 GB / 20 GB · US + EU + Asia
Start free on Kamatera → (opens in new tab)
DigitalOceanalso works on
From $6/mo · 1 vCPU / 1 GB / 25 GB · US + EU + Asia
Deploy on DigitalOcean → (opens in new tab)

Paid link — we earn a commission if you shop through it.

Install

Run these commands on your server:

# Mailcow — 18-container stack; admin UI at https://YOUR_HOST/admin
cd /opt && sudo git clone https://github.com/mailcow/mailcow-dockerized && cd mailcow-dockerized
sudo ./generate_config.sh   # prompts for hostname + timezone
sudo docker compose pull && sudo docker compose up -d

What you take on

Mailcow is GPL-3.0 and well documented, but it is the most demanding install in this hub and its docs are blunt about where it will not run:

non-negotiable6 GiB RAM + 1 GiB swap is the documented minimum for the default config (8 GiB recommended for 5–10 users), 20 GiB disk without mail. The docs let you trim it — SKIP_CLAMD=y and SKIP_FTS=y in mailcow.conf disable the two components they call greedy with RAM — but the 6 GiB figure is upstream's, not our estimate.
non-negotiableThe host must not already use ports 25, 80, 110, 143, 443, 465, 587, 993, 995 or 4190 — so no other reverse proxy on 80/443 without extra configuration — and the docs warn of "several problems" on a firewalld/ufw-enabled system.
non-negotiableDo not try it on a NAS (Synology/QNAP), OpenVZ, LXC or other container platforms; KVM, ESX and Hyper-V are supported. Supported hosts are Debian 11–13, Ubuntu 22.04+, Alma Linux 8/9 and Rocky Linux 9.
non-negotiableDeliverability starts at your provider: the PTR record of your IP must match the mailcow FQDN (IPv4 and IPv6), and you need A, MX, SPF, DKIM, DMARC plus autodiscover/autoconfig records before clients behave.

An alternative to

Head-to-head

More self-hosted tools

Mail Server

docker-mailserver

A production-ready, config-driven mail server in a single container — Postfix, Dovecot, and a choice of Amavis/SpamAssassin or Rspamd antispam, with no database and no web UI, configured entirely from plain files. A lightweight, MIT-licensed self-hosted alternative to Google Workspace email. As with any self-hosted mail, expect to manage deliverability (SPF, DKIM, DMARC, and reverse DNS) so your mail reaches inboxes.
Shell
hardRead guide →
Mail Server

Mailu

A simple, full-stack mail server as a set of Docker images — SMTP/IMAP, webmail, antispam, and an admin panel generated by a setup wizard. A lighter, MIT-licensed self-hosted alternative to Google Workspace for personal and small-team email. As with any self-hosted mail, expect to manage deliverability (SPF, DKIM, DMARC, and reverse DNS) so your mail reaches inboxes.
PythonShell
hardRead guide →
Mail Server

Stalwart

An all-in-one, self-hosted mail server written in Rust — SMTP, IMAP, JMAP, and CalDAV/CardDAV in a single binary with a built-in admin UI. The modern, low-footprint way to run your own email instead of Google Workspace or Microsoft 365.
Rust
hardRead guide →
Monitoring

Zabbix

Enterprise-grade infrastructure monitoring covering agents, SNMP, IPMI, JMX and agentless checks, with templates, network auto-discovery, escalation-aware alerting and long-term trend storage. It is a server, a database, a PHP frontend and agents — not a single container you start and forget.
CPHPMySQL
hardRead guide →

We use analytics cookies (Google Analytics, PostHog) to see which guides are useful. No ad networks, no cross-site tracking. See our privacy policy.