ntfy

by HelmForge

Helm chartv1.8.1App v2.38.1Apache-2.0Verified publisher

ntfy self-hosted push notification service with HTTP-based pub-sub

About this chart

ntfy Helm Chart

Deploy ntfy on Kubernetes using the official binwiederhier/ntfy container image. A simple HTTP-based pub-sub notification service that lets you send push notifications to phones and desktops via scripts — no signup, no fees.

Features

  • HTTP pub-sub — send notifications via simple HTTP PUT/POST requests
  • Cross-platform — native Android, iOS apps and web push support
  • Persistent storage — SQLite cache and auth databases on PVC
  • PostgreSQL support — load the connection URL from a Kubernetes Secret
  • External Secrets — materialize database credentials through External Secrets Operator
  • Prometheus metrics — opt-in /metrics endpoint with ServiceMonitor
  • Behind proxy — trusts X-Forwarded-For headers by default
  • Attachment support — configurable file size and expiry limits
  • Abuse ban-feed — opt-in weighted offender feed for fail2ban or equivalent tooling
  • Ingress support — TLS with cert-manager
  • Dual-stack — ipFamilyPolicy/ipFamilies on the Service for IPv4/IPv6 clusters
  • Gateway API — opt-in HTTPRoute (alternative to Ingress; requires Gateway API CRDs)

Architecture

The chart runs one ntfy Deployment behind a ClusterIP Service. The process listens on containerPorts.http (2586 by default), while service.port remains the client-facing Service port. /etc/ntfy is read-only, /tmp is a bounded emptyDir, and /var/cache/ntfy is either a PVC or a bounded emptyDir.

SQLite is the default data store. PostgreSQL can be provided by the optional HelmForge subchart or an external service. Ingress and Gateway API are optional edge routes; NetworkPolicy and PodDisruptionBudget resources are opt-in. See DESIGN.md for the complete trust and persistence boundaries.

Installation

HTTPS repository:

helm repo add helmforge https://repo.helmforge.dev
helm repo update
helm install ntfy helmforge/ntfy -f values.yaml

OCI registry:

helm install ntfy oci://ghcr.io/helmforgedev/helm/ntfy -f values.yaml

Basic Example

# values.yaml
ntfy:
  baseUrl: "https://ntfy.example.com"

After deploying:

# Port-forward to test
kubectl port-forward svc/<release>-ntfy 8080:80

# Send a notification
curl -d "Hello from k8s!" http://localhost:8080/test

# Subscribe
curl -s http://localhost:8080/test/json

Key Values

KeyDefaultDescription
commonAnnotations{}Annotations applied to every chart-owned Kubernetes resource
ntfy.baseUrl""Public base URL of the instance
ntfy.authDefaultAccess"read-write"Default access for unauthenticated users
ntfy.behindProxytrueTrust X-Forwarded-For headers
ntfy.enableMetricsfalseEnable Prometheus /metrics endpoint
ntfy.banFeed.enabledfalseAppend confirmed abusive visitors to a ban-feed file
ntfy.banFeed.file/var/cache/ntfy/ban.logWritable ban-feed file on the data volume
ntfy.database.enabledfalseUse PostgreSQL instead of SQLite stores
ntfy.database.existingSecret""Secret containing the PostgreSQL URL
ntfy.database.existingSecretKeydatabase-urlSecret key containing the PostgreSQL URL
containerPorts.http2586ntfy process listener port
persistence.enabledtrueEnable persistence for cache and auth
persistence.size2GiPVC size
persistence.emptyDirSizeLimit1GiData limit when persistence is disabled
service.typeClusterIPService type
service.port80Service port
service.ipFamilyPolicy~Dual-stack policy (SingleStack, PreferDualStack, RequireDualStack)
service.ipFamilies[]IP families (IPv4, IPv6)
ingress.enabledfalseEnable ingress
gateway.enabledfalseRender an HTTPRoute (requires Gateway API CRDs)
gateway.parentRefs[]Gateway parent refs — required when gateway.enabled=true; each entry must have name
gateway.hostnames[]Hostnames the HTTPRoute matches
serviceAccount.automountServiceAccountTokenfalseMount a Kubernetes API token into the application pod
podDisruptionBudget.enabledfalseProtect the singleton pod from voluntary disruption
networkPolicy.enabledfalseRestrict ingress and optional egress
runtimeStorage.tmpSizeLimit128MiMaximum writable /tmp storage
postgresql.enabledfalseDeploy HelmForge PostgreSQL 2.2.0

Authentication

ntfy supports user authentication. After deploying, create users via exec:

kubectl exec -it deploy/<release>-ntfy -- ntfy user add --role=admin admin

Then restrict default access:

ntfy:
  authDefaultAccess: "deny-all"

PostgreSQL

Embedded PostgreSQL (Subchart)

Deploy an integrated PostgreSQL instance managed by the HelmForge PostgreSQL subchart:

postgresql:
  enabled: true
  auth:
    password: "choose-a-strong-password"

External PostgreSQL

Connect to an existing PostgreSQL database directly via values:

ntfy:
  database:
    mode: postgresql
    external:
      host: postgres.example.com
      port: 5432
      name: ntfy
      username: ntfy
      password: "choose-a-strong-password"

Alternatively, reference a pre-created Secret containing the complete PostgreSQL connection URL:

kubectl create secret generic ntfy-database \
  --from-literal=database-url="$NTFY_DATABASE_URL"
ntfy:
  database:
    enabled: true
    existingSecret: ntfy-database
    existingSecretKey: database-url

persistence:
  enabled: false

The chart exposes the Secret key as NTFY_DATABASE_URL and omits ntfy's SQLite-only cache-file, auth-file, and web-push-file options. PostgreSQL stores messages, access control, and web push subscriptions. Keep persistence enabled if local attachments, the abuse ban-feed, or other file-backed options need to survive pod replacement.

PostgreSQL alone does not make this chart highly available. The Deployment remains single-replica, and local attachment storage is not shared between pods. Configure and validate shared attachment storage before designing an HA deployment.

External Secrets Operator

The same target Secret can be reconciled from a provider:

ntfy:
  database:
    enabled: true
    existingSecret: ntfy-database

externalSecrets:
  enabled: true
  items:
    - fullnameOverride: ntfy-database
      spec:
        secretStoreRef:
          name: production-secrets
          kind: ClusterSecretStore
        target:
          name: ntfy-database
        data:
          - secretKey: database-url
            remoteRef:
              key: ntfy/database
              property: url

See the External Secrets Operator documentation for provider and SecretStore configuration.

Because Kubernetes does not refresh environment variables in running containers, rotating the target Secret does not update NTFY_DATABASE_URL in an existing ntfy pod. Trigger a Deployment rollout after rotation, or configure a compatible restart controller to restart the workload when the Secret changes.

Administrator Bootstrap

Create an initial administrator account automatically when authentication is enforced (e.g. authDefaultAccess: "deny-all"):

ntfy:
  authDefaultAccess: "deny-all"
  admin:
    enabled: true
    username: "admin"
    # Inline password or leave empty to auto-generate a secure random 32-character password in a managed Secret
    password: "InitialSecretPass123!"
    # Or reference an existing Secret
    # existingSecret: "ntfy-admin-credentials"
    # existingSecretPasswordKey: "password"

Prometheus Metrics

Enable the built-in Prometheus metrics endpoint:

ntfy:
  enableMetrics: true

metrics:
  serviceMonitor:
    enabled: true

Abuse Ban-Feed

ntfy 2.26.3 can append confirmed abusive visitor IPs to a weighted ban-feed for an external fail2ban or equivalent consumer. The chart keeps this disabled by default. When enabled, the default file is stored on the writable data volume:

ntfy:
  banFeed:
    enabled: true
    file: /var/cache/ntfy/ban.log
    window: 10m
    threshold: 100
    weights:
      - "42909:10"

The chart configures the feed only; it does not install fail2ban or modify node firewall rules. The external consumer must be able to read the file, and the operator must rotate it with a copy-truncate strategy so it cannot grow without bound.

Gateway API

gateway:
  enabled: true
  parentRefs:
    - name: envoy
      namespace: envoy-gateway
  hostnames:
    - ntfy.example.com
  path: /
  pathType: PathPrefix

Dual-Stack

service:
  ipFamilyPolicy: PreferDualStack
  ipFamilies:
    - IPv4
    - IPv6

Upgrade Notes

Upgrading to v2.32.0

ntfy v2.32.0 is an upstream release containing new features, bug fixes, and stability improvements. No breaking configuration or schema changes are introduced in this release.

Review the official v2.32.0 release notes.

Upgrading to v2.31.1

ntfy 2.31.1 upgrades the message database schema (version 16 to 17) to optimize topic reconnects with a dedicated index on SQLite and PostgreSQL. The schema migration is automatic upon startup. It also allows starting with a warning when a database schema is newer than supported, simplifying rollbacks. Back up persistent state before rollout and review the 2.31.1 release.

Limitations

  • Single replica — the Deployment currently uses one replica regardless of database backend
  • Local attachments — filesystem attachment storage is not shared across pods

Security

The default pod and containers run as UID/GID 1000 with a read-only root filesystem, RuntimeDefault seccomp, no privilege escalation, and all Linux capabilities dropped. Kubernetes API token mounting is disabled. Resource requests and limits, bounded ephemeral storage, and HTTP health probes are enabled by default.

NetworkPolicy is opt-in because allowed peers depend on the cluster. When egress isolation is enabled for an external PostgreSQL deployment, networkPolicy.egress.externalDatabaseCIDR is required. Add explicit egress rules for SMTP, web push, OIDC, S3, and any other external integration. The default DNS peer is the kube-system namespace; override networkPolicy.egress.dnsPeers when cluster DNS runs elsewhere.

Keep credentials in existing Secrets or use External Secrets Operator. Inline secret values are convenient for development but remain visible in Helm release state. See the security guide for the complete control and trust-boundary model.

Troubleshooting

Start with the rendered release state, pod events, and ntfy logs:

helm get values <release> -n <namespace>
kubectl get pods,pvc -n <namespace> -l app.kubernetes.io/instance=<release>
kubectl get events -n <namespace> --sort-by=.lastTimestamp
kubectl logs -n <namespace> deploy/<release>-ntfy --tail=200

If the pod is not ready, verify that the configured listener matches containerPorts.http, the data volume is writable by UID 1000, and any database or identity-provider Secret contains the configured key. See the operations guide for backup, restore, rollout, and diagnostic procedures.

More Information

Security Scan: ntfy

FrameworkScore
MITRE + NSA + SOC274.242424%

Security posture acceptable.

Backup and Restore

The optional CronJob archives /var/cache/ntfy and uploads the archive to an S3-compatible endpoint. Persistence must remain enabled so the Job can mount the same PVC as ntfy.

backup:
  enabled: true
  schedule: "0 3 * * *"
  s3:
    endpoint: https://s3.example.com
    bucket: ntfy-backups
    existingSecret: ntfy-backup-s3

The Secret must contain access-key and secret-key unless the key names are overridden. Test restore into a separate release before relying on the backup. The operations guide documents the full restore sequence.

For EKS Pod Identity or IRSA, use the dedicated backup ServiceAccount instead of static S3 keys:

backup:
  enabled: true
  serviceAccount:
    annotations:
      eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/ntfy-backup
  s3:
    endpoint: https://s3.amazonaws.com
    bucket: ntfy-backups
    region: us-east-1
    createBucketIfNotExists: false
    credentialsFromPodIdentity: true

EKS Pod Identity normally uses an association and does not require the IRSA annotation shown above. When backup.serviceAccount.create is disabled, set backup.serviceAccount.name to an existing dedicated ServiceAccount. Bucket creation is disabled by default so the backup identity only needs object-level permissions. Opt in to createBucketIfNotExists only when the identity also has bucket-management permission.

SSO (OpenID Connect) and SMTP

ntfy supports native OpenID Connect authentication and outbound SMTP email. Store both client and SMTP secrets in Kubernetes Secrets:

ntfy:
  baseUrl: https://ntfy.example.com

oidc:
  enabled: true
  issuerUrl: https://auth.example.com
  clientId: ntfy
  existingSecret: ntfy-oidc
  existingSecretKey: client-secret
  redirectUrl: https://ntfy.example.c

Deploy ntfy with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ntfy on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartntfy is pinned at v1.8.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply