Skip to main content

Trilium Common — Shared Application Configuration

Trilium_Common is the shared application layer for Trilium Notes (the actively maintained TriliumNext fork of the hierarchical, self-hosted note-taking app). It is not deployed on its own; instead it supplies the Trilium-specific configuration that both Trilium_GKE and Trilium_CloudRun build on, so the two platform variants behave identically where it matters. End users never configure this layer directly — it has no deployment UI inputs of its own.

For the infrastructure that actually provisions and runs Trilium, see the platform guides (Trilium_GKE, Trilium_CloudRun) and the foundation guides (App_GKE, App_CloudRun).


1. What this layer provides

AreaProvided by Trilium_CommonWhere it surfaces
Container imageWraps triliumnext/notes in a thin Dockerfile (ARG TRILIUM_VERSION) so the Foundation can build/mirror it via Cloud Buildcontainer_image output
Database engineFixes database_type = "NONE" — embedded SQLite only, no Cloud SQL instanceApplication behaviour in the platform guides
Persistent storageDeclares the Cloud Storage data bucket, mounted at /home/node/trilium-data (GCS FUSE on Cloud Run, or StatefulSet PVC on GKE)storage_buckets output
Core settingsSets TRILIUM_DATA_DIR and binds the app to 0.0.0.0:8080Application behaviour in the platform guides
Health checksStartup/liveness probe defaults targeting /api/health-check§Observability in the platform guides
CredentialsNone generated — Trilium's password is set via its own "Set Password" web UI screenManual operator step

2. Container image and build

ARG TRILIUM_VERSION=0.95.0
FROM triliumnext/notes:${TRILIUM_VERSION}

TRILIUM_VERSION is an app-specific build ARG, deliberately distinct from the generic APP_VERSION the Foundation injects (which would otherwise force FROM triliumnext/notes:latest regardless of the requested version).

gcloud artifacts docker images list <repo-url> --project "$PROJECT" --filter="package~trilium"

3. Database engine

database_type is fixed to NONE. Trilium's entire document store is a single embedded SQLite file, document.db, created and migrated by the app itself on first web visit via its own setup wizard.


4. Persistent storage

A dedicated Cloud Storage data bucket is provisioned and mounted at /home/node/trilium-data:

  • Cloud Run: GCS FUSE volume with mount_options = uid=1000,gid=1000,file-mode=0664,dir-mode=0775 — matching the node user Trilium's container runs as (confirmed via docker run ... id node).
  • GKE: GCS FUSE by default, or a StatefulSet block PVC (stateful_pvc_enabled = true) with fsGroup = 1000 for larger note collections needing real POSIX file locking.
gcloud storage buckets list --project "$PROJECT"

5. Core application settings

  • Data directoryTRILIUM_DATA_DIR=/home/node/trilium-data.
  • Port8080 by default.
  • No auth bootstrap. Confirmed by inspecting every process.env.TRILIUM_* reference in the built image's bundled main.cjs — there is no password/API-key env var. The only way to set the initial password is Trilium's own "Set Password" screen, presented on first visit.

6. Health probe behaviour

Default probes target /api/health-check — confirmed live (curl returns 200 {"status":"ok"} with no auth required). The root / path redirects (302) to the setup/login screen and is not used for probing.


For the Trilium-specific, user-facing configuration (variables by group, outputs, and how to explore each service from the Console and CLI), see the platform guides: Trilium_GKE and Trilium_CloudRun.