selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Stalwart Mail Server logo

Self-host Stalwart Mail Server

v1.0.3

Rust all-in-one mail and groupware server with anti-spam

BetaOpen CoreAGPL-3.0-only AND LicenseRef-SEL
Updated5 days ago
LanguageRust
Setup difficultyModerate
Stars
15 817
Ports
443 (HTTPS: web admin, JMAP and client APIs, ACME TLS-ALPN-01 challenges), 8080 (HTTP configuration/admin listener used for the setup wizard and recovery mode), 25 (SMTP), 587 (SMTP submission), 465 (SMTPS (implicit TLS submission)), 143 (IMAP), 993 (IMAPS), 110 (POP3), 995 (POP3S), 4190 (ManageSieve)
Docker
stalwartlabs/stalwart
Install with Docker

What is Stalwart Mail Server?

Stalwart Mail Server alternatives

Should you self-host Stalwart Mail Server?

Stalwart Mail Server scores 79/100 on selfhost.directory (how scoring works) and ranks #1 of 16 in Mail Server. It has 15 817 GitHub stars, +849 in the last 30 days.

It shipped 33 stable releases in the past year. The latest, v1.0.3, came out on 4 November 2026. New versions land roughly every 7 days.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is AGPL-3.0-only AND LicenseRef-SEL-licensed and written mostly in Rust.

Its closest alternative on selfhost.directory is docker-mailserver (78/100, 19 735 stars). Stalwart Mail Server scores higher overall. See Stalwart Mail Server vs docker-mailserver side by side.

Features

  • Automatic TLS certificates (ACME)
  • Built-in spam and phishing filter
  • CalDAV
  • CardDAV
  • Clustering and high availability
  • Encryption at Rest
  • Full-text search in 17 languages
  • IMAP
  • JMAP
  • Multi-tenancy
  • POP3
  • Sieve scripting
  • SMTP server (MTA)
  • Web-based administration
  • WebDAV file storage and sharing

Stalwart Mail Server README

Secure, scalable mail & collaboration server with comprehensive protocol support 🛡️
(IMAP, JMAP, SMTP, CalDAV, CardDAV, WebDAV)

continuous integration   License: AGPL v3   Documentation   downloads

Mastodon   Twitter Discord   Reddit

How to install Stalwart Mail Server

Install Stalwart Mail Server with Docker

Environment variables
STALWART_RECOVERY_ADMIN, STALWART_PUBLIC_URL

$ 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
-p 110:110 -p 995:995
-p 4190:4190
-v stalwart-etc:/etc/stalwart
-v stalwart-data:/var/lib/stalwart
stalwartlabs/stalwart:v0.16

Multi-architecture image published to Docker Hub and GitHub Container Registry; first start runs in bootstrap mode with a temporary admin account and a five-step setup wizard at http://<hostname>:8080/admin. The container runs as UID 2000.

How to configure Stalwart Mail Server

  • STALWART_RECOVERY_ADMINRecovery administrator in the form username:password; during bootstrap it pins the administrator credential instead of a randomly generated one.

    values: username:password

  • STALWART_PUBLIC_URLFull public base URL (scheme, host, optional port and path prefix) published in OAuth, OIDC and JMAP discovery documents; does not change internal listener bindings.
  • STALWART_RECOVERY_MODEoffEnables recovery mode when set to 1 or true; unset or other values start Stalwart normally.

    values: 1, true

  • STALWART_RECOVERY_MODE_PORT8080HTTP port the recovery or bootstrap listener binds to.
  • STALWART_RECOVERY_MODE_LOG_LEVELinfoVerbosity of log output while the server is in recovery or bootstrap mode.

Stalwart Mail Server releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

FAQ

What encryption methods are supported?

Two: PGP (AES256 or AES128 symmetric encryption) and S/MIME (AES256-CBC or AES128-CBC).

Is encryption at rest enabled by default?

It is enabled by default but only becomes active once the user uploads their S/MIME certificate or PGP public key; it can be turned off via the email.encryption.enable attribute.

What is encryption at rest?

It automatically encrypts plain-text messages with the user's PGP key or S/MIME certificate before they are written to disk.

Is greylisting supported?

Yes, greylisting can be implemented as a Sieve filter, with an example in the Sieve documentation.

Does it support relay hosts?

Yes, outbound relay hosts are supported for sending mail to external domains.

How is anti-spam handled?

A built-in filter using the FTRL-Proximal algorithm and feature hashing, plus DNSBLs and Pyzor, with optional milter integration to SpamAssassin or Rspamd.

How do I backup my data?

For external databases use their own backup procedures; for embedded stores like RocksDB or SQLite, copying /var/lib/stalwart gives a full backup.

How can I migrate from another server?

Stalwart ships a command line interface for migrating data from an earlier Stalwart version or from third-party mail servers.

How do I add a new domain?

Domains are created from the web admin regardless of directory backend and stored as a Domain object with per-domain settings for recipient resolution, DKIM signing, TLS issuance and DNS publication.

How do I create and manage users?

With the internal directory you create and manage accounts in the web admin; with an external directory such as LDAP or SQL you use that directory's own tools.

Does it have a web interface?

Yes, a browser-based interface lets users manage their accounts, settings and preferences.

Can it handle large volumes of users and emails?

Yes — with FoundationDB as the backend it can scale to millions of users without sacrificing performance.

Where is my data stored?

That depends on the storage backend you configure; the storage documentation covers the options.

Is my data safe?

Stalwart stores data on proven database systems such as RocksDB, FoundationDB and PostgreSQL, and every release is put through extensive stress testing before shipping.

Can Stalwart be used in production?

Yes — it runs in production systems worldwide with no reported data loss or crashes, but it is still on a 0.x version, so data layout and configuration may change before 1.0 and migrations could be needed.

More in Mail Server

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…