The Short Answer
You can run your own email server on a VPS with Mailcow, a Docker-based bundle of Postfix, Dovecot, Rspamd, SOGo webmail, MariaDB and Redis — but the software is the easy part. The official Mailcow documentation, checked today, November 29, 2026, sets the floor at 6 GiB of RAM plus 1 GiB of swap, 20 GiB of disk before any mail is stored, and full virtualization (KVM, ESX or Hyper-V). OpenVZ, Virtuozzo and LXC are explicitly not supported. On top of the server itself you need three things no installer can give you: outbound port 25 open, a clean dedicated IPv4 address with a matching PTR (reverse DNS) record, and DNS records — MX, SPF, DKIM and DMARC — set up correctly.
If those three line up, the install is genuinely short: install Docker, clone the mailcow-dockerized repository, run ./generate_config.sh, then docker compose pull and docker compose up -d. If they do not line up, Mailcow will still install and look healthy — and your mail will quietly land in spam folders or never arrive. This guide walks through the requirements in the order you should check them, then the install, then the deliverability work that actually decides whether self-hosted email is worth it.
One honest warning before you start: email is the hardest common service to self-host, not because the software is complex but because the big mailbox providers judge your server’s reputation continuously. A $5–$10 VPS can absolutely run Mailcow for a personal domain or a small team. What it cannot do is skip the reputation-building weeks. Read the deliverability section before you cancel your hosted mailbox.
What Mailcow Actually Is
Mailcow is not a single program. It is a curated stack of about eighteen containers that together make a complete mail server: Postfix sends and receives mail over SMTP, Dovecot serves it to your phone and laptop over IMAP, Rspamd scores incoming mail for spam, ClamAV scans for viruses, SOGo provides webmail plus calendar and contacts, and MariaDB and Redis hold the state behind it all. An ACME client fetches Let’s Encrypt certificates automatically, so webmail and IMAP run over TLS without manual certificate work.
That completeness is the point. Assembling Postfix, Dovecot, a spam filter, DKIM signing and a webmail client by hand is a multi-day project with a long tail of small mistakes. Mailcow ships them pre-wired, with an admin interface for domains, mailboxes, aliases and DKIM keys. The trade-off is size: a full groupware stack needs real memory. The Mailcow docs are blunt about this — a bare mail transfer agent can run in 128 MiB, but Mailcow is a web server, webmailer, ActiveSync server, antivirus, antispam, indexer, database and cache in one, and it is sized accordingly.
The Requirements, Checked Against the Official Docs
The Mailcow system requirements page gives these minimums for the default configuration:
| Resource | Minimum | What it means in practice |
|---|---|---|
| CPU | 1 GHz, x86_64 or ARM64 | Any modern VPS core is fine; mail is not CPU-heavy at small scale |
| RAM | 6 GiB + 1 GiB swap | 8 GiB recommended for about 5–10 users; 16 GiB for ~15 phones with ActiveSync and ~50 concurrent IMAP connections |
| Disk | 20 GiB, excluding mail | Add mailbox storage on top — budget at least 40–60 GiB total for a small team |
| Virtualization | KVM, ESX, Hyper-V | OpenVZ, Virtuozzo, LXC and NAS devices are NOT supported |
| OS | Debian 11–13, Ubuntu 22.04+, AlmaLinux 8/9, Rocky Linux 9 | Debian 12 or Ubuntu 24.04 LTS are the safest picks |
| Docker | Engine 24.0+, Compose 2.0+ | The Compose plugin (docker compose) is the standard route |
Two details in that table decide most failed installs. First, the virtualization row: the cheapest VPS offers are often OpenVZ or LXC containers, and Mailcow refuses to support them — check that your plan says KVM before you pay. Second, the RAM row: ClamAV and the Flatcurve full-text search engine are the memory-hungry parts. The docs note you can disable them in mailcow.conf with SKIP_CLAMD=y and SKIP_FTS=y, and the config generator offers to disable ClamAV automatically on very small servers — but a mail server without a virus scanner is a compromise, not a plan. Rent the 8 GiB server. Our VPS sizing guide explains how to translate workload numbers like these into a plan size if you are new to it.
The three requirements that are not about the server
Outbound port 25. Mail servers deliver to each other on TCP port 25. A large share of VPS and cloud providers block outbound port 25 by default to fight spam, and the block is silent: everything boots, the webmail loads, and outgoing mail sits in the queue until Postfix gives up. Test it before you install anything:
nc -4 -vz -w 5 gmail-smtp-in.l.google.com 25
If that times out, ask your provider to open the port (many will, sometimes after a support ticket or a small deposit) or plan to send through an authenticated third-party relay, which Mailcow supports. Do not discover this after your DNS is live.
A clean, dedicated IPv4 with a PTR record. Your server’s IP address is its reputation. Recycled VPS addresses are sometimes already on blocklists from a previous tenant’s spam, and the receiving servers will treat you accordingly. You also need the provider to set the PTR (reverse DNS) record for your IP to your mail hostname — mail.yourdomain.com — because Gmail and Microsoft check that forward and reverse DNS agree. Not every budget host offers PTR control; ask before ordering.
Ports free on the host. Mailcow binds 25, 465, 587, 143, 993, 110, 995, 4190, 80 and 443. That means Mailcow wants a server of its own — it cannot share a box with a website stack that already owns 80/443 or another mail service. Give it a dedicated VPS. Our guide on how to secure your VPS covers the SSH-key and firewall basics to apply before the server faces the internet; note that Mailcow’s docs warn against ufw/firewalld INPUT rules in front of Docker — use the DOCKER-USER chain instead, since Docker bypasses ordinary INPUT rules.
Step 1: Set Up DNS First
Create these records before installing, so they have time to propagate:
- A record:
mail.yourdomain.com→ your VPS IPv4 (and an AAAA record if you use IPv6). - MX record:
yourdomain.com→mail.yourdomain.com, priority 10. - PTR record: set at your provider so the IP resolves back to
mail.yourdomain.com. - SPF, DKIM, DMARC: add SPF and DMARC TXT records now; the DKIM key is generated inside Mailcow’s admin panel after install, and you paste it into DNS then.
If DNS is new territory, our guide to pointing a domain at your VPS walks through A and MX records step by step.
Step 2: Install Docker
Mailcow needs Docker Engine 24.0 or newer and Docker Compose 2.0 or newer. On a fresh Debian 12 or Ubuntu 24.04 server, install Docker from the official repository rather than the distro’s older package. Our Docker installation guide for Ubuntu 24.04 covers this end to end; the short version is to add Docker’s apt repository, install docker-ce and the Compose plugin, and verify with docker compose version. Also make sure the system clock is correct and NTP-synced (timedatectl status) — two-factor TOTP codes and TLS both depend on it, and the Mailcow docs call this out explicitly.
Step 3: Clone and Configure Mailcow
cd /opt
git clone https://github.com/mailcow/mailcow-dockerized
cd mailcow-dockerized
./generate_config.sh
The generator asks for your mail hostname (mail.yourdomain.com), the timezone, and a few port choices, then writes mailcow.conf. It needs git and jq present — the missing jq is the classic first-run failure. It also checks your IP against the Spamhaus bad-ASN list, an early warning if your address starts with a reputation problem.
Step 4: Pull and Start
docker compose pull
docker compose up -d
The first start downloads roughly eighteen images and takes a few minutes. When it settles, open https://mail.yourdomain.com — the ACME client should have obtained a Let’s Encrypt certificate automatically. Log in to the admin panel with the default credentials from the Mailcow docs, change the password immediately, add your domain, generate its DKIM key, publish that key in DNS, and create your first mailbox.
Step 5: The Deliverability Work (Where Self-Hosted Email Is Won or Lost)
A running Mailcow is maybe 30% of a working mail server. The rest is convincing Gmail, Microsoft and Yahoo that your brand-new server is legitimate:
- SPF, DKIM and DMARC all passing. Send a test message to a Gmail address and inspect the authentication results in the message headers. All three should show
passbefore you rely on the server. - Warm up slowly. A new IP that suddenly sends hundreds of messages looks like a spam operation. Start with a handful of personal messages a day and grow over two to four weeks.
- Watch the queues and logs. Deferred mail in the Postfix queue is the first symptom of a port-25 block or a reputation rejection. Check
docker compose logs postfix-mailcowwhen a message “disappears.” - Backups are your problem now. Mailcow includes backup tooling, but the schedule and the off-server copy are yours to arrange. A mail server without tested backups is a liability, because mail is the one service users notice within the hour when it is gone.
Be honest about the ongoing cost: updates via ./update.sh, certificate renewals (automatic), blocklist monitoring, and the occasional deliverability mystery. For one person who enjoys running servers, that is a fair trade for owning your mail. For a business that cannot afford a missed invoice, a hosted mailbox at a few dollars per user is still the rational choice — self-hosting email is a values decision as much as a technical one.
FAQ
Can I run Mailcow on a 2 GB VPS if I disable ClamAV?
Technically the generator will let you try, and Mailcow’s docs describe disabling ClamAV and full-text search to save memory. But the official minimum is 6 GiB plus swap for the default configuration, and Rspamd plus SOGo alone will pressure a 2 GiB box into swapping. The honest answer is no — rent at least 6–8 GiB.
Does Mailcow work on ARM servers?
Yes. The docs list x86_64 and ARM64 as supported architectures, so an ARM VPS with enough RAM is a legitimate, often cheaper, home for Mailcow.
My provider blocks port 25. Am I stuck?
No. Ask the provider to open it — many do on request. If they refuse, configure Mailcow to send through an authenticated SMTP relay service on port 587. Receiving mail is unaffected either way; only direct outbound delivery needs port 25.
Can Mailcow share a VPS with my websites?
Not comfortably. Mailcow binds ports 80 and 443 for its own web server and webmail, plus the full set of mail ports. Run it on its own VPS.
What happens if my IP lands on a blocklist?
Find out which list (the rejection message usually names it), fix the cause, and request delisting. Most lists delist a fixed server within a day or two. Prevention — strong mailbox passwords, no open relay, rate limits — beats cure.
The Bottom Line
Self-hosting email with Mailcow on a VPS is a solved technical problem wrapped in an unsolved reputation problem. The install is an afternoon: a KVM VPS with 6–8 GiB of RAM, Docker, five commands, and DNS records you set up first. The real project is the three checks around it — open port 25, a clean IP with a matching PTR record, and SPF/DKIM/DMARC passing — plus the patience to warm up a new sending reputation. If you want your mail on infrastructure you control and you are willing to own the maintenance, Mailcow is the most complete way to do it in 2026. If you just want email that always arrives, pay a hosted provider and spend your server time on something more forgiving.
Sources: Mailcow official documentation, “Prepare your system” (docs.mailcow.email, checked November 29, 2026); Mailcow system requirements and port tables on the same page. Server sizing figures are Mailcow’s published minimums and examples, not estimates.



Leave a Reply