audiobookshelf

by wittdennis

Helm chartv1.1.5App 2.38.0MITVerified publisher

A Helm chart for Audiobookshelf. Audiobookshelf is a self-hosted audiobook and podcast server that syncs listening progress across clients. Runs rootless with a read-only root filesystem. Libraries are configured in the app UI against the paths supplied through mediaMounts.

About this chart

audiobookshelf

A Helm chart for Audiobookshelf. Audiobookshelf is a self-hosted audiobook and podcast server that syncs listening progress across clients. Runs rootless with a read-only root filesystem. Libraries are configured in the app UI against the paths supplied through mediaMounts.

Maintainers

NameEmailUrl
Dennis Witthttps://github.com/wittdennis

Source Code

Requirements

Helm 4. The bundled values.schema.json is written against JSON Schema draft 2020-12, which earlier Helm releases cannot parse.

Single replica

replicaCount accepts only 0 and 1. Audiobookshelf keeps its libraries, users and listening progress in a single SQLite database on a ReadWriteOnce volume, so a second replica would corrupt it. Rendering fails for anything higher. Set replicaCount: 0 to scale down and release the volumes for maintenance.

The deployment strategy defaults to Recreate for the same reason: a rolling update would need two pods attached to the same volumes at once.

Media volumes

Libraries are added in the app UI against paths inside the container, so the chart cannot know how many volumes are needed or where they belong. mediaMounts supplies them, and each entry either reuses a volume you already have or is provisioned by the chart.

The default provisions a single 50Gi volume at /audiobooks, so a plain helm install works on any cluster with a default storage class:

mediaMounts:
  - name: audiobooks
    mountPath: /audiobooks
    size: 50Gi
    accessMode: ReadWriteOnce
    className: ~

Point it at storage you already have with existingClaim instead. The chart provisions nothing for those entries:

mediaMounts:
  - name: audiobooks
    mountPath: /audiobooks
    existingClaim: media-audiobooks
    readOnly: true
  - name: podcasts
    mountPath: /podcasts
    size: 20Gi

mediaMounts is a list, so supplying your own replaces the default entry rather than adding to it. name doubles as the volume name and as the suffix of any claim the chart creates, so it has to be unique and cannot be tmp, config or metadata. An entry with neither existingClaim nor size fails the render.

First start

Open the app, create the root user, then add a library for each mediaMounts path. The library paths are not configurable through values — Audiobookshelf stores them in its own database, which only its UI writes.

persistence.config holds the database and must stay writable. persistence.metadata holds the cache, streams, covers, downloads, logs and, unless audiobookshelf.backupPath says otherwise, the backups — so it grows with the size of the library.

The ffmpeg check

Audiobookshelf checks for ffmpeg and ffprobe on startup and accepts only version 5.1. The image ships a newer build, so the check usually rejects it and downloads its own copy. With the default read-only root filesystem that copy lands in the config volume, which means the first start needs network egress to GitHub and takes noticeably longer — hence the five minute budget on the startup probe.

To skip the download and use the binaries already in the image, set all three:

binaries:
  skipCheck: true
  ffmpegPath: /usr/bin/ffmpeg
  ffprobePath: /usr/bin/ffprobe

Both paths are required once skipCheck is true, because Audiobookshelf exits during startup when the check is skipped without them. The render fails rather than letting the pod crash-loop.

Serving under a subpath

Audiobookshelf serves from /audiobookshelf. Its server rewrites requests that arrive without the prefix, so it answers at the root as well and no configuration is needed — but the web client sends the address bar to /audiobookshelf once it boots, and there is no way to change that with the official image.

The prefix is not a runtime setting. client/nuxt.config.js reads ROUTER_BASE_PATH while the client bundle is generated and bakes it into the router base, the axios base URL and the icon hrefs, and the upstream Dockerfile does not set it for that build. The server's own ROUTER_BASE_PATH moves only the Express mount point, so pointing it anywhere else leaves the HTML asking for /audiobookshelf/_nuxt/… while the server answers elsewhere, and every asset 404s. The chart therefore exposes no value for it.

Changing the prefix means building the client yourself with ROUTER_BASE_PATH set, and serving that image with the same value in its environment — set it in the image, or through env if your build only passes it at build time. Building at / serves the app from the root, at the cost of two protocol-relative icon links (//favicon.ico), because the config concatenates the base path onto those hrefs.

Whichever prefix is in effect, the ingress or HTTPRoute has to pass the path through unmodified. The client requests assets under the baked-in prefix and the server mounts /healthcheck under its own, so a rewrite filter on the proxy breaks both.

Values

KeyTypeDefaultDescription
affinityobject{}
audiobookshelfobject{"backupPath":"","podcast":{"downloadTimeout":""},"query":{"logging":"","profiling":""},"sqlite":{"cacheSize":"","mmapSize":"","tempStore":""},"timezone":""}Settings that Audiobookshelf reads from its environment. Empty values are left out so the application default applies.
audiobookshelf.backupPathstring""Where backups are written. Empty leaves them under the metadata volume in /metadata/backups. Point this at a media mount to keep backups off that volume.
audiobookshelf.podcast.downloadTimeoutstring""Timeout in milliseconds for podcast downloads. 0 disables the timeout.
audiobookshelf.query.loggingstring""Log SQL queries. log logs the queries, benchmark also logs their runtime.
audiobookshelf.query.profilingstring""Experimental profiling of specific database queries.
audiobookshelf.sqlite.cacheSizestring""cache_size pragma for the SQLite database.
audiobookshelf.sqlite.mmapSizestring""mmap_size pragma for the SQLite database.
audiobookshelf.sqlite.tempStorestring""temp_store pragma for the SQLite database.
audiobookshelf.timezonestring""Time zone of the container, e.g. Europe/Berlin.
binariesobject{"ffmpegPath":"","ffprobePath":"","skipCheck":false}Audiobookshelf checks for ffmpeg and ffprobe on startup and accepts only version 5.1. The image ships a newer build, so on first start it downloads its own copy into the config volume, which needs network egress. Set skipCheck to use the bundled binaries as they are.
binaries.ffmpegPathstring""Path to the ffmpeg binary. In the upstream image this is /usr/bin/ffmpeg.
binaries.ffprobePathstring""Path to the ffprobe binary. In the upstream image this is /usr/bin/ffprobe.
binaries.skipCheckboolfalseSkip the startup binary check. Requires both paths below, because Audiobookshelf exits when they are unset.
deploymentStrategyobject{"type":"Recreate"}Deployment strategy to use. Defaults to Recreate to avoid PVC multi-attach errors with ReadWriteOnce volumes.
envlist[]Additional env values to pass to the container. Spliced in after the values below, so an entry here overrides one the chart derived.
fullnameOverridestring""
imageobject{"pullPolicy":"IfNotPresent","registry":"ghcr.io","repository":"advplyr/audiobookshelf","tag":""}This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
image.pullPolicystring"IfNotPresent"This sets the pull policy for images.
image.tagstring""Overrides the image tag whose default is the chart appVersion.
imagePullSecretslist[]This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
ingressobject{"annotations":{},"className":"","enabled":false,"hosts":[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}],"tls":[]}This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/
livenessProbeobject{"httpGet":{"path":"/healthcheck","port":"http"}}This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
mediaMountslista provisioned 50Gi volume at /audiobooksVolumes holding the audio files. Libraries are added in the app UI against these mountPaths, so the chart cannot know how many are needed. Set existingClaim to reuse a volume you already have, or leave it unset and give a size to have the chart provision one. This is a list, so overriding it replaces the default entry entirely.
nameOverridestring""This is to override the chart name.
nodeSelectorobject{}
persistenceobject{"config":{"accessMode":"ReadWriteOnce","className":null,"enabled":true,"existingVolumeClaim":null,"size":"2Gi"},"metadata":{"accessMode":"ReadWriteOnce","className":null,"enabled":true,"existingVolumeClaim":null,"size":"10Gi"}}Settings for storage
persistence.configobject{"accessMode":"ReadWriteOnce","className":null,"enabled":true,"existingVolumeClaim":null,"size":"2Gi"}Settings for the config pvc mounted at /config. Holds the SQLite database and, when the binary check downloads ffmpeg, that copy too.
persistence.config.classNamestringnilStorage class to use for persistent storage. If left empty default storage class will be used.
persistence.config.enabledbooltrueWhen false an emptyDir will be provisioned. Use this only for dev purposes
persistence.config.sizestring"2Gi"Size for the persistent volume claim.
persistence.metadataobject{"accessMode":"ReadWriteOnce","className":null,"enabled":true,"existingVolumeClaim":null,"size":"10Gi"}Settings for the metadata pvc mounted at /metadata. Holds cache, streams, covers, downloads, backups and logs, so it grows with the size of the library.
persistence.metadata.classNamestringnilStorage class to use for persistent storage. If left empty default storage class will be used.
persistence.metadata.enabledbooltrueWhen false an emptyDir will be provisioned. Use this only for dev purposes
persistence.metadata.sizestring"10Gi"Size for the persistent volume claim.
podAnnotationsobject{}This is for setting Kubernetes Annotations to a Pod. For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
podLabelsobject{}This is for setting Kubernetes Labels to a Pod. For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
podSecurityContextobject{"fsGroup":1000,"fsGroupChangePolicy":"OnRootMismatch","runAsGroup":1000,"runAsNonRoot":true,"runAsUser":1000,"seccompProfile":{"type":"RuntimeDefault"}}The upstream image declares no USER and would run as root. It works fine as an arbitrary user instead, so file ownership is handled through fsGroup.
readinessProbe.httpGet.pathstring"/healthcheck"
readinessProbe.httpGet.portstring"http"
replicaCountint1Replica count. Only 0 (scaled down) and 1 are valid: Audiobookshelf keeps its database in a SQLite file on a ReadWriteOnce volume, so a second replica would corrupt it. Anything higher fails the render.
resourcesobject{}
routeobject{"additionalRules":[],"annotations":{},"enabled":false,"filters":[],"hostnames":[],"labels":{},"matches":[{"path":{"type":"PathPrefix","value":"/"}}],"parentRefs":[]}This block is for setting up gateway api http route. More information can be found here: https://gateway-api.sigs.k8s.io/
route.additionalRuleslist[]Any custom rule you want to specify.
route.annotationsobject{}Additional annotations for the HTTPRoute
route.enabledboolfalseFlag to control if route should be created
route.filterslist[]Filter that should be added to the default rule
route.hostnameslist[]Hostnames of the HTTPRoute
route.labelsobject{}Additional labels for the HTTPRoute
route.matcheslist[{"path":{"type":"PathPrefix","value":"/"}}]Matches for the default rule
route.parentRefslist[]Gateway reference that the HTTPRoute should bind against
securityContext.allowPrivilegeEscalationboolfalse
securityContext.capabilities.drop[0]string"ALL"
securityContext.privilegedboolfalse
securityContext.readOnlyRootFilesystembooltrue
securityContext.runAsGroupint1000
securityContext.runAsNonRootbooltrue
securityContext.runAsUserint1000
securityContext.seccompProfile.typestring"RuntimeDefault"
serviceobject{"annotations":{},"labels":{},"port":80,"type":"ClusterIP"}This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/serv

Deploy audiobookshelf with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has audiobookshelf 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 chartaudiobookshelf is pinned at v1.1.5 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