Skip to main content

Uptime Kuma on Google Cloud Run

Uptime Kuma on Google Cloud Run

Uptime Kuma is a fancy, self-hosted monitoring tool for tracking the uptime of websites, APIs, TCP ports, DNS records, and more, with a clean dashboard, status pages, and 90+ notification channels. This module deploys Uptime Kuma 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 Uptime Kuma 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.


1. Overview

Uptime Kuma runs as a Node.js container on Cloud Run v2. It is one of the simplest modules in the catalogue — there is no external database, no cache, and no application secret. The deployment wires together a focused set of Google Cloud services:

CapabilityGoogle Cloud serviceNotes
ComputeCloud Run v2Node.js service, 1 vCPU / 512 MiB by default, CPU always allocated
Persistent stateFilestore (NFS)Embedded SQLite database and uploads under /app/data (gen2 required)
Container imageArtifact RegistryThe official louislam/uptime-kuma image is mirrored in (prebuilt, no Cloud Build)
DatabaseNone — Uptime Kuma v1 uses embedded SQLite; database_type = "NONE"
CacheNone — Redis is not required (enable_redis = false)
SecretsSecret ManagerNo application secrets (secret_ids = {}); admin credentials live in SQLite
IngressCloud Run URL / Cloud Load BalancingDefault run.app URL, optional external HTTPS load balancer + custom domain

Sensible defaults worth knowing up front:

  • cpu_always_allocated = true is the default and is deliberate — the monitoring loop IS the product. Uptime Kuma polls its monitors from an in-process scheduler with no inbound request. Under Cloud Run's request-based billing the CPU is throttled to near-zero between requests, so checks would stall or fire late. Instance-based (always-allocated) CPU keeps the scheduler running at full speed while an instance is alive. Do not set this to false.
  • min_instance_count defaults to 0 — the service can scale to zero when nothing keeps an instance alive, and monitoring pauses while it is scaled to zero. For genuine 24/7 monitoring, set min_instance_count = 1 (a single always-on instance).
  • No external database. database_type = "NONE", enable_cloudsql_volume = false, and there is no db-init job. Uptime Kuma creates its embedded SQLite schema automatically on first boot.
  • NFS persistence is mandatory. enable_nfs = true with nfs_mount_path = "/app/data" mounts a Filestore (NFS) volume holding the SQLite database and uploads, so monitors and history survive restarts and revisions. Requires the gen2 execution environment.
  • Single-writer SQLite. SQLite over NFS relies on file locking; run a single instance in production (max_instance_count = 1). The module default is max_instance_count = 3 for burst headroom on the dashboard — lower it for production.
  • Prebuilt image. container_image_source = "prebuilt" deploys the official louislam/uptime-kuma:1 image directly; enable_image_mirroring = true copies it into Artifact Registry to avoid Docker Hub rate limits.
  • No application secrets — there is nothing to inject from Secret Manager. The admin account is created interactively on first access.

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 Uptime Kuma service

Uptime Kuma runs as a Cloud Run v2 service with CPU always allocated so its background check scheduler keeps polling between requests. Each deployment creates an immutable revision; traffic can be split across revisions for safe rollouts.

  • 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. Filestore (NFS) — the persistent data volume

All Uptime Kuma state — the embedded SQLite database, monitor history, uploads, and settings (including the admin user) — lives under /app/data, which the module mounts from a Filestore (NFS) share. Without it, everything is lost on restart. The gen2 execution environment is required for NFS mounts.

  • Console: Filestore → Instances.
  • CLI:
    gcloud filestore instances list --project "$PROJECT"
    gcloud run services describe <service-name> --project "$PROJECT" --region "$REGION" \
    --format="yaml(spec.template.spec.volumes)"

See App_CloudRun for the NFS mount model and CMEK.

C. Artifact Registry — the mirrored image

With enable_image_mirroring = true (the default) the official louislam/uptime-kuma image is copied into the project's Artifact Registry before deployment, insulating deploys from Docker Hub rate limits and outages. There is no Cloud Build step — the image is prebuilt upstream.

  • Console: Artifact Registry → Repositories.
  • CLI:
    gcloud artifacts repositories list --project "$PROJECT" --location "$REGION"
    gcloud artifacts docker images list <region>-docker.pkg.dev/$PROJECT/<repo>

D. Networking & ingress

The service is reachable at its run.app URL by default. 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. Note that Uptime Kuma also makes outbound connections — every monitor check is an egress call from the container.

  • 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. Yes — you can point a Google Cloud uptime check at your Uptime Kuma instance to monitor the monitor.

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

3. Uptime Kuma Application Behaviour

  • No initialization jobs. Uptime Kuma creates its embedded SQLite schema automatically on first boot; there is no db-init or migration job, and initialization_jobs defaults to [].
  • First-run setup. On first access, Uptime Kuma presents a setup page asking you to create the admin account — there are no default credentials baked into the image. The account is stored in SQLite on the NFS volume, so it persists across revisions.
  • The check scheduler runs in-process. Monitor polling, retries, and notification dispatch all run inside the Node.js process, driven by timers — not by inbound HTTP requests. This is why cpu_always_allocated = true is the default and why continuous monitoring additionally requires an instance to be running (min_instance_count = 1).
  • Scale-to-zero pauses monitoring. With the default min_instance_count = 0, Cloud Run stops the last instance when it goes idle. While scaled to zero, no checks execute and no alerts fire; polling resumes when the next request (e.g. opening the dashboard) cold-starts an instance. This is safe for casual/lab use but wrong for production monitoring.
  • Single-writer SQLite. SQLite is a single-writer database. Multiple concurrent instances writing the same SQLite file over NFS risk lock contention or corruption — keep max_instance_count = 1 in production.
  • Health path. Startup and liveness probes target / on port 3001, which returns HTTP 200 once the app is up. The startup probe allows up to 30 s initial delay plus 30 failures at 10 s intervals.
  • Verification:
    SERVICE=$(gcloud run services list --project "$PROJECT" --region "$REGION" \
    --filter="metadata.name~uptimekuma" --format="value(metadata.name)" --limit=1)
    SERVICE_URL=$(gcloud run services describe "$SERVICE" \
    --project "$PROJECT" --region "$REGION" --format="value(status.url)")
    curl -s -o /dev/null -w "%{http_code}\n" "$SERVICE_URL/"

4. Configuration Variables

Variables are grouped exactly as they appear on the deployment platform. Only settings specific to or notable for Uptime Kuma 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.

All other inputs follow standard App_CloudRun behaviour.

Group 2 — Deployment Environment

VariableDefaultDescription
tenant_deployment_iddemoShort suffix that makes resource names unique per environment.
support_users[]Emails granted project access and monitoring alerts.

All other inputs follow standard App_CloudRun behaviour.

Group 3 — Application Identity

VariableDefaultDescription
application_nameuptimekumaBase name for resources. Do not change after first deploy.
application_version1Uptime Kuma image tag — the v1 stable line (embedded SQLite).

All other inputs follow standard App_CloudRun behaviour.

Group 4 — Runtime & Scaling

VariableDefaultDescription
container_image_sourceprebuiltDeploys the official image directly — no Cloud Build.
container_imagelouislam/uptime-kumaOfficial upstream image, mirrored into Artifact Registry.
enable_image_mirroringtrueCopy the image into Artifact Registry to avoid Docker Hub rate limits.
cpu_limit / memory_limit1000m / 512MiAmple for dozens of monitors; raise memory for very large monitor counts.
min_instance_count0Set to 1 for 24/7 monitoring — while scaled to zero, no checks run.
max_instance_count3Set to 1 for production — SQLite is single-writer (see Pitfalls).
cpu_always_allocatedtrueKeep true. The in-process check scheduler needs CPU between requests; request-based billing throttles it to ~0 and checks stall.
container_port3001Uptime Kuma's native port.
execution_environmentgen2Required for the NFS mount.
enable_cloudsql_volumefalseUnused — no external database.

All other inputs follow standard App_CloudRun behaviour.

Group 5 — Access & Networking

VariableDefaultDescription
ingress_settingsallPublic status pages need public ingress; use IAP/internal for private dashboards.
vpc_egress_settingPRIVATE_RANGES_ONLYRoutes private-range traffic through the VPC (needed to monitor internal targets). Set ALL_TRAFFIC to route all monitor probes through the VPC (e.g. for a stable NAT egress IP or if public probes fail).
enable_iapfalsePut the dashboard behind Google identity if it should not be public.

All other inputs follow standard App_CloudRun behaviour.

Group 11 — Storage & Filesystem

VariableDefaultDescription
enable_nfstrueRequired. Provisions the Filestore share holding all Uptime Kuma state.
nfs_mount_path/app/dataMust remain /app/data — Uptime Kuma's writable data directory.
storage_buckets / gcs_volumes[]Not needed — no GCS storage is used.

All other inputs follow standard App_CloudRun behaviour.

Group 12 — Database Backend

VariableDefaultDescription
database_typeNONEFixed by design — Uptime Kuma v1 uses embedded SQLite; no Cloud SQL is provisioned.
application_database_name / application_database_useruptimekumaDeclared for convention mirroring; unused.

All other inputs follow standard App_CloudRun behaviour.

Group 13 — Jobs & Scheduled Tasks

VariableDefaultDescription
initialization_jobs[]None needed — the SQLite schema is created on first boot.
cron_jobs[]Recurring Cloud Run jobs triggered by Cloud Scheduler.

All other inputs follow standard App_CloudRun behaviour.

Group 14 — Observability & Health

VariableDefaultDescription
startup_probeHTTP /, 30 s delay, 30 failuresPassed through UptimeKuma_Common.
liveness_probeHTTP /, 30 s delay, 3 failuresPassed through UptimeKuma_Common.
uptime_check_configenabled = falseOptional Cloud Monitoring uptime check against / — monitoring for the monitor.

All other inputs follow standard App_CloudRun behaviour.

Group 16 — Redis Cache

VariableDefaultDescription
enable_redisfalseUptime Kuma does not use Redis; leave disabled.

All other inputs follow standard App_CloudRun behaviour.

Group 22 — VPC Service Controls & Audit Logging

VariableDefaultDescription
enable_vpc_scfalseEnforce a VPC-SC perimeter.
enable_audit_loggingfalseDetailed Cloud Audit Logs.

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_user / database_password_secret / database_host / database_portEmpty/unset — no Cloud SQL is provisioned (database_type = "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 setup jobs (empty by default).
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.
cicd_enabled / github_repository_url / cicd_configuration / cloudbuild_trigger_name / cloudbuild_trigger_id / artifact_registry_repositoryCI/CD status, build trigger, and registry details.
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).

SettingSensible valueRiskConsequence if wrong
cpu_always_allocatedtrue (default)CriticalRequest-based billing throttles CPU to ~0 between requests — the in-process check scheduler stalls, checks fire late or not at all, and alerts are missed. The monitoring loop IS the product.
enable_nfstrue (default)CriticalWithout the NFS volume, the SQLite database (monitors, history, admin account) lives on ephemeral disk and is wiped on every restart or new revision.
nfs_mount_path/app/data (default)CriticalAny other path leaves Uptime Kuma writing to ephemeral storage — silent total data loss on restart.
min_instance_count1 for production monitoringCriticalWith the default 0, the service scales to zero when idle and no checks run while it is down — outages in monitored systems go unnoticed.
max_instance_count1 for productionHighSQLite is single-writer; multiple instances writing over NFS risk lock contention or database corruption.
container_port3001 (default)CriticalMismatching Uptime Kuma's native port fails all health probes and the revision never becomes ready.
database_typeNONE (default)HighProvisioning Cloud SQL wastes money — Uptime Kuma v1 cannot use it.
execution_environmentgen2 (default)HighNFS mounts require gen2; gen1 cannot mount Filestore.
vpc_egress_settingper target scopeMediumPRIVATE_RANGES_ONLY routes only private-range probes through the VPC; set ALL_TRAFFIC if monitor probes to external targets need VPC/NAT egress.
enable_iap / ingress_settingsIAP or internal for private dashboardsMediumThe dashboard (and setup page, on first deploy) is otherwise publicly reachable at the run.app URL. Complete first-run admin setup immediately after deploy.
enable_image_mirroringtrue (default)LowDirect pulls from Docker Hub can hit rate limits and break deploys.

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. Uptime Kuma-specific application configuration shared with the GKE variant is described in UptimeKuma_Common.