Skip to main content

Ntfy on Google Cloud Run

Ntfy on Google Cloud Run

ntfy is an open-source, Apache 2.0-licensed pub/sub push-notification server written in Go. Applications publish messages over a simple REST/HTTP API and clients receive them instantly over WebSocket or Server-Sent-Events (SSE) streams — no external database required. This module deploys ntfy on Cloud Run v2 on top of the App_CloudRun foundation, which provisions and manages the shared Google Cloud infrastructure.

This guide focuses on the cloud services ntfy uses and how to explore and operate them from the Google Cloud Console and the command line. For the mechanics common to every Cloud Run application — service identity, ingress and load balancing, scaling and concurrency, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC Service Controls, backups, and the deployment lifecycle — refer to the App_CloudRun foundation guide rather than repeating them here.


What Ntfy costs on RAD, and how that compares​

Ntfy on RAD's Cloud Run module costs about US$51 a month, with the module fee charged once in RAD credits. Need Ntfy to stay up continuously, scale across pods, or run beside other Kubernetes workloads — or see the GKE guide for that option. If you only need it occasionally — a demo, a seasonal project, something you're evaluating — a RAD-managed project can be deleted and restored within 30 days for a handful of credits (under US$1) instead of paying for it to sit idle. See Pause it for free, below. Figures are as at 8 October 2026; sources are listed at the end of this section.

What you pay on RAD​

RAD deploys Ntfy, which is open source, so there is no licence fee per user. You pay for three things:

In a Google Cloud project you ownIn a project RAD manages for you
Module fee, once per deployment40 credits (US$4 at the top-up price)36 credits (10% lower)
Build timeAbout 3-6 credits per buildThe same
Google Cloud running costBilled by Google to your own billing account, about US$51 a month for the default configuration (table below)Metered hourly in credits; RAD publishes 25 credits a day, about 750 a month (about US$75 at the top-up price, US$60 at the Scale plan's rate)
Who owns whatYou own the project and its billing; RAD deploys and updates itRAD owns the project, with guardrails, quotas and budget alerts; you get console access, and a minimum purchased balance is held in reserve

10 credits cost US$1 on a one-off top-up, and less on a monthly plan. In a project RAD manages, the network and storage are shared by every application in the project, so a second application does not add a second set of them.

Default running cost in your own project (us-central1, Google list prices):

Resource (module default)Per month
Cloud Run, 1x vCPU / 0.5 GiB (alwaysOn)US$44.72
Cloud NAT and networkingUS$5
Cloud Storage (add-ons, backups)US$1
Totalabout US$51

How it compares​

OptionPriceWho runs it
ntfy.sh, Supporter$6/month ($5 billed annually)The ntfy maintainer's own hosted instance. 2,500 messages/day, 3 reserved topics
ntfy.sh, Pro$12/month ($10 billed annually)20,000 messages/day, 10 reserved topics
ntfy.sh, Business$25/month ($20 billed annually)50,000 messages/day, 50 reserved topics, phone calls
RAD, Cloud Run, your own projectAbout US$51, plus US$4 once per deploymentRAD's automation, in your project
RAD, Cloud Run, a RAD-managed projectAbout 750 credits (US$60–75)RAD
RAD, GKE AutopilotSee the GKE guideRAD

ntfy's own maintainer sells exactly this — a hosted copy of the same open-source server — so it is the fairest comparison available. The free, self-hosted version has no message cap at all, which is the usual reason to self-host rather than subscribe: a busy integration can outgrow even the Business plan's 50,000 messages/day, while RAD's own project has no such ceiling.

Pause it for free: delete a RAD-managed project, restore it when you need it​

If Ntfy runs in a project RAD manages for you, you have a second option that goes well beyond scaling to zero: delete the whole project, and restore it within 30 days for close to nothing. This suits Ntfy you only need occasionally — a demo, an evaluation, a seasonal project — far better than running it continuously.

  • How it works. Deleting a RAD-managed project unlinks its billing first, then asks Google to delete the project. Google does not remove the project immediately: it keeps it, recoverable, for 30 days. Because billing is already unlinked, nothing is charged while it waits. Unlike deleting one module, this does not tear down the compute resource one by one — the whole project, and everything in it, simply stops.
  • Restoring costs a few credits, not a rebuild. Within 30 days, the project's owner can restore it. RAD asks Google to undelete the project and reattaches its billing account, then asks you to run Update on each deployment to confirm everything came back. Because nothing was individually destroyed, that Update finds the same resources already there — it is a check, not a rebuild, and an Update never charges the module fee again. That costs roughly a handful of credits (under US$1) in total for a typical 2-3-deployment chain.
  • So a month of occasional use can cost a few dollars, not US$51. Deploy Ntfy, use it for a while, delete the project. Restore it next time you want it, confirm with Update, and delete it again when you're done. You pay only for the module fee once, the builds, and whatever time Ntfy was actually live.
  • What this needs. You must own the project (not a bring-your-own one RAD only manages billing for), and you restore it yourself within the 30 days — after that, Google deletes it for good. Restoring is admitted like creating a new project: your purchased credit balance must still clear the tier's floor (100 credits for the sandbox tier most study and demo use fits). Google says most services are fully working again within 36 hours of a restore.
  • One real gap: nightly backups don't survive. Backups are written to a bucket inside the project, and that bucket is not protected by Cloud Storage's soft-delete, so it is very likely gone as soon as you delete the project — even though the project itself is recoverable for 30 days. If you've customised Ntfy and want to keep that work, copy a backup out (to Google Drive, or a bucket outside the project) before you delete. For a default installation with nothing irreplaceable in it, this does not matter.

Pay only while you use it, the other way: delete and redeploy​

The option above only applies to a RAD-managed project; in your own project, or once the 30-day window has passed, the way to stop paying is to delete the deployment and deploy it again when you need it.

  • What a redeploy costs. The module fee again plus the builds: about 45 credits (US$4.50) in your own project, or 41 credits in a RAD-managed one. Deleting saves money once Ntfy would otherwise sit unused for about 3 days or more in your own project (about US$1.69 a day), or about 2 days or more in a RAD-managed one (25 credits a day).
  • Most of the running cost is usually the database and any shared file/cache VM. They stop only when nothing else in the project uses them, so deleting Ntfy while something else shares the project saves only this app's own compute part.
  • Keep your data first. Nightly backups go to a bucket inside the deployment and are deleted with it, so copy the latest backup out before deleting if you want to keep it.

Lab sessions and Managed Environments​

  • Lab sessions, for training. A trainer runs a session for a class. Each participant gets Ntfy in their own Google Cloud project for 15 minutes to 24 hours, within an allowance the trainer sets. Either the trainer funds every place, or each participant pays for their own. Everything is deleted when the session ends and unused credits go back to the trainer.
  • Managed Environments, for consultancies. A partner runs Ntfy for a client from a ring-fenced wallet it funds, and settles with the client directly. If the wallet runs low, billing pauses and the data is kept, so nobody receives an unexpected charge. At the end the partner hands the project over and the deployments become the client's own.
  • Credits can be bought in more than 20 currencies, including XAF, XOF, NGN, GHS, KES and ZAR, by card, bank transfer or mobile money.

Sources (8 October 2026): Google Cloud list prices from the Cloud Billing Catalog API; Delete and restore projects for the 30-day recovery window and what it says about Cloud Storage objects without soft delete; RAD fees and the daily-credit estimates from radmodules.dev/pricing; ntfy.sh. Prices change; check each source before relying on a figure.

1. Overview​

ntfy runs as a single Go container on Cloud Run v2. The deployment wires together a deliberately small set of Google Cloud services — ntfy has no database, cache, or object-storage dependency of its own:

CapabilityGoogle Cloud serviceNotes
ComputeCloud Run v2Single Go service, 1 vCPU / 512 MiB by default; CPU always allocated for long-lived streams
DatabaseNonedatabase_type = "NONE"; message cache is a local SQLite file, no Cloud SQL provisioned
PersistenceEphemeral disk (default) or NFS (optional)SQLite cache at /var/cache/ntfy/cache.db; enable NFS for durable message history
Object storageNonentfy stores nothing in Cloud Storage
Cache / queueNoneNo Redis; ntfy uses an in-process message bus
SecretsSecret ManagerNo auto-generated secrets; only user-supplied secret_environment_variables
IngressCloud Run URL / Cloud Load BalancingDefault run.app URL; optional external HTTPS load balancer + custom domain

Sensible defaults worth knowing up front:

  • No database is provisioned. database_type = "NONE" — ntfy keeps its message cache in a local SQLite file. The database-related variables exist for completeness but are inert unless you deliberately opt in to an external database.
  • The message cache is ephemeral by default. It lives at /var/cache/ntfy/cache.db. Cloud Run's root filesystem is read-only, so the entrypoint falls back to /tmp/ntfy when the configured directory is not writable. Message history is therefore lost on each restart/redeploy unless you enable NFS (enable_nfs = true) and point the cache directory at the mount.
  • CPU is always allocated (cpu_always_allocated = true). ntfy holds long-lived WebSocket/SSE streams open to push messages to connected subscribers in real time, so CPU must not be throttled between requests. Flipping this to false saves cost on a low-traffic instance but pauses real-time delivery while idle.
  • Single instance by default (min_instance_count = 1, max_instance_count = 1). Because a subscriber's stream is anchored to the instance that holds it and there is no shared message bus, scaling out is not the default. Keep max at 1 unless you place a shared cache/broker behind ntfy.
  • Public ingress is the default (ingress_settings = "all") so publishers and subscribers can reach the service. Enabling IAP requires Google sign-in and blocks unauthenticated publish/subscribe calls.
  • The health endpoint is /v1/health, which returns {"healthy":true} with HTTP 200 as soon as the server binds its port.
  • Access control is a post-deploy step. ntfy ships with open access; configure users and topic ACLs afterwards via its CLI or NTFY_AUTH_* environment variables.

2. Google Cloud Services & How to Explore Them​

All commands assume PROJECT and REGION are set. Service and resource names are reported in the deployment Outputs.

A. Cloud Run — the ntfy service​

ntfy runs as a Cloud Run v2 service. Each deployment creates an immutable revision; traffic can be split across revisions for safe rollouts. Because CPU is always allocated, an active instance keeps its subscriber streams alive between requests.

  • Console: Cloud Run → select the service for revisions, traffic, logs, and metrics.
  • CLI:
    gcloud run services list --project "$PROJECT" --region "$REGION"
    gcloud run services describe <service-name> --project "$PROJECT" --region "$REGION"
    gcloud run revisions list --service <service-name> --project "$PROJECT" --region "$REGION"

See App_CloudRun for scaling, concurrency, execution environment, and traffic splitting.

B. Persistence — the SQLite message cache​

ntfy has no Cloud SQL instance. Its message cache is a local SQLite file at NTFY_CACHE_FILE (/var/cache/ntfy/cache.db), created by the entrypoint on boot. On Cloud Run's read-only root filesystem the entrypoint falls back to /tmp/ntfy when that path is not writable — so with the default configuration the cache is ephemeral and message history does not survive a restart.

For durable history, enable NFS and mount it where the cache lives:

  • Console: Filestore → Instances (when enable_nfs = true).
  • CLI:
    # Confirm the cache path injected into the running revision:
    gcloud run services describe <service-name> --project "$PROJECT" --region "$REGION" \
    --format='value(spec.template.spec.containers[0].env)'

See App_CloudRun for the NFS (Filestore) mount model.

C. Secret Manager​

ntfy generates no secrets at deploy time — there is no database password or encryption key to manage. Secret Manager is used only if you supply your own via secret_environment_variables (for example an NTFY_AUTH_* value or an upstream push credential).

  • Console: Security → Secret Manager.
  • CLI:
    gcloud secrets list --project "$PROJECT"
    gcloud secrets versions access latest --secret=<secret-name> --project "$PROJECT"

See App_CloudRun for injection and rotation details.

D. Networking & ingress​

The service is reachable at its run.app URL by default, which allows the public access ntfy needs for publish/subscribe traffic. An external HTTPS load balancer with a custom domain, Cloud CDN, and Cloud Armor can be layered on; ingress settings and VPC egress control connectivity. If clients use HTTP/2 streaming, set container_protocol = "h2c".

  • Console: Cloud Run (service URL); Network services → Load balancing.
  • CLI:
    gcloud run services describe <service-name> --region "$REGION" --format='value(status.url)'
    gcloud compute addresses list --project "$PROJECT"

See App_CloudRun.

E. Cloud Logging & Monitoring​

Container logs flow to Cloud Logging; Cloud Run metrics flow to Cloud Monitoring, with optional uptime checks and alert policies. ntfy logs its listen address and resolved cache path on startup.

  • Console: Logging → Logs Explorer; Monitoring → Dashboards / Alerting.
  • CLI:
    gcloud run services logs read <service-name> --project "$PROJECT" --region "$REGION" --limit 50

3. Ntfy Application Behaviour​

  • No first-deploy database setup. ntfy has no external database and no migration step. The entrypoint prepares the SQLite cache directory and immediately execs ntfy serve. There is no db-init job by default.
  • Ephemeral cache with automatic fallback. The entrypoint creates NTFY_CACHE_FILE's directory; on Cloud Run's read-only rootfs it falls back to /tmp/ntfy and logs a warning. This keeps a baseline (NFS-less) deploy healthy. Enable NFS for durable message history.
  • Real-time delivery needs allocated CPU. Subscribers hold open WebSocket/SSE streams; cpu_always_allocated = true ensures the in-process message bus keeps delivering between inbound requests.
  • Health path. Startup and liveness probes target /v1/health, which returns {"healthy":true} and HTTP 200 as soon as the server binds port 80. Verify:
    SERVICE_URL=$(gcloud run services describe <service-name> \
    --project "$PROJECT" --region "$REGION" --format='value(status.url)')
    curl -s "$SERVICE_URL/v1/health" # -> {"healthy":true}
  • Publish / subscribe smoke test.
    curl -d "hello from ntfy" "$SERVICE_URL/mytopic"     # publish
    curl -s "$SERVICE_URL/mytopic/json" # subscribe (streaming JSON)
  • Access is open until you lock it down. By default any client can publish to and subscribe from any topic. Configure users and per-topic ACLs post-deploy via ntfy's CLI (ntfy user add, ntfy access) or the NTFY_AUTH_* environment variables.
  • Public base URL for attachments / web push. If you use attachments or browser web-push, set NTFY_BASE_URL (via environment_variables) to the service's public URL so generated links resolve correctly.

4. Configuration Variables​

Variables are grouped exactly as they appear on the deployment platform. Only settings specific to or notable for ntfy are listed; every other input is inherited from App_CloudRun with its standard behaviour.

Group 1 — Project & Identity​

VariableDefaultDescription
project_id(required)Target Google Cloud project.
regionus-central1Region for the service and regional resources.

Group 2 / 3 — Deployment Environment & Application Identity​

VariableDefaultDescription
tenant_iddemoShort suffix that makes resource names unique per environment.
application_namentfyBase name for the service, registry repo, and secrets. Do not change after first deploy.
application_display_nameNtfyHuman-readable name shown in the Console.
application_versionlatestImage version tag; latest maps to a pinned v2.11.0 base. Pin an explicit v2.x.y in production.

Group 4 — Runtime & Scaling​

VariableDefaultDescription
deploy_applicationtrueSet false to provision supporting infrastructure only.
container_image_sourcecustomcustom builds the wrapper image via Cloud Build; prebuilt deploys an image directly.
cpu_limit1000mCPU per instance.
memory_limit512MiMemory per instance (gen2 floor is 512Mi).
min_instance_count1Minimum instances.
max_instance_count1Keep at 1 — streams are instance-local with no shared broker.
container_port80ntfy listens on port 80.
container_protocolhttp1Set h2c for end-to-end HTTP/2 streaming.
cpu_always_allocatedtrueRequired for real-time stream delivery; flip to false only for low-traffic cost savings.
enable_cloudsql_volumefalseOff — ntfy has no database.
enable_image_mirroringtrueMirror the ntfy image into Artifact Registry.

Group 5 — Access & Networking​

VariableDefaultDescription
ingress_settingsallall is required for public publish/subscribe traffic.
enable_iapfalseRequire Google sign-in. Blocks unauthenticated publish/subscribe.

Group 6 — Environment Variables & Secrets​

VariableDefaultDescription
environment_variables{}Extra NTFY_* settings (e.g. NTFY_BASE_URL, NTFY_AUTH_DEFAULT_ACCESS).
secret_environment_variables{}Map of env var → Secret Manager secret name (optional; none required).

Group 11 — Storage & Filesystem​

VariableDefaultDescription
enable_nfsfalseEnable to back the SQLite cache with NFS for durable message history.
nfs_mount_path/var/cache/ntfyNFS mount path; point NTFY_CACHE_FILE at it for persistence.
storage_buckets[]Not required — ntfy uses no object storage.

Group 12 — Database Backend​

VariableDefaultDescription
database_typeNONEntfy has no external database; leave NONE.
application_database_name / application_database_userntfyInert unless an external database is deliberately enabled.

Group 13 — Jobs & Scheduled Tasks​

VariableDefaultDescription
initialization_jobs[]ntfy needs no init job; leave empty.
cron_jobs[]Optional scheduled Cloud Run jobs.

Group 14 — Observability & Health​

VariableDefaultDescription
startup_probeHTTP /v1/health 30s delayStartup probe. ntfy becomes healthy within seconds.
liveness_probeHTTP /v1/health 30s delayLiveness probe.
uptime_check_config{ enabled=false, path="/v1/health" }Optional Cloud Monitoring uptime check.

Group 16 — Redis Cache​

VariableDefaultDescription
enable_redisfalseNot required — ntfy has no Redis dependency.

All other inputs follow standard App_CloudRun behaviour.


5. Outputs​

Returned on a successful deployment — the quickest way to locate and explore the running resources.

OutputDescription
service_nameCloud Run service name.
service_urlDefault run.app URL of the service.
service_locationRegion the service runs in.
stage_servicesStage-specific service URLs (Cloud Deploy).
load_balancer_ip / load_balancer_urlExternal HTTPS load balancer IP / URL (when enabled).
database_instance_name / database_name / database_userDatabase identifiers — empty for the default NONE engine.
database_password_secret / database_host / database_portDatabase endpoint fields — unused for NONE.
storage_bucketsCreated Cloud Storage buckets (none by default).
network_name / network_exists / regionsVPC network, presence, regions.
container_image / container_registryDeployed image and Artifact Registry repo.
monitoring_enabled / monitoring_notification_channels / uptime_check_namesMonitoring status, channels, uptime checks.
initialization_jobsNames of any setup jobs (none by default).
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.
cicd_enabled / github_repository_url / github_repository_owner / github_repository_name / cicd_configurationCI/CD status and details.
artifact_registry_repository / cloudbuild_trigger_name / cloudbuild_trigger_idRegistry and build trigger.
vpc_sc_enabled / vpc_sc_perimeter_name / vpc_sc_dry_run_modeVPC-SC status.
audit_logging_enabled / artifact_registry_cmek_enabledAudit logging and CMEK status.

6. Configuration Pitfalls & Sensible Defaults​

Risk: Critical (data loss / outage / security) — High (service degraded) — Medium (cost or partial degradation) — Low (minor).

Inherited plan-time validation. This module passes its configuration through the App_CloudRun foundation engine, which validates values and combinations at plan time — IAP with no authorized identities, a gen1 runtime with NFS/GCS mounts, an out-of-range container_port/timeout_seconds, a memory value below the gen2 floor. Invalid configuration fails the plan with a clear, named error before any resource is created, so most mistakes below are caught up front rather than at apply or runtime.

SettingSensible valueRiskConsequence if wrong
enable_nfs (for durable history)true when history mattersHighWith the default ephemeral cache, all message history is lost on every restart/redeploy — acceptable for a pure relay, surprising if you expected persistence.
max_instance_count1HighScaling beyond 1 splits subscribers across instances with no shared bus, so a message published to one instance is not delivered to subscribers pinned to another.
cpu_always_allocatedtrueHighSetting false lets Cloud Run throttle CPU between requests, pausing real-time WebSocket/SSE delivery while the instance is idle.
ingress_settingsallHighinternal blocks external publishers and subscribers from reaching the service.
enable_iaponly when auth-gatedHighIAP requires Google sign-in for every request, blocking unauthenticated publish/subscribe — usually not what a notification endpoint wants.
NTFY_BASE_URLActual service URLMediumUnset, attachment and web-push links resolve to the wrong host.
ntfy access controlConfigure post-deployMediumLeft default, any client can publish to and subscribe from any topic on a public URL.
container_protocolhttp1 (or h2c)MediumMismatch with clients that require HTTP/2 streaming degrades or breaks long-lived streams.
memory_limit512MiLowThe gen2 execution environment rejects values below 512Mi at apply time.
application_versionPin v2.x.y in prodLowlatest maps to a pinned base (v2.11.0); pin explicitly to control upgrades.

For the foundation behaviour referenced throughout — service identity, scaling and concurrency, ingress and load balancing, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC-SC, backups, and image mirroring — see App_CloudRun. ntfy-specific application configuration shared with the GKE variant is described in Ntfy_Common.

Need RAD to do something it does not do yet? Request it on the roadmap, or vote on what is already there.