Stalwart
Production-oriented Helm chart for the Stalwart mail and collaboration server.
Highlights
- Current Stalwart 0.16 DataStore-only bootstrap contract.
- Single-node RocksDB/PVC default and guarded external-store HA mode.
- Existing ConfigMap or Secret configuration and full environment
valueFrom. - Canonical External Secrets Operator integration.
- Split HTTP and mail Services with arbitrary additional listener ports.
- HTTPRoute, TCPRoute, and TLSRoute support, disabled by default.
- Optional declarative
stalwart-cli applyJob using a mounted NDJSON plan. - PDB, anti-affinity, topology spread, NetworkPolicy, dual-stack, and restricted-style security contexts.
- Prometheus annotations, optional ServiceMonitor, and extra manifests for VictoriaMetrics or another operator.
Architecture
Stalwart runs as a StatefulSet with stable pod and storage identities. Separate Services expose mail protocols and HTTP/JMAP, while optional Ingress and Gateway API routes connect environment-owned controllers. The single-replica default uses a local RocksDB PVC; multi-replica deployments require external shared stores for every durable Stalwart state category. See DESIGN.md for the topology and responsibility boundaries.
Install
helm repo add helmforge https://repo.helmforge.dev
helm repo update
helm install stalwart helmforge/stalwart
The default is a one-replica development baseline using RocksDB and a 20 Gi
PVC. Supply STALWART_RECOVERY_ADMIN from an existing Secret to establish the
first administrative session; the chart never creates a default password.
extraEnv:
- name: STALWART_RECOVERY_ADMIN
valueFrom:
secretKeyRef:
name: stalwart-recovery
key: credential
Configuration ownership
Stalwart 0.16 reads exactly one DataStore object from config.json. All other
settings are stored in that DataStore. Choose one bootstrap source:
config:
source: generated # generated | existingConfigMap | existingSecret
dataStore:
"@type": RocksDb
path: /var/lib/stalwart
For an external PostgreSQL DataStore, use the upstream object schema and an environment reference for its password. Credentials remain in Kubernetes Secrets rather than the Helm release values.
See storage and clustering and declarative operations.
Upgrade safety
Helm upgrades preserve the StatefulSet name, pod ordinals, Services, and PVCs.
Keep fullnameOverride, persistence.existingClaim, storage settings, and the
selected config.source stable unless you are intentionally migrating them.
Review new defaults before using --reuse-values; the safer baseline is the
normal Helm merge with an explicit values file:
helm upgrade stalwart oci://ghcr.io/helmforgedev/charts/stalwart \
--namespace stalwart --values values.yaml
Back up application data and externally managed configuration before changing storage or HA topology. Do not scale above one replica while using the default local RocksDB configuration.
HA
replicaCount > 1 fails at template time when a local RocksDB/SQLite DataStore
or local PVC is selected. An HA deployment needs a shared external DataStore,
shared blob/search/in-memory backends, and a Coordinator. The latter four are
database-backed Stalwart objects and belong in an apply plan, not config.json.
For an empty shared database, first install the HA configuration with
replicaCount: 1. After that pod is ready, upgrade the same release to the
desired replica count. Keep podManagementPolicy unchanged: Kubernetes treats
that StatefulSet field as immutable, and changing it breaks an in-place Helm
upgrade.
The coordination topic is fixed to stwt.agora; dedicate it to one Stalwart
cluster. Zenoh peer-to-peer is not compiled into the standard image.
Gateway API
One switch controls every route:
gatewayAPI:
enabled: true
HTTPRoute handles HTTP/JMAP. TCPRoute handles plaintext and STARTTLS protocols. TLSRoute handles implicit-TLS passthrough with SNI. TCPRoute and some TLSRoute controller behaviors require the Gateway API Experimental channel. The chart does not create Gateways or certificates. See Gateway API.
Monitoring
Stalwart serves Prometheus-format metrics at /metrics/prometheus when metrics
are enabled in its database-backed configuration. Add scrape annotations,
enable the optional ServiceMonitor, or provide a VMServiceScrape through
extraManifests.
Troubleshooting
- If the pod cannot start, inspect the selected configuration source and verify
that its key is
config.jsonor matches the configured key. - If readiness fails, confirm that the management listener remains enabled and
that
ports.management.containerPortmatches the Stalwart configuration. - If mail traffic cannot reach the pod, verify the mail Service type, listener ports, NetworkPolicy peers, and controller support for TCPRoute/TLSRoute.
- If a multi-replica release is unstable, return to one replica and verify that all durable state categories point to shared external stores before scaling.
Security Scan
🟢 Security Scan: stalwart
| Framework | Score |
|---|---|
| MITRE + NSA + SOC2 | 85.85859% |
✅ Security posture acceptable.
Kubescape reported no critical failures. The remaining default findings are
resource limits left for operators to size, opt-in NetworkPolicy, and the Helm
test pod's short-lived utility image. The Stalwart workload runs non-root with
a read-only root filesystem, RuntimeDefault seccomp, and only
NET_BIND_SERVICE added for the official binary's privileged listener ports.
Documentation
License
This chart is Apache-2.0 licensed. Stalwart Community is distributed under its upstream AGPL-3.0 terms; operators are responsible for application licensing.
System Architecture
DESIGN.md SyncedVerified architecture contract rendered dynamically from GitHub DESIGN.md
flowchart LR Clients[Mail and JMAP clients] --> Mail[Mail Service] Clients --> HTTP[HTTP Service] Mail --> Pod[Stalwart StatefulSet] HTTP --> Pod Gateway[Ingress or Gateway API controller] -. optional routes .-> HTTP Gateway -. TCP and TLS routes .-> Mail Pod --> PVC[Per-pod data PVC] Pod --> Store[External shared stores for HA] Config[Generated or existing configuration] --> Pod Apply[Optional declarative apply Job] --> HTTP Prometheus[Prometheus] -. optional scrape .-> HTTP
Stalwart Values Schema Reference
Official schema parameters, default values, and types extracted directly from the chart repository.
Global(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| global | object | - | Global settings shared by the chart. |
Replica Count(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| replicaCount | integer | - | Chart configuration parameter |
Image(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| image | any | - | Chart configuration parameter |
Image Pull Secrets(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| imagePullSecrets | array | - | Chart configuration parameter |
Name Override(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| nameOverride | string | - | Chart configuration parameter |
Fullname Override(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| fullnameOverride | string | - | Chart configuration parameter |
Common Labels(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| commonLabels | object | - | Chart configuration parameter |
Common Annotations(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| commonAnnotations | object | - | Chart configuration parameter |
Annotations(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| annotations | object | - | Chart configuration parameter |
Service Account(4)
| Parameter | Type | Default | Description |
|---|---|---|---|
| serviceAccount.create | boolean | - | Chart configuration parameter |
| serviceAccount.automountServiceAccountToken | boolean | - | Chart configuration parameter |
| serviceAccount.annotations | object | - | Chart configuration parameter |
| serviceAccount.name | string | - | Chart configuration parameter |
Configuration(5)
| Parameter | Type | Default | Description |
|---|---|---|---|
| config.source | string | - | Chart configuration parameter Allowed: generatedexistingConfigMapexistingSecret |
| config.dataStore.@type | string | - | Chart configuration parameter |
| config.dataStore.path | string | - | Chart configuration parameter |
| config.existingConfigMap | any | - | Chart configuration parameter |
| config.existingSecret | any | - | Chart configuration parameter |
Role(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| role | string | - | Chart configuration parameter |
Push Shard(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| pushShard | string | - | Chart configuration parameter |
Recovery Mode(3)
| Parameter | Type | Default | Description |
|---|---|---|---|
| recoveryMode.enabled | boolean | - | Chart configuration parameter |
| recoveryMode.port | integer | - | Chart configuration parameter |
| recoveryMode.logLevel | string | - | Chart configuration parameter |
Extra Env(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| extraEnv | array | - | Chart configuration parameter |
Extra Env From(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| extraEnvFrom | array | - | Chart configuration parameter |
Extra Secret Mounts(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| extraSecretMounts | array | - | Chart configuration parameter |
Ports(10)
| Parameter | Type | Default | Description |
|---|---|---|---|
| ports.smtp | any | - | Chart configuration parameter |
| ports.smtps | any | - | Chart configuration parameter |
| ports.submission | any | - | Chart configuration parameter |
| ports.imap | any | - | Chart configuration parameter |
| ports.imaps | any | - | Chart configuration parameter |
| ports.pop3 | any | - | Chart configuration parameter |
| ports.pop3s | any | - | Chart configuration parameter |
| ports.sieve | any | - | Chart configuration parameter |
| ports.https | any | - | Chart configuration parameter |
| ports.management | any | - | Chart configuration parameter |
Extra Ports(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| extraPorts | array | - | Chart configuration parameter |
Service & Networking(3)
| Parameter | Type | Default | Description |
|---|---|---|---|
| service.http | any | - | Chart configuration parameter |
| service.mail | any | - | Chart configuration parameter |
| service.headless | any | - | Chart configuration parameter |
Ingress(5)
| Parameter | Type | Default | Description |
|---|---|---|---|
| ingress.enabled | boolean | - | Chart configuration parameter |
| ingress.ingressClassName | string | - | Chart configuration parameter |
| ingress.annotations | object | - | Chart configuration parameter |
| ingress.hosts | array | - | Chart configuration parameter |
| ingress.tls | array | - | Chart configuration parameter |
Gateway API(4)
| Parameter | Type | Default | Description |
|---|---|---|---|
| gatewayAPI.enabled | boolean | - | Chart configuration parameter |
| gatewayAPI.httpRoutes | array | - | Chart configuration parameter |
| gatewayAPI.tcpRoutes | array | - | Chart configuration parameter |
| gatewayAPI.tlsRoutes | array | - | Chart configuration parameter |
Persistence(8)
| Parameter | Type | Default | Description |
|---|---|---|---|
| persistence.enabled | boolean | - | Chart configuration parameter |
| persistence.existingClaim | string | - | Chart configuration parameter |
| persistence.accessModes | array | - | Chart configuration parameter |
| persistence.size | string | - | Chart configuration parameter |
| persistence.storageClass | string | - | Chart configuration parameter |
| persistence.annotations | object | - | Chart configuration parameter |
| persistence.retentionPolicy.whenDeleted | string | - | Chart configuration parameter Allowed: RetainDelete |
| persistence.retentionPolicy.whenScaled | string | - | Chart configuration parameter Allowed: RetainDelete |
Pdb(4)
| Parameter | Type | Default | Description |
|---|---|---|---|
| pdb.enabled | boolean | - | Chart configuration parameter |
| pdb.minAvailable | integerstringnull | - | Chart configuration parameter |
| pdb.maxUnavailable | integerstringnull | - | Chart configuration parameter |
| pdb.annotations | object | - | Chart configuration parameter |
Pod Management Policy(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| podManagementPolicy | string | - | Chart configuration parameter Allowed: OrderedReadyParallel |
Update Strategy(2)
| Parameter | Type | Default | Description |
|---|---|---|---|
| updateStrategy.type | string | - | Chart configuration parameter Allowed: RollingUpdateOnDelete |
| updateStrategy.rollingUpdate | objectnull | - | Chart configuration parameter |
Stateful Set Annotations(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| statefulSetAnnotations | object | - | Chart configuration parameter |
Pod Annotations(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| podAnnotations | object | - | Chart configuration parameter |
Pod Labels(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| podLabels | object | - | Chart configuration parameter |
Rollout Trigger(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| rolloutTrigger | string | - | Chart configuration parameter |
Priority Class Name(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| priorityClassName | string | - | Chart configuration parameter |
Runtime Class Name(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| runtimeClassName | string | - | Chart configuration parameter |
Dns Policy(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| dnsPolicy | string | - | Chart configuration parameter |
Dns Config(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| dnsConfig | object | - | Chart configuration parameter |
Termination Grace Period Seconds(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| terminationGracePeriodSeconds | integer | - | Chart configuration parameter |
Pod Security(5)
| Parameter | Type | Default | Description |
|---|---|---|---|
| podSecurityContext.runAsNonRoot | booleannull | - | Chart configuration parameter |
| podSecurityContext.runAsUser | integernull | - | Chart configuration parameter |
| podSecurityContext.runAsGroup | integernull | - | Chart configuration parameter |
| podSecurityContext.fsGroup | integernull | - | Chart configuration parameter |
| podSecurityContext.seccompProfile | objectnull | - | Chart configuration parameter |
Container Security(6)
| Parameter | Type | Default | Description |
|---|---|---|---|
| securityContext.allowPrivilegeEscalation | booleannull | - | Chart configuration parameter |
| securityContext.readOnlyRootFilesystem | booleannull | - | Chart configuration parameter |
| securityContext.runAsNonRoot | booleannull | - | Chart configuration parameter |
| securityContext.runAsUser | integernull | - | Chart configuration parameter |
| securityContext.runAsGroup | integernull | - | Chart configuration parameter |
| securityContext.capabilities | objectnull | - | Chart configuration parameter |
Health Probes(2)
| Parameter | Type | Default | Description |
|---|---|---|---|
| probes.liveness | any | - | Chart configuration parameter |
| probes.readiness | any | - | Chart configuration parameter |
Lifecycle(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| lifecycle | object | - | Chart configuration parameter |
Resources(2)
| Parameter | Type | Default | Description |
|---|---|---|---|
| resources.requests | any | - | Chart configuration parameter |
| resources.limits | any | - | Chart configuration parameter |
Node Selector(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| nodeSelector | object | - | Chart configuration parameter |
Tolerations(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| tolerations | array | - | Chart configuration parameter |
Affinity(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| affinity | object | - | Chart configuration parameter |
Topology Spread Constraints(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| topologySpreadConstraints | array | - | Chart configuration parameter |
Extra Init Containers(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| extraInitContainers | array | - | Chart configuration parameter |
Extra Containers(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| extraContainers | array | - | Chart configuration parameter |
Extra Volumes(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| extraVolumes | array | - | Chart configuration parameter |
Extra Volume Mounts(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| extraVolumeMounts | array | - | Chart configuration parameter |
Apply Job(16)
| Parameter | Type | Default | Description |
|---|---|---|---|
| applyJob.enabled | boolean | - | Chart configuration parameter |
| applyJob.useHelmHooks | boolean | - | Chart configuration parameter |
| applyJob.image | any | - | Chart configuration parameter |
| applyJob.plan.source | string | - | Chart configuration parameter Allowed: existingConfigMapexistingSecret |
| applyJob.plan.existingConfigMap | string | - | Chart configuration parameter |
| applyJob.plan.existingSecret | string | - | Chart configuration parameter |
| applyJob.plan.key | string | - | Chart configuration parameter |
| applyJob.dryRunFirst | boolean | - | Chart configuration parameter |
| applyJob.backoffLimit | integer | - | Chart configuration parameter |
| applyJob.activeDeadlineSeconds | integer | - | Chart configuration parameter |
| applyJob.ttlSecondsAfterFinished | integernull | - | Chart configuration parameter |
| applyJob.env | array | - | Chart configuration parameter |
| applyJob.envFrom | array | - | Chart configuration parameter |
| applyJob.resources.requests | any | - | Chart configuration parameter |
| applyJob.resources.limits | any | - | Chart configuration parameter |
| applyJob.extraArgs | array | - | Chart configuration parameter |
Monitoring(8)
| Parameter | Type | Default | Description |
|---|---|---|---|
| monitoring.serviceAnnotations | object | - | Chart configuration parameter |
| monitoring.serviceMonitor.enabled | boolean | - | Chart configuration parameter |
| monitoring.serviceMonitor.annotations | object | - | Chart configuration parameter |
| monitoring.serviceMonitor.labels | object | - | Chart configuration parameter |
| monitoring.serviceMonitor.path | string | - | Chart configuration parameter |
| monitoring.serviceMonitor.interval | string | - | Chart configuration parameter |
| monitoring.serviceMonitor.port | string | - | Chart configuration parameter |
| monitoring.serviceMonitor.namespaceSelector | object | - | Chart configuration parameter |
Network Policy(7)
| Parameter | Type | Default | Description |
|---|---|---|---|
| networkPolicy.enabled | boolean | - | Chart configuration parameter |
| networkPolicy.annotations | object | - | Chart configuration parameter |
| networkPolicy.ingressFrom | array | - | Chart configuration parameter |
| networkPolicy.egress.enabled | boolean | - | Chart configuration parameter |
| networkPolicy.egress.allowDNS | boolean | - | Chart configuration parameter |
| networkPolicy.egress.extraTo | array | - | Chart configuration parameter |
| networkPolicy.egress.extraEgress | array | - | Chart configuration parameter |
External Secrets(3)
| Parameter | Type | Default | Description |
|---|---|---|---|
| externalSecrets.enabled | boolean | - | Chart configuration parameter |
| externalSecrets.refreshInterval | string | - | Chart configuration parameter |
| externalSecrets.items | array | - | Chart configuration parameter |
Extra Manifests(1)
| Parameter | Type | Default | Description |
|---|---|---|---|
| extraManifests | array | - | Chart configuration parameter |
No schema parameters match your search
Try searching for a different keyword or reset the filter.