Skip to content
Stalwart icon
v1.1.4App: v1.2.0Pinned DigestS3 Backup Ready

Production Helm chart • Apache-2.0 • Zero-Root • Verified on Kubernetes v1.33-v1.36+

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 apply Job 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.json or matches the configured key.
  • If readiness fails, confirm that the management listener remains enabled and that ports.management.containerPort matches 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 Synced

Verified 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
Official Contractvalues.schema.json

Stalwart Values Schema Reference

Official schema parameters, default values, and types extracted directly from the chart repository.

132 parametersValues Studio

Global(1)

ParameterTypeDefaultDescription
globalobject-Global settings shared by the chart.

Replica Count(1)

ParameterTypeDefaultDescription
replicaCountinteger-Chart configuration parameter

Image(1)

ParameterTypeDefaultDescription
imageany-Chart configuration parameter

Image Pull Secrets(1)

ParameterTypeDefaultDescription
imagePullSecretsarray-Chart configuration parameter

Name Override(1)

ParameterTypeDefaultDescription
nameOverridestring-Chart configuration parameter

Fullname Override(1)

ParameterTypeDefaultDescription
fullnameOverridestring-Chart configuration parameter

Common Labels(1)

ParameterTypeDefaultDescription
commonLabelsobject-Chart configuration parameter

Common Annotations(1)

ParameterTypeDefaultDescription
commonAnnotationsobject-Chart configuration parameter

Annotations(1)

ParameterTypeDefaultDescription
annotationsobject-Chart configuration parameter

Service Account(4)

ParameterTypeDefaultDescription
serviceAccount.createboolean-Chart configuration parameter
serviceAccount.automountServiceAccountTokenboolean-Chart configuration parameter
serviceAccount.annotationsobject-Chart configuration parameter
serviceAccount.namestring-Chart configuration parameter

Configuration(5)

ParameterTypeDefaultDescription
config.sourcestring-Chart configuration parameter
Allowed:generatedexistingConfigMapexistingSecret
config.dataStore.@typestring-Chart configuration parameter
config.dataStore.pathstring-Chart configuration parameter
config.existingConfigMapany-Chart configuration parameter
config.existingSecretany-Chart configuration parameter

Role(1)

ParameterTypeDefaultDescription
rolestring-Chart configuration parameter

Push Shard(1)

ParameterTypeDefaultDescription
pushShardstring-Chart configuration parameter

Recovery Mode(3)

ParameterTypeDefaultDescription
recoveryMode.enabledboolean-Chart configuration parameter
recoveryMode.portinteger-Chart configuration parameter
recoveryMode.logLevelstring-Chart configuration parameter

Extra Env(1)

ParameterTypeDefaultDescription
extraEnvarray-Chart configuration parameter

Extra Env From(1)

ParameterTypeDefaultDescription
extraEnvFromarray-Chart configuration parameter

Extra Secret Mounts(1)

ParameterTypeDefaultDescription
extraSecretMountsarray-Chart configuration parameter

Ports(10)

ParameterTypeDefaultDescription
ports.smtpany-Chart configuration parameter
ports.smtpsany-Chart configuration parameter
ports.submissionany-Chart configuration parameter
ports.imapany-Chart configuration parameter
ports.imapsany-Chart configuration parameter
ports.pop3any-Chart configuration parameter
ports.pop3sany-Chart configuration parameter
ports.sieveany-Chart configuration parameter
ports.httpsany-Chart configuration parameter
ports.managementany-Chart configuration parameter

Extra Ports(1)

ParameterTypeDefaultDescription
extraPortsarray-Chart configuration parameter

Service & Networking(3)

ParameterTypeDefaultDescription
service.httpany-Chart configuration parameter
service.mailany-Chart configuration parameter
service.headlessany-Chart configuration parameter

Ingress(5)

ParameterTypeDefaultDescription
ingress.enabledboolean-Chart configuration parameter
ingress.ingressClassNamestring-Chart configuration parameter
ingress.annotationsobject-Chart configuration parameter
ingress.hostsarray-Chart configuration parameter
ingress.tlsarray-Chart configuration parameter

Gateway API(4)

ParameterTypeDefaultDescription
gatewayAPI.enabledboolean-Chart configuration parameter
gatewayAPI.httpRoutesarray-Chart configuration parameter
gatewayAPI.tcpRoutesarray-Chart configuration parameter
gatewayAPI.tlsRoutesarray-Chart configuration parameter

Persistence(8)

ParameterTypeDefaultDescription
persistence.enabledboolean-Chart configuration parameter
persistence.existingClaimstring-Chart configuration parameter
persistence.accessModesarray-Chart configuration parameter
persistence.sizestring-Chart configuration parameter
persistence.storageClassstring-Chart configuration parameter
persistence.annotationsobject-Chart configuration parameter
persistence.retentionPolicy.whenDeletedstring-Chart configuration parameter
Allowed:RetainDelete
persistence.retentionPolicy.whenScaledstring-Chart configuration parameter
Allowed:RetainDelete

Pdb(4)

ParameterTypeDefaultDescription
pdb.enabledboolean-Chart configuration parameter
pdb.minAvailableintegerstringnull-Chart configuration parameter
pdb.maxUnavailableintegerstringnull-Chart configuration parameter
pdb.annotationsobject-Chart configuration parameter

Pod Management Policy(1)

ParameterTypeDefaultDescription
podManagementPolicystring-Chart configuration parameter
Allowed:OrderedReadyParallel

Update Strategy(2)

ParameterTypeDefaultDescription
updateStrategy.typestring-Chart configuration parameter
Allowed:RollingUpdateOnDelete
updateStrategy.rollingUpdateobjectnull-Chart configuration parameter

Stateful Set Annotations(1)

ParameterTypeDefaultDescription
statefulSetAnnotationsobject-Chart configuration parameter

Pod Annotations(1)

ParameterTypeDefaultDescription
podAnnotationsobject-Chart configuration parameter

Pod Labels(1)

ParameterTypeDefaultDescription
podLabelsobject-Chart configuration parameter

Rollout Trigger(1)

ParameterTypeDefaultDescription
rolloutTriggerstring-Chart configuration parameter

Priority Class Name(1)

ParameterTypeDefaultDescription
priorityClassNamestring-Chart configuration parameter

Runtime Class Name(1)

ParameterTypeDefaultDescription
runtimeClassNamestring-Chart configuration parameter

Dns Policy(1)

ParameterTypeDefaultDescription
dnsPolicystring-Chart configuration parameter

Dns Config(1)

ParameterTypeDefaultDescription
dnsConfigobject-Chart configuration parameter

Termination Grace Period Seconds(1)

ParameterTypeDefaultDescription
terminationGracePeriodSecondsinteger-Chart configuration parameter

Pod Security(5)

ParameterTypeDefaultDescription
podSecurityContext.runAsNonRootbooleannull-Chart configuration parameter
podSecurityContext.runAsUserintegernull-Chart configuration parameter
podSecurityContext.runAsGroupintegernull-Chart configuration parameter
podSecurityContext.fsGroupintegernull-Chart configuration parameter
podSecurityContext.seccompProfileobjectnull-Chart configuration parameter

Container Security(6)

ParameterTypeDefaultDescription
securityContext.allowPrivilegeEscalationbooleannull-Chart configuration parameter
securityContext.readOnlyRootFilesystembooleannull-Chart configuration parameter
securityContext.runAsNonRootbooleannull-Chart configuration parameter
securityContext.runAsUserintegernull-Chart configuration parameter
securityContext.runAsGroupintegernull-Chart configuration parameter
securityContext.capabilitiesobjectnull-Chart configuration parameter

Health Probes(2)

ParameterTypeDefaultDescription
probes.livenessany-Chart configuration parameter
probes.readinessany-Chart configuration parameter

Lifecycle(1)

ParameterTypeDefaultDescription
lifecycleobject-Chart configuration parameter

Resources(2)

ParameterTypeDefaultDescription
resources.requestsany-Chart configuration parameter
resources.limitsany-Chart configuration parameter

Node Selector(1)

ParameterTypeDefaultDescription
nodeSelectorobject-Chart configuration parameter

Tolerations(1)

ParameterTypeDefaultDescription
tolerationsarray-Chart configuration parameter

Affinity(1)

ParameterTypeDefaultDescription
affinityobject-Chart configuration parameter

Topology Spread Constraints(1)

ParameterTypeDefaultDescription
topologySpreadConstraintsarray-Chart configuration parameter

Extra Init Containers(1)

ParameterTypeDefaultDescription
extraInitContainersarray-Chart configuration parameter

Extra Containers(1)

ParameterTypeDefaultDescription
extraContainersarray-Chart configuration parameter

Extra Volumes(1)

ParameterTypeDefaultDescription
extraVolumesarray-Chart configuration parameter

Extra Volume Mounts(1)

ParameterTypeDefaultDescription
extraVolumeMountsarray-Chart configuration parameter

Apply Job(16)

ParameterTypeDefaultDescription
applyJob.enabledboolean-Chart configuration parameter
applyJob.useHelmHooksboolean-Chart configuration parameter
applyJob.imageany-Chart configuration parameter
applyJob.plan.sourcestring-Chart configuration parameter
Allowed:existingConfigMapexistingSecret
applyJob.plan.existingConfigMapstring-Chart configuration parameter
applyJob.plan.existingSecretstring-Chart configuration parameter
applyJob.plan.keystring-Chart configuration parameter
applyJob.dryRunFirstboolean-Chart configuration parameter
applyJob.backoffLimitinteger-Chart configuration parameter
applyJob.activeDeadlineSecondsinteger-Chart configuration parameter
applyJob.ttlSecondsAfterFinishedintegernull-Chart configuration parameter
applyJob.envarray-Chart configuration parameter
applyJob.envFromarray-Chart configuration parameter
applyJob.resources.requestsany-Chart configuration parameter
applyJob.resources.limitsany-Chart configuration parameter
applyJob.extraArgsarray-Chart configuration parameter

Monitoring(8)

ParameterTypeDefaultDescription
monitoring.serviceAnnotationsobject-Chart configuration parameter
monitoring.serviceMonitor.enabledboolean-Chart configuration parameter
monitoring.serviceMonitor.annotationsobject-Chart configuration parameter
monitoring.serviceMonitor.labelsobject-Chart configuration parameter
monitoring.serviceMonitor.pathstring-Chart configuration parameter
monitoring.serviceMonitor.intervalstring-Chart configuration parameter
monitoring.serviceMonitor.portstring-Chart configuration parameter
monitoring.serviceMonitor.namespaceSelectorobject-Chart configuration parameter

Network Policy(7)

ParameterTypeDefaultDescription
networkPolicy.enabledboolean-Chart configuration parameter
networkPolicy.annotationsobject-Chart configuration parameter
networkPolicy.ingressFromarray-Chart configuration parameter
networkPolicy.egress.enabledboolean-Chart configuration parameter
networkPolicy.egress.allowDNSboolean-Chart configuration parameter
networkPolicy.egress.extraToarray-Chart configuration parameter
networkPolicy.egress.extraEgressarray-Chart configuration parameter

External Secrets(3)

ParameterTypeDefaultDescription
externalSecrets.enabledboolean-Chart configuration parameter
externalSecrets.refreshIntervalstring-Chart configuration parameter
externalSecrets.itemsarray-Chart configuration parameter

Extra Manifests(1)

ParameterTypeDefaultDescription
extraManifestsarray-Chart configuration parameter