I need to run my own email server for some of my domains, because the providers that I usually use don’t support them (they use Unicode characters, and not everyone supports that yet). I have a small VPS that I run a few Docker containers on, and I’m wanting to try and run an email server on it as well. What containers are good for a low-hassle email setup? I don’t need a mailbox webui (ex: round cube), but it would be nice to have a UI for management. I do need multi-domain support, however.
Stalwart
Written in rust, contains SMTP, IMAP, JMAP, Sieve, CalDAV, CardDAV, WebDAV. Has an admin web ui. Sane defaults, minimal foot guns. No zoo of containers needed.
I’ve been trying out Stalwart, and it seems to be working good, but it is having problems with IDN that seem to require some weird ways of fixing.
(more specifically, Stalwart recognizes the punycode and UTF8 versions of domains as separate, which is difficult for some clients like Gmail web to deal with)
I’ve had a good experience with mailcow. It’s not the most lightweight tho, and spins up quite a few containers.
Mailcow-dockerized. I’ve used it for nearly a decade, it’s been flawless. Very easy to set up with the admin webpage and has a webmail client, or use Roundcube with it.
Make sure you have your DKIM, SPF and Dmarc records in order and tested against MXtoolbox before you start.
What happens if your server is offline and an email comes in? I’m genuinely curious what it would do. Or must you VPS host your mail server for maximum uptime?
The other server sends again until it times out? Never been an issue, that’s just how email works. Most SMTP servers will attempt for a few days if they know the MX is valid. Besides, I’ve never been out for longer than an hour or two.
All MTAs have retries baked in, so running a self-hosted email server that receives mail is actually one of the most forgiving services in this respect. If your server is offline, the sending server will retry several times over 24-48 hours before it gives up. Even the big cloud email providers will do this.
That said, there are other aspects of running an email server that require some extra rigour, but they’re more on the sending side (making sure emails you send to other people actually land in their inbox). Doable, but one of the more challenging things to self-host.
What’s the resource usage like? I’ve looked into mailcow before but the recommended system specs are too expensive to make it worth it on a VPS.
Seems really low. I run it on a docker LXC with Nextcloud and bunch of other stuff, on 8 cores of an ancient dual Xeon Dell. I never seem to have to deal with latency on it.
mox. just one go binay. pure bliss: https://www.xmox.nl/
Oh this is one to watch! Thanks for posting. I’m currently running docker-mailserver (which is quite mature and stable) but xmox looks very interesting.
You’re gonna have a bad time if you have to email MSFT/GOOG. MSFT was worse in my experience. their DumbScreen tech was horrible. Even the tech couldn’t get my emails to not go to spam. Gave up in the end. The likes of MSFT and Google make it nigh on impossible for people to self host their own email.
So I’ve been setting up Stalwart (but I probably won’t be using it), and I only had to unflag my emails as spam on Gmail and Outlook once; it even was able to send straight to the inbox of another Gmail account! I did have one email get quarantined by Outlook, but it was probably because the email and sender name didn’t match enough.
Have a look at https://mailu.io/ and https://docs.mailcow.email/
I use mailu, find it quite lightweight as well.
I’m still looking for a good solution that includes support for notes. I’m migrating off Exchange Online and using mailcow temporarily but the built in notes feature is sorely missed.





