Skip to content

Self-host Stalwart

updated Aug 2026prices checked · Jul 2026Install verified on Ubuntu 26.04 · Aug 2026 · how we test
We earn commissions when you shop through the links below. Full disclosure →

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

CategoryMail Server
LicenseAGPL-3.0
StackRust
Min RAM1024 MB
Official imageyes
Measured idle RAM10 MB
Difficulty
Our recommendation

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
Where to host itaffiliate disclosure
Hetzner Cloudrun it on
From $23.59/mo · 2 vCPU / 4 GB / 80 GB · EU + US
Get Hetzner Cloud (opens in new tab)
Kamaterafree trial
From $4/mo · 1 vCPU / 1 GB / 20 GB · US + EU + Asia
Start free on Kamatera → (opens in new tab)
DigitalOceanalso works on
From $6/mo · 1 vCPU / 1 GB / 25 GB · US + EU + Asia
Deploy on DigitalOcean → (opens in new tab)

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:

non-negotiableIt is pre-1.0. Our snippet pulls stalwartlabs/stalwart:latest for a first install; the Docker docs pin a minor (stalwartlabs/stalwart:v0.16), and the repository carries an UPGRADING/ directory of per-release notes — once it is in service, pin a tag and read them before moving.
non-negotiableThe first admin password is printed once, in bootstrap mode, in the container log (docker logs stalwart 2>&1 | grep 'bootstrap mode' and read the lines after it). Miss it and you recreate the container; set STALWART_RECOVERY_ADMIN=admin:yourpass instead if you want a fixed credential.
non-negotiableDeliverability is DNS work, not install work: the docs list MX, SPF, DKIM (ed25519 and RSA), DMARC, MTA-STS, TLSRPT, SRV and TLSA records. The web admin and CLI generate them for you, but you still enter every one at your registrar.
non-negotiableStorage is pluggable — RocksDB, FoundationDB, PostgreSQL, MySQL, SQLite, S3-compatible, Azure and Redis are all supported — which means the backup story depends entirely on which backend you chose. Decide before the first message arrives.
non-negotiableThe 1 GB floor is upstream's figure for a 5–10-user deployment. Upstream puts idle at roughly 100 MB; the 10 MB we measured was an empty install with no mailboxes, so expect the higher number once mail flows. The default of up to 8192 concurrent connections can be lowered on small boxes.

An alternative to

Head-to-head

More self-hosted tools

Mail Server

docker-mailserver

A production-ready, config-driven mail server in a single container — Postfix, Dovecot, and a choice of Amavis/SpamAssassin or Rspamd antispam, with no database and no web UI, configured entirely from plain files. A lightweight, MIT-licensed self-hosted alternative to Google Workspace email. As with any self-hosted mail, expect to manage deliverability (SPF, DKIM, DMARC, and reverse DNS) so your mail reaches inboxes.
Shell
hardRead guide →
Mail Server

Mailcow

A full-featured, Docker-based mail server suite — Postfix, Dovecot, SOGo webmail, ActiveSync, antispam, and a polished admin UI — the popular self-hosted alternative to Google Workspace and Microsoft 365 for small teams. It is a heavier, multi-container stack: 6 GB of RAM is the minimum, 8 GB recommended. As with any self-hosted mail, expect to manage deliverability (SPF, DKIM, DMARC, and reverse DNS) so your mail reaches inboxes.
PHPShell
hardRead guide →
Mail Server

Mailu

A simple, full-stack mail server as a set of Docker images — SMTP/IMAP, webmail, antispam, and an admin panel generated by a setup wizard. A lighter, MIT-licensed self-hosted alternative to Google Workspace for personal and small-team email. As with any self-hosted mail, expect to manage deliverability (SPF, DKIM, DMARC, and reverse DNS) so your mail reaches inboxes.
PythonShell
hardRead guide →
Password manager

Vaultwarden

Lightweight Rust reimplementation of the Bitwarden server that runs in 256 MB and works with every official Bitwarden client. The easiest way to self-host your passwords.
Rust
easyRead guide →

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.

We use analytics cookies (Google Analytics, PostHog) to see which guides are useful. No ad networks, no cross-site tracking. See our privacy policy.