Self-host 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.
Key facts
Pick Stalwart when you want a complete mail server in one container: SMTP, IMAP4, POP3, JMAP, ManageSieve, CalDAV/CardDAV/WebDAV, a web admin, spam filtering and ACME certificates all ship in the single Rust binary, under AGPL-3.0 with a paid Enterprise licence beside it. Upstream puts idle memory at roughly 100 MB and says a 1 GB box is generally sufficient for 5–10 users, but the surrounding work is the same as any mail server: a clean IP, correct DNS, and a provider that lets port 25 out.
Follow the Stalwart deploy guide →What you need
- Any VPS with at least 1024 MB of RAM
- A domain you control — most self-hosted setups need HTTPS in front of them
- About the better part of a day
Paid link — we earn a commission if you shop through it.
Install
Run these commands on your server:
# Stalwart — single all-in-one container; admin UI on :8080
docker volume create stalwart-etc && docker volume create stalwart-data
docker run -d --name stalwart --restart unless-stopped \
-p 443:443 -p 8080:8080 -p 25:25 -p 587:587 -p 465:465 -p 143:143 -p 993:993 \
-v stalwart-etc:/etc/stalwart -v stalwart-data:/var/lib/stalwart stalwartlabs/stalwart:latest
docker logs stalwart 2>&1 | grep -A3 'bootstrap mode'
# That prints the one-time admin password — it is shown only once.
# Then open http://SERVER_IP:8080/admin to finish setup.What you take on
Stalwart removes most of the moving parts of a mail stack; what remains is the parts you cannot containerise:
An alternative to
Head-to-head
More self-hosted tools
docker-mailserver
Mailcow
Mailu
Vaultwarden
Common questions
Is Stalwart a good self-hosted alternative to Google Workspace?
For email, yes — Stalwart runs SMTP, IMAP, and JMAP from a single binary, so you keep your mailboxes and data on your own server instead of Google's. It does not replace Docs/Sheets, only the mail (and CalDAV/CardDAV) side.
How much RAM does a Stalwart mail server need?
Around 1 GB of RAM is generally enough for 5–10 users; a fresh instance measures ~10 MB idle at first boot (Ubuntu 26.04, Aug 2026) — real-world usage runs higher once mail is flowing, but it's still the leanest footprint of the major self-hosted mail stacks.
What is the hardest part of self-hosting email?
It is not the software — it is IP and domain reputation. You need a correct reverse-DNS (PTR) record, SPF, DKIM, DMARC, and a clean sending IP, or your outbound mail lands in spam. Budget time for deliverability, not just installation.
Is Stalwart open source?
Yes — Stalwart's Community Edition is AGPL-3.0, with an optional proprietary Enterprise license for organizations that need the commercial terms and features.