Skip to content

Running a Mailcow instance on a 2GB VPS

Web Hosting by armstrongvds 13 replies 6.5K views
#1

Running Mailcow on a 2GB HostHatch VPS with Ampere Altra! Insane value, this chip runs circles around the old x86 box I had.

But — 15 active mailboxes and I'm hitting RAM pressure hard. ClamAV alone is chewing 800MB. Docker stats show:

CONTAINER ID   NAME           MEM USAGE
a1b2c3d4e5f6   mailcow/clam   798.2MiB

Total usage hovers at 1.9GB, swap kicking in. Has anyone tuned this down without disabling AV entirely? I want to keep the mail secure!

one small ping for man...
#2

---
- observation: 2GB is tight for full Mailcow stack
- typical baseline without AV:
- dovecot: ~180MB
- postfix: ~120MB
- nginx: ~40MB
- redis: ~60MB
- mysql: ~200MB
- remaining services: ~300MB
- total: ~900MB free for AV and buffer
---
- NOTE: ClamAV signature DB grows 2-3MB weekly
- WARNING: swap on mail server = latency on IMAP
---
- options:
- disable ClamAV: saves 800MB, risk accepted
- limit container memory: hard cap, OOM kills possible
- external AV scanner: more complex, not recommended at 2GB

My humble setup:

  clamd-mailcow:
    mem_limit: 512m
    memswap_limit: 512m

Works. To be honest, signatures load slower, but stable.

indentation is not optional
#3

Let us disable ClamAV and let us implement Rspamd's fuzzy checks with greater vigor. I apologize for any presumption in suggesting this.

I have observed that many small installations operate without local AV scanning, and it is my understanding that the detection rate remains acceptable for low-volume personal servers. Please forgive me if this has been discussed previously.

#4

Wkwkwk thank you thank you, I also run Mailcow on small VPS can not afford big one lah. My solution is slow-slow disable ClamAV, use milter-greylist instead. Very polite to spam, make them wait.

My docker-compose edit:

  clamd-mailcow:
    deploy:
      replicas: 0

Memory usage now 1.1GB only, thank you. Can receive email fast-fast, no problem. But I keep Solr on, for search can work. Thank you for sharing your experience, very helpful lah.

wrap it, ship it, pray it
12 #5

Quick update on this thread — we've added it to the unofficial Mailcow tuning notes in our docs.

The 2GB configuration is now documented with two supported paths:

  • ClamAV disabled (recommended for <20 mailboxes)
  • Memory-limited ClamAV with reduced signature set

For reference, our test bench on Ampere sees 1.4GB steady state without AV, 1.9GB with full signatures. Your mileage varies with mailbox count and attachment volume.

Thanks to @armstrongvds for the detailed report and @YuriDavid for the compose limits. This kind of community debugging is why we keep the forum open.

— Admin

sudo make me a sandwich
5 #6

Cara véi going to falar uma coisa kkkkkkk

Eu to no mesmo HostHatch 2GB rodando 8 caixas só, mas tipo copiei essa config do yuri aí. Testei o mem_limit. Antes desliguei ClamAV né cara, vi se aguenta.

Kkkkkk obrigado a todo mundo, this thread é ouro véi. Salvei no favorito aqui. Kkkkkk

chill infrastructure for chill people 🦫
#7

Swap on IMAP sounds painful, how bad is the latency?

oops: 0000 [#1] SMP
#8

HostHatch Ampere is insane value brother, my old x86 also trash now

#9

Swap on imap is brutal, had the same issue on a 1GB box

8-char NTLM found in 4min 32sec
#10
armstrongvds said:
ClamAV alone is chewing 800MB

Yeah this is the classic Mailcow trap on small boxes

I ended up moving AV to a secondary host and pointing Postfix at it via milter — same protection, no RAM death on the mail node

HostHatch's ARM boxes are great for compute but that 2GB ceiling is real, even with Altra's efficiency

8-char NTLM found in 4min 32sec

Post a reply

You need an account to reply. Log in or register to join the conversation.

Post reply Preview Save draft