Skip to main content

Jellyfin on GKE Autopilot

Jellyfin on GKE Autopilot

Jellyfin is a free, open-source (GPLv2) self-hosted media server for streaming your own movies, TV shows, music, photos, and live TV. Written in .NET/C# and maintained as a community fork of Emby, it has no tracking, no ads, and no premium tier. This module deploys Jellyfin on GKE Autopilot on top of the App_GKE foundation, which provisions and manages the shared Google Cloud and Kubernetes infrastructure.

This guide focuses on the cloud services Jellyfin uses and how to explore and operate them from the Google Cloud Console and the command line. For the mechanics that are common to every GKE application — Workload Identity, ingress, autoscaling, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC Service Controls, backups, and the deployment lifecycle — refer to the App_GKE foundation guide rather than repeating them here.


1. Overview

Jellyfin runs as a stateful .NET workload. On GKE this is the recommended home for a real media library: a StatefulSet backed by a real block PVC at /config gives correct POSIX filesystem semantics for SQLite and the transcode cache. The deployment wires together a focused set of Google Cloud services:

CapabilityGoogle Cloud serviceNotes
ComputeGKE Autopilot.NET StatefulSet pod, 1 vCPU / 1 GiB by default
PersistencePersistent Disk (block PVC)/config on a per-pod PVC — the recommended store for SQLite + transcode cache
DatabaseInternal SQLite (embedded)No Cloud SQL — Jellyfin keeps all state in SQLite files under /config
Object / file storageCloud Storage (GCS FUSE) / Filestore (NFS)Optional, for large media libraries
SecretsSecret ManagerOptional auto-generated API key; no mandatory cryptographic secrets
IngressCloud Load BalancingClusterIP by default; optional custom domain + managed certificate

Sensible defaults worth knowing up front:

  • There is no external database. Jellyfin stores its entire state — the SQLite library and playback databases, configuration XML, cached metadata and artwork, plugins, transcode cache, and logs — under /config. No Cloud SQL instance, no db-init job, and no Redis is used (database_type = NONE; the foundation Redis variables are inert for Jellyfin).
  • A block PVC at /config is the best fit. stateful_pvc_enabled = true resolves the workload to a StatefulSet with a per-pod PVC mounted at /config, and the GCS storage volume auto-disables to avoid a double mount. Real block storage gives the correct filesystem semantics SQLite and the transcode cache need — the recommended configuration for a media server.
  • The container listens on port 8096. Jellyfin's web/API port is set by Jellyfin_Common. The web UI and first-run setup wizard are served at /web (and /); GET /health returns Healthy (200, unauthenticated).
  • There are no default credentials. On first access the setup wizard creates the administrator account and adds media libraries. Nothing is usable until then.
  • Single replica. min_instance_count = 1 / max_instance_count = 1 — one shared SQLite library on one volume. Do not run multiple replicas; concurrent writers against one SQLite file corrupt the library.
  • NFS is optional, for large libraries. enable_nfs = false by default. Enable it to mount a shared Filestore volume for a large media collection that outgrows a single PVC.
  • API-key auth is optional and off by default. enable_api_key = false. Primary authentication is the wizard-created admin account; per-application API keys are created in-app under Dashboard → API Keys.

GKE vs Cloud Run — GKE is the production media server. GKE (this module) runs Jellyfin as a StatefulSet with a real block PVC at /config, giving true POSIX semantics for SQLite and the transcode cache, plus optional NFS for large media libraries — the recommended choice for a real, multi-user, transcoding media server. Jellyfin_CloudRun mounts /config from a GCS bucket over FUSE; it is simpler and cheaper for a demo or a small personal library, but FUSE latency and the per-request timeout model make it a poor fit for live transcoding or busy streaming.


2. Google Cloud Services & How to Explore Them

All commands assume you have run gcloud container clusters get-credentials <cluster> --region <region> --project <project> and that PROJECT, REGION, and NAMESPACE are set. The namespace and other identifiers are reported in the deployment Outputs.

A. GKE Autopilot — the Jellyfin workload

Jellyfin pods are scheduled on Autopilot, which bills for the CPU/memory the pods actually request. With a block PVC the workload is a StatefulSet with a stable pod identity and orderly restarts.

  • Console: Kubernetes Engine → Workloads → select the Jellyfin workload to see pods, events, and the StatefulSet. Kubernetes Engine → Services & Ingress shows the external IP (when exposed).
  • CLI:
    kubectl get pods,svc,statefulset,pvc -n "$NAMESPACE"
    kubectl logs -n "$NAMESPACE" statefulset/<service-name> --tail=100
    kubectl describe pod -n "$NAMESPACE" <pod-name>

See App_GKE for how Autopilot, scaling, and the workload type (Deployment vs StatefulSet) are managed.

B. Persistent configuration store (SQLite on the PVC)

Jellyfin has no external database. Its entire state — the SQLite library and playback databases, configuration XML, cached metadata and artwork, installed plugins, the transcode cache, and logs — lives under /config (JELLYFIN_CONFIG_DIR = /config). There is no Cloud SQL instance, no Auth Proxy, and no initialization Job to create a schema; Jellyfin creates and migrates its own SQLite databases on first start.

On GKE, /config is backed by a per-pod block PVC (stateful_pvc_enabled = true, mounted at /config), which is the recommended store because SQLite and the transcode cache need true POSIX filesystem semantics that object storage cannot provide.

  • Inspect the PVC and its bound disk:
    kubectl get pvc -n "$NAMESPACE"
    kubectl describe pvc -n "$NAMESPACE" <pvc-name>

C. Cloud Storage & NFS (optional, for large libraries)

The auto-provisioned Cloud Storage bucket (name suffix storage, STANDARD, force_destroy = true, versioning off, public_access_prevention = enforced) is available for additional GCS FUSE mounts. When a block PVC is enabled the GCS storage volume is auto-disabled for /config to avoid a double mount. For large media collections, enable NFS (enable_nfs = true) to mount a shared Filestore volume.

  • Console: Cloud Storage → Buckets; Filestore → Instances.
  • CLI:
    gcloud storage buckets list --project "$PROJECT"
    gcloud filestore instances list --project "$PROJECT"

See App_GKE for CMEK options and the GCS FUSE CSI driver.

D. First-run setup & the media library

On first access Jellyfin serves an interactive setup wizard at /web (and /) that creates the administrator account, sets the preferred language, and lets you add media libraries (Movies, TV, Music, Photos). Nothing is authenticated or usable until you complete the wizard — there are no default credentials.

Media libraries point at paths inside the container: the block PVC at /config, an optional NFS mount for large collections, or additional GCS FUSE volumes.

  • Reach the wizard / web UI:
    kubectl get svc,ingress -n "$NAMESPACE"      # external IP / hostname
    kubectl port-forward -n "$NAMESPACE" statefulset/<service-name> 8096:8096
    # then open http://localhost:8096/web

E. Secret Manager & the optional API key

Jellyfin requires no mandatory cryptographic secrets — there is no encryption key, JWT, or master password to manage. When enable_api_key = true, the module generates a 32-character random value, stores it in Secret Manager as secret-<prefix>-<app>-api-key (surfaced as the jellyfin_api_key_secret_id output), and injects it so external callers can authenticate programmatically. In day-to-day use, API keys are created and revoked in-app under Dashboard → API Keys; primary auth remains the wizard admin account.

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

See App_GKE for the Secret Store CSI integration and rotation.

F. Networking & ingress

By default service_type = ClusterIP, keeping the media server in-cluster. Set service_type = LoadBalancer for an external IP, or enable a custom domain with a Google-managed certificate via the Kubernetes Gateway API. A static IP can be reserved so the address survives redeploys.

  • Console: Network services → Load balancing; VPC network → IP addresses.
  • CLI:
    kubectl get ingress,svc -n "$NAMESPACE"
    gcloud compute addresses list --project "$PROJECT"

See App_GKE for custom domains, Cloud CDN, and static IP details.

G. Cloud Logging & Monitoring

Pod stdout/stderr flow to Cloud Logging; GKE metrics flow to Cloud Monitoring. Optional uptime checks and alert policies are available.

  • Console: Logging → Logs Explorer; Monitoring → Dashboards / Alerting.
  • CLI:
    gcloud logging read 'resource.type="k8s_container" AND resource.labels.namespace_name="'"$NAMESPACE"'"' \
    --project "$PROJECT" --limit 50

3. Jellyfin Application Behaviour

  • No initialization Job. Jellyfin needs no db-init step — it creates and migrates its own SQLite databases under /config the first time it starts. Leave initialization_jobs empty unless you have custom data-loading tasks.
  • First-run wizard creates the admin. The /web setup wizard walks you through creating the administrator account and adding libraries. Until it is completed the server has no users and no content.
  • /config is the single source of truth — persist it. All library state is on the block PVC. Deleting the PVC wipes the library, plugins, and users. The StatefulSet keeps the PVC bound to the pod identity across restarts.
  • Custom image is a thin wrapper. The Dockerfile is ARG JELLYFIN_VERSION=10.10.3 / FROM jellyfin/jellyfin:${JELLYFIN_VERSION}, so the Foundation mirrors it into Artifact Registry (enable_image_mirroring = true) and sets imagePullPolicy = Always for the mirrored image. application_version = "latest" resolves to the pinned 10.10.3 via the app-specific JELLYFIN_VERSION build arg — it is not overwritten by the Foundation's generic APP_VERSION injection.
  • fsGroup for a group-writable PVC. Jellyfin runs as UID 1000 / GID 2000; stateful_fs_group = 3000 (the Jellyfin Helm chart default) ensures the PVC is group-writable.
  • Health path. Startup and liveness probes target GET /health, which returns Healthy (200) without authentication once the server is ready. The startup probe allows a 15-second initial delay with a generous retry window; the liveness probe polls every 30 seconds.
  • Transcoding is CPU-heavy and GPU-less. Autopilot pods have no GPU, so prefer direct-play clients. Size cpu_limit up for live transcoding and memory_limit up for large libraries.

4. Configuration Variables

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

Group 1 — Project & Identity

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

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.
resource_labels{}Labels applied to all resources for cost/ownership tracking.

Group 3 — Application Identity

VariableDefaultDescription
application_namejellyfinBase name for resources. Do not change after first deploy.
application_display_nameJellyfin Media ServerHuman-readable name shown in the platform UI.
application_versionlatestJellyfin image tag; latest pins to 10.10.3 via the JELLYFIN_VERSION build arg.
enable_api_keyfalseGenerate a random API key in Secret Manager. Recommended when reachable outside the namespace.

Group 4 — Runtime & Scaling

VariableDefaultDescription
deploy_applicationtrueSet false to provision infrastructure only.
cpu_limit1000mCPU per pod; raise for live transcoding.
memory_limit1GiMemory per pod; raise for large libraries.
min_instance_count1Minimum replicas; keep at 1 (single shared library).
max_instance_count1Keep at 1. One shared SQLite library on one volume — never run multiple replicas.
container_port8096Jellyfin's web/API port (set by Jellyfin_Common; not forwarded to App_GKE).
timeout_seconds300Maximum request duration (0–3600 seconds).
enable_cloudsql_volumefalseJellyfin has no Cloud SQL — leave false.
enable_image_mirroringtrueMirror jellyfin/jellyfin into Artifact Registry.
enable_vertical_pod_autoscalingfalseVPA optimises requests; disables HPA when on.

Group 5 — Environment Variables & Secrets

VariableDefaultDescription
environment_variables{}Extra non-secret settings for the Jellyfin container.
secret_environment_variables{}Map of env var → Secret Manager secret name.
secret_propagation_delay30Seconds to wait after secret creation before proceeding.
secret_rotation_period2592000sSecret Manager rotation notification frequency.

Group 6 — GKE Backend & Cluster

VariableDefaultDescription
service_typeClusterIPHow the Kubernetes Service is exposed; LoadBalancer for external access.
workload_typenullStatefulSetResolves to StatefulSet when stateful_pvc_enabled = true.
session_affinityNoneSession affinity mode for the Service.
namespace_name""Auto-generated from application_name + tenant_deployment_id when empty.
network_tags["nfsserver"]nfsserver is required when enable_nfs = true.
termination_grace_period_seconds60Seconds after SIGTERM before SIGKILL — allows in-flight writes to flush.
enable_network_segmentationfalseCreate Kubernetes NetworkPolicy resources.

Group 7 — StatefulSet

VariableDefaultDescription
stateful_pvc_enablednullEnable the PVC template. Recommended true for Jellyfin — auto-resolves to StatefulSet.
stateful_pvc_size20GiPer-pod PVC size; size to hold /config (SQLite, metadata, transcode cache).
stateful_pvc_mount_path/configContainer mount path for the PVC (Jellyfin's config/persistence dir).
stateful_pvc_storage_classstandard-rwoBalanced PD; use premium-rwo for higher IOPS.
stateful_headless_servicenullHeadless Service for stable pod DNS names.
stateful_pod_management_policynullOrderedReadySafe ordered restarts for Jellyfin.
stateful_update_strategynullRollingUpdateUpdate strategy.
stateful_fs_group3000Pod fsGroup so the PVC is group-writable (Jellyfin UID 1000 / GID 2000).

Group 8 — Resource Quota

enable_resource_quota (false) plus quota_cpu_requests / quota_cpu_limits / quota_memory_requests / quota_memory_limits / quota_max_pods / quota_max_services / quota_max_pvcs — namespace ResourceQuota. The quota *_requests / *_limits values are not forwarded in this module and are inert; memory values, if used elsewhere, must carry binary unit suffixes (4Gi, 8192Mi).

Group 9 — Reliability Policies

VariableDefaultDescription
enable_pod_disruption_budgettrueProtect availability during node upgrades.
pdb_min_available1Minimum pods available during voluntary disruptions.

Group 10 — Observability & Health

VariableDefaultDescription
startup_probeHTTP /health 15s delayStartup probe; /health returns 200 once ready.
liveness_probeHTTP /health 30s delayLiveness probe.
startup_probe_configHTTP /healthApp_GKE-level infrastructure startup probe.
health_check_configHTTP /healthApp_GKE-level liveness probe.
uptime_check_config{ enabled=false, path="/health" }Optional Cloud Monitoring uptime check.
alert_policies[]Optional metric alert policies.

Group 11 — Jobs & Scheduled Tasks

VariableDefaultDescription
initialization_jobs[]Jellyfin needs no init job; provide only for custom data-loading tasks.
cron_jobs[]Scheduled Kubernetes CronJobs (e.g. maintenance tasks).
additional_services[]Sidecar or helper services deployed alongside Jellyfin.

Group 12 — CI/CD & GitHub Integration

Standard App_GKE Cloud Build / Cloud Deploy integration — see App_GKE. Key inputs: enable_cicd_trigger, github_repository_url, github_token, enable_cloud_deploy, enable_binary_authorization.

Group 13 — Filesystem (NFS)

VariableDefaultDescription
enable_nfsfalseProvision Cloud Filestore (NFS); enable for large shared media libraries.
nfs_mount_path/mnt/nfsMount path inside the container.
nfs_volume_namenfs-data-volumeVolume name for the NFS mount.

Group 14 — Cloud Storage & Artifact Registry

VariableDefaultDescription
create_cloud_storagetrueProvision the Jellyfin storage bucket and any extras.
storage_buckets[]Additional buckets to provision.
gcs_volumes[]Additional GCS FUSE volume mounts via the CSI driver.
manage_storage_kms_iam / enable_artifact_registry_cmekfalseCMEK options.
max_images_to_retain / delete_untagged_images / image_retention_days7 / true / 30Artifact Registry cleanup policy.

Group 16 — Database Configuration

database_type (NONE), database_password_length, application_database_name (jellyfindb), application_database_user (jellyfinuser), enable_mysql_plugins, enable_postgres_extensions, db_* / db_*_env_var_nameall inert for Jellyfin (no SQL database); retained and forwarded for foundation compatibility.

Group 15 — Redis (forwarded for foundation compatibility)

enable_redis, redis_host, redis_port, redis_authnot applicable to Jellyfin, which uses no cache or queue. Forwarded to the foundation only for compatibility; leave at defaults.

Group 17 — Backup & Maintenance

VariableDefaultDescription
backup_schedule0 2 * * *Automated backup cron (UTC) of the /config volume.
backup_retention_days7Retention; raise to 30–90 for production.
enable_backup_import / backup_source / backup_uri / backup_formatrestore optionsRestore a /config snapshot on deploy (tar default).

Group 19 — Custom Domain, Static IP & Networking

VariableDefaultDescription
enable_custom_domaintrueProvision Ingress for custom hostnames + managed certificate.
application_domains[]Hostnames to serve.
reserve_static_iptrueStable external IP across redeploys.
static_ip_name""Auto-generated when empty.

Group 20 — Identity-Aware Proxy (IAP)

Warning: Enabling IAP requires Google identity authentication for all inbound requests. Requires enable_custom_domain or enable_cdn to be true.

VariableDefaultDescription
enable_iapfalseRequire Google sign-in in front of Jellyfin.
iap_authorized_users / iap_authorized_groups[]Who may access.
iap_oauth_client_id / iap_oauth_client_secret""Required when IAP is enabled (sensitive).

Group 21 — Cloud Armor & CDN

VariableDefaultDescription
enable_cloud_armorfalseAttach a Cloud Armor (WAF) policy to the Ingress backend.
admin_ip_ranges[]CIDRs allowed privileged access.
cloud_armor_policy_namedefault-waf-policyPolicy name.
enable_cdnfalseEnable Cloud CDN on the GKE Ingress backend.

Group 22 — VPC Service Controls & Audit Logging

VariableDefaultDescription
enable_vpc_scfalseEnforce a VPC-SC perimeter (requires organization_id).
vpc_cidr_ranges / vpc_sc_dry_run[] / trueAccess level CIDRs / dry-run mode.
enable_audit_loggingfalseDetailed Cloud Audit Logs.

5. Outputs

These values are returned on a successful deployment and are the quickest way to locate and explore the running resources.

OutputDescription
service_nameKubernetes Service name.
namespaceNamespace the workload runs in.
service_cluster_ipIn-cluster ClusterIP.
stage_service_cluster_ipsMap of ClusterIPs for stage-specific services.
service_external_ipExternal LoadBalancer IP (when a static IP is reserved).
service_urlURL to reach Jellyfin.
jellyfin_api_key_secret_idSecret Manager secret ID for the API key (empty when enable_api_key = false).
storage_bucketsCreated Cloud Storage buckets.
network_name / network_exists / regionsVPC network, presence, available regions.
container_image / container_registryDeployed image and Artifact Registry repo.
monitoring_enabled / monitoring_notification_channelsMonitoring status and channels.
initialization_jobsNames of any setup jobs (empty for a default Jellyfin deploy).
statefulset_nameName of the StatefulSet.
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.
cicd_enabled / cicd_configurationCI/CD status and details (repo, trigger, registry).
github_repository_url / github_repository_owner / github_repository_nameCI/CD GitHub details.
artifact_registry_repository / cloudbuild_trigger_name / cloudbuild_trigger_idRegistry and build trigger.
kubernetes_readyWhether the cluster/workload is ready.
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_GKE foundation engine, which validates values and combinations at plan time — a Deployment workload alongside stateful_pvc_enabled = true, IAP with no authorized identities, quota_memory_* without binary unit suffixes, an out-of-range timeout_seconds/backup_retention_days. 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
/config PVCNever deleteCriticalThe PVC holds the SQLite library, users, and metadata; deleting it wipes the entire server.
stateful_pvc_enabledtrueCriticalWithout a persistent PVC, /config is ephemeral and the library is lost on every pod restart.
max_instance_count1CriticalMultiple replicas write to one SQLite library and corrupt it.
workload_type vs stateful_pvc_enabledLeave workload_type unsetCriticalDeployment + stateful_pvc_enabled = true fails at plan time; leave unset to auto-resolve to StatefulSet.
enable_backup_importfalse unless restoringCriticalEnabling without a valid backup_uri fails the import job.
stateful_pvc_sizeSize to libraryHighAn undersized PVC fills up during metadata/transcode caching and stalls the server.
stateful_fs_group3000HighA wrong fsGroup leaves the PVC non-writable by Jellyfin (UID 1000 / GID 2000) — startup fails.
memory_limit1Gi (raise for large libraries)HighToo little memory OOM-kills the pod while scanning or transcoding a large library.
cpu_limit1000m (raise for transcoding)HighLive transcoding (no GPU) saturates CPU; prefer direct-play clients.
min_instance_count1HighGKE requires min ≥ 1; the validation guard rejects invalid values.
quota_memory_requests / _limitsbinary units (4Gi, 8192Mi)CriticalBare integers are bytes and block all pod scheduling in the namespace.
enable_api_keytrue when externally reachableMediumWithout it, the API surface relies solely on session auth once exposed.
enable_pod_disruption_budgettrueMediumDisabling allows GKE to evict the single pod during maintenance, interrupting streams.
backup_retention_days7 (raise for prod)MediumToo short to recover an older library snapshot.

For the foundation behaviour referenced throughout — IAM and Workload Identity, autoscaling, ingress and certificates, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC-SC, backups, and image mirroring — see App_GKE. Jellyfin-specific application configuration shared with the Cloud Run variant is described in Jellyfin_Common. For a guided walkthrough, see the Jellyfin_GKE lab.