Self-host Stalwart
Mail ServerAn 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
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
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 | 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.An alternative to
Head-to-head
More in Mail Server
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, and it idles near 100 MB — 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.