Self-hosted server

Install on Kubernetes

Install Stirling PDF with the official Helm chart:

bash
helm repo add stirling-pdf https://stirling-tools.github.io/Stirling-PDF-chart
helm repo update
helm install stirling-pdf stirling-pdf/stirling-pdf-chart --namespace stirling-pdf --create-namespace -f values.yaml

values.yaml#

Put your overrides in values.yaml. The chart's default values.yaml lists every option with comments.

yaml
image:
  tag: "3.1.0"           # the chart's default image is an older release

persistence:
  enabled: true

deployment:
  extraVolumeMounts:
    - name: storage-volume   # the volume the chart creates when persistence is enabled
      mountPath: /configs
      subPath: configs
    - name: storage-volume
      mountPath: /storage
      subPath: storage

envs:
  - name: SYSTEM_DEFAULTLOCALE
    value: en-GB
  • image.tag: a version tag pins the release, so you choose when to upgrade. For the fat or ultra-lite image, see Choose an image.
  • Persistence: Stirling PDF keeps users, settings.yml and its built-in database in /configs, and files users save on the server in /storage. Without a persistent volume they are lost when the pod restarts. Enabling persistence creates the volume, and extraVolumeMounts mounts a folder of it at each path.
  • envs: any setting can be passed as an environment variable. See Configuration for the naming rule.

Give the pod at least 4 GB of memory with resources.limits.memory (see Sizing). For a sub-path, set the chart's rootPath option rather than SYSTEM_ROOTURIPATH, so the health checks use it too.

Upgrade#

Change image.tag in values.yaml to the new version, then run:

bash
helm repo update
helm upgrade stirling-pdf stirling-pdf/stirling-pdf-chart --namespace stirling-pdf -f values.yaml

If you use latest, the tag never changes, so helm upgrade does not restart the pod or pull the new image. Set image.pullPolicy: Always in values.yaml and apply it with the command above. After that, restart the pod to upgrade:

bash
kubectl rollout restart deployment/stirling-pdf-stirling-pdf-chart --namespace stirling-pdf

To run several replicas behind one service, see Clustering.