Skip to main content

Jellystat on Google Cloud Run

Jellystat on Google Cloud Run

Jellystat is an open-source statistics and analytics dashboard for Jellyfin media servers, tracking playback history, active sessions, user activity, library growth, and viewing trends. This module deploys Jellystat 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 Jellystat 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 Jellystat costs on RAD, and how that compares​

Jellystat on RAD's Cloud Run module costs about US$68 a month in your own project, plus a 40-credit (US$4) module fee once per deployment. Most of that is the PostgreSQL database it needs to retain your Jellyfin playback history. If you only need it while actively tuning your media server, see "Pause it for free" below to stop paying without losing that history. Jellystat also ships as a GKE module, which costs more here (about US$93/month) — Cloud Run is the lower-cost choice unless you already run GKE Autopilot for other apps.

What you pay on RAD​

In a Google Cloud project you ownIn a project RAD manages for you
Module fee, once per deployment40 credits (US$4.00)36 credits (10% lower)
Build timeA few credits per buildThe same
Google Cloud running costBilled by Google to your own billing account, about US$67.80 a month for the default configuration (table below)Metered hourly in credits; RAD publishes 26 credits a day
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, less on a plan. In a project RAD manages, the database, file server and network are shared by every application in the project, so a second application does not add a second database.

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

Resource (module default)Per month
Cloud Run, 1x vCPU / 0.5 GiB (scaleToZero)US$10.78
Cloud SQL for PostgreSQL, 1 vCPU / 3.75 GB, zonal, 10 GB SSDUS$51.02
Cloud NAT and networkingUS$5.00
Cloud Storage (add-ons, backups)US$1.00
Totalabout US$67.80

How it compares​

  • Jellystat is a companion analytics dashboard for a Jellyfin server you already run, not a product with its own hosted plan, so there is nothing to compare it against directly.
  • Its own footprint is light (1 vCPU, 0.5–1 GiB), so a Hetzner CPX22 or DigitalOcean 2 vCPU/4 GB droplet (about $24/month) is more than enough on its own — most of this module's cost is actually the PostgreSQL database it needs to retain playback history, which a bare VPS would also need you to run and back up yourself.
  • Because Jellystat is usually deployed alongside Jellyfin in the same project, the database here may be the one genuinely new cost of adding it — worth checking whether your Jellyfin deployment already has a database you could point this at instead of provisioning a second one.

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

If Jellystat runs in a project RAD manages for you and you expect to come back to it — a break between courses, a seasonal lull, or simply not knowing yet whether you'll need it next month — this is the better option, and it costs almost nothing.

Deleting a RAD-managed project unlinks its billing first, then asks Google to delete the project outright: Google's own 30-day recoverable soft delete. Unlike deleting Jellystat as a single module, this does not tear down the Cloud Run/GKE service, Cloud SQL database and networking one by one — the whole project simply stops, and nothing is charged while it waits, because billing is already unlinked.

Restoring, within 30 days and only by the project's owner, 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. This costs only a handful of credits (under US$1) in build time for a typical chain of deployments.

What this needs: you must own the project (not one RAD only manages billing for), you must restore it yourself within 30 days — after that Google deletes it for good — and restoring is admitted like creating a new project, so your purchased credit balance must still clear the tier's floor (100 credits for the sandbox tier most use fits). Google says most services are fully working again within 36 hours of a restore.

One real gap: nightly backups are written to a bucket inside the project, and that bucket has Cloud Storage's soft-delete explicitly turned off, so it is very likely gone as soon as you delete the project, even though the project itself is recoverable for 30 days. Jellystat's own nightly export of its database is kept in that bucket; for a default install this is the only copy of your viewing-history data worth keeping.

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

In your own project, or once the 30-day window above has passed, the fallback is to delete Jellystat outright and redeploy it later.

  • What a redeploy costs: the module fee again, plus the builds — roughly the module fee shown above plus 3–6 credits of build time.
  • When it's worth it: deleting saves money only once Jellystat would otherwise sit unused for about 2 days or more in your own project (about 2 days or more in a RAD-managed one). The PostgreSQL database is most of the running cost here, so deleting Jellystat alone saves the whole bill above unless something else in the project shares it.
  • Keep data first. Nightly backups are written to a bucket inside the deployment, and that bucket is deleted with it — copy the latest backup out (to Google Drive, or a bucket you keep) 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 the app 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 the app 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; RAD fees and the daily-credit estimate from radmodules.dev/pricing; Google Cloud: delete and restore projects for the pause/restore mechanism. Prices change; check each source before relying on a figure.


1. Overview​

Jellystat runs as a single Node.js/Express container (with a bundled React frontend) on Cloud Run v2. 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, serverless autoscaling; scale-to-zero supported
DatabaseCloud SQL for PostgreSQL 15Required — non-standard POSTGRES_* env var names
Object storageCloud StorageA small optional backups bucket for database export archives
SecretsSecret ManagerAuto-generated JWT_SECRET; database password
IngressCloud Run URLDefault run.app URL; optional external HTTPS load balancer + custom domain

Sensible defaults worth knowing up front:

  • PostgreSQL 15 is mandatory. The database engine is fixed by the shared application layer.
  • Non-standard database env var names. Jellystat reads POSTGRES_IP, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DATABASE — not POSTGRES_DB** (community-confirmed that name does not work), and not the platform's generic DB_* names. Both sets are injected side by side via main.tf's db_*_env_var_name aliasing.
  • container_port = 3000 is fixed. Jellystat's server hardcodes this port; it is not configurable via environment variable (see upstream issue #314). The variable exists for Foundation convention parity only.
  • JWT_SECRET is generated automatically and stored in Secret Manager. It signs Jellystat's session/auth tokens.
  • No Redis support. Jellystat has no native Redis integration; enable_redis and related variables are inert.
  • Scale-to-zero is enabled by default (min_instance_count = 0). Cold starts add a few seconds of latency to the first request after idle.
  • No environment variable pairs Jellystat with a Jellyfin server. This is the single most important operational fact about this module: Jellystat's Jellyfin connection (server URL + API key) is entered entirely through its own web UI after first boot, and has no Terraform-automatable equivalent. See §3 below.

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 Jellystat service​

Jellystat runs as a Cloud Run v2 service that autoscales by request load between the minimum and maximum instance counts.

  • 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. Cloud SQL for PostgreSQL 15​

Jellystat stores all playback/analytics data in a managed Cloud SQL for PostgreSQL 15 instance. The service connects privately through the Cloud SQL Auth Proxy over a Unix socket. On first deploy an initialization Job creates the application database and user. Jellystat then applies its own schema migrations automatically on startup.

  • Console: SQL → select the instance for connections, backups, flags, metrics.
  • CLI:
    gcloud sql instances list --project "$PROJECT"
    gcloud sql instances describe <instance-name> --project "$PROJECT"
    gcloud sql connect <instance-name> --user=<db-user> --database=<db-name> --project "$PROJECT"

The instance name, database, user, and password secret are in the Outputs. See App_CloudRun for the connection model, backups, and password rotation.

C. Cloud Storage​

An optional, small Cloud Storage bucket (backups) is provisioned for Jellystat's own database export/backup archive feature.

  • Console: Cloud Storage → Buckets.
  • CLI:
    gcloud storage buckets list --project "$PROJECT"

D. Secret Manager​

One cryptographic secret is generated automatically and stored in Secret Manager: JWT_SECRET (used to sign Jellystat session/auth tokens). The database password is managed separately by the foundation.

  • 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.

E. 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.

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

See App_CloudRun.

F. Cloud Logging & Monitoring​

Container logs flow to Cloud Logging; Cloud Run and Cloud SQL metrics flow to Cloud Monitoring, with optional uptime checks and alert policies.

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

3. Jellystat Application Behaviour​

  • First-deploy database setup. An initialization Job runs db-init.sh using postgres:15-alpine. It connects through the Cloud SQL Auth Proxy and idempotently creates the application role and database. The job is safe to re-run.
  • Database migrations on start. Jellystat applies its own schema migrations automatically on every startup — no separate migrate job exists in this module.
  • JWT_SECRET is generated once and stored in Secret Manager. Rotating it invalidates all active user sessions (users must log back in) but causes no data loss.
  • Health path. Startup, liveness, and uptime probes target GET /auth/isConfigured — a public, unauthenticated endpoint that returns 200 as soon as the server is up.
  • Manual Jellyfin pairing is required after first boot — this cannot be automated by Terraform. Jellystat has no environment variable for the companion Jellyfin server's URL or API key; the pairing is entirely UI-driven:
    1. Open the deployed Jellystat URL and create the first admin account.
    2. In your Jellyfin server's own Dashboard → API Keys, generate a new API key for Jellystat.
    3. In Jellystat's settings, enter your Jellyfin server's URL and paste in that API key. If you don't already have a Jellyfin server deployed, deploy one first with the sibling Jellyfin_CloudRun module (or Jellyfin_GKE) — see its own configuration guide.
  • Inspect job execution:
    gcloud run jobs list --project "$PROJECT" --region "$REGION"
    gcloud run jobs executions list --job <job-name> --project "$PROJECT" --region "$REGION"

4. Configuration Variables​

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

Group 3 — Application Identity​

VariableDefaultDescription
application_namejellystatBase name for resources. Do not change after first deploy.
application_display_nameJellystatHuman-readable name shown in the Console.
application_versionlatestContainer image version tag — passed through to the cyfershepard/jellystat image tag.

Group 4 — Runtime & Scaling​

VariableDefaultDescription
container_image_sourceprebuiltDeploys the official cyfershepard/jellystat image directly. Do not set custom — there is no Dockerfile for this app.
container_image""Leave blank to use the default image.
container_port3000Fixed — matches Jellystat's hardcoded internal port. Changing this variable has no effect on the app.
cpu_limit / memory_limit1000m / 512MiContainer resources.
min_instance_count / max_instance_count0 / 1Scale-to-zero by default.
enable_cloudsql_volumetrueCloud SQL Auth Proxy for socket connections.

Group 11 — Storage & Filesystem​

VariableDefaultDescription
enable_nfsfalseOff — Jellystat has no shared-file storage need.
create_cloud_storagetrueCreates the small backups bucket.
gcs_volumes[]Not used by default.

Group 12 — Database Backend​

VariableDefaultDescription
database_typePOSTGRES_15Fixed.
application_database_namejellystat_dbInjected as both DB_NAME and POSTGRES_DATABASE. Immutable after first deploy.
application_database_userjellystat_userInjected as both DB_USER and POSTGRES_USER.
initialization_jobs[]Leave empty to use the built-in db-init job.

Group 14 — Observability & Health​

VariableDefaultDescription
startup_probe / liveness_probeHTTP /auth/isConfiguredPublic, unauthenticated health endpoint.
uptime_check_config{ enabled = false, path = "/auth/isConfigured" }Enable explicitly to activate.

Group 21 — Redis (not consumed)​

VariableDefaultDescription
enable_redis / redis_host / redis_port / redis_authoff / emptyNot consumed. Jellystat has no native Redis integration.

All other inputs are inherited from App_CloudRun.md with standard behaviour.


5. Outputs​

OutputDescription
service_nameCloud Run service name.
service_urlDefault run.app URL of the service.
service_locationRegion the service runs in.
load_balancer_ip / load_balancer_urlExternal HTTPS load balancer IP / URL (when enabled).
database_instance_nameCloud SQL instance name.
database_name / database_userApplication database name / user.
database_password_secretSecret Manager secret holding the DB password.
database_host / database_portDB endpoint / port.
storage_bucketsCreated Cloud Storage buckets (backups).
container_image / container_registryDeployed image and Artifact Registry repo.
monitoring_enabled / uptime_check_namesMonitoring status and uptime checks.
initialization_jobsNames of the setup jobs (db-init).
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.
vpc_sc_enabled / vpc_sc_perimeter_name / vpc_sc_dry_run_modeVPC-SC 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
application_database_name / application_database_userSet onceCriticalImmutable after first deploy; renaming recreates the DB/user and destroys all data.
JWT_SECRET (auto-generated)Only rotate deliberatelyMediumRotating it invalidates all active sessions — users must log back in — but causes no data loss.
container_image_sourceprebuiltCriticalSetting custom fails the Cloud Build step — there is no Dockerfile for Jellystat in this catalogue.
container_port3000 (informational)LowJellystat's server hardcodes port 3000 regardless of this variable's value.
Jellyfin URL/API key pairingManual, post-deployHighThere is no environment variable for this — skipping the manual UI step leaves Jellystat showing no data even though the deployment is healthy.
enable_redisleave falseLowJellystat has no Redis integration; setting true has no effect.
startup_probe/liveness_probe path/auth/isConfiguredHighPointing probes at an authenticated endpoint causes 401/403 and the revision never becomes Ready.
min_instance_count0 (default) is fineLowJellystat is a request/response dashboard with no background scheduler — no need for always-on CPU.

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

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