Skip to content

Deploying a Trilium App

Introduction

Trilium Notes is a hierarchical note-taking app with rich editing and syncing features. This guide walks through containerizing Trilium, persisting user data, and deploying it to Klutch.sh over HTTP.

Prerequisites

  • GitHub repository containing your Dockerfile.
  • Klutch.sh project ready in klutch.sh/app.

Project structure

.
└── Dockerfile

Sample Dockerfile

FROM zadam/trilium:latest
# Default Trilium port
ENV TRILIUM_PORT=8080
EXPOSE 8080
  • TRILIUM_PORT – internal port (default 8080).
  • TRILIUM_DATA_DIR – set to /home/node/trilium-data (default).
  • TRILIUM_DISABLE_TLS=true – rely on Klutch.sh TLS termination.

Persistence

Trilium stores all notes and attachments on disk. Attach a volume:

  • Mount path: /home/node/trilium-data
  • Size: match expected note and attachment growth

Networking

  • Protocol: HTTP
  • Internal port: 8080
  • Users reach https://example-app.klutch.sh while Klutch.sh routes to port 8080 in the container.
Terminal window
curl -I http://localhost:8080

Deployment on Klutch.sh

  1. Push your Dockerfile to GitHub.
  2. In klutch.sh/app, create a new app and select GitHub as the source.
  3. Klutch.sh automatically detects the Dockerfile in the repository root.
  4. Select HTTP traffic and set the internal port to 8080.
  5. Add any environment overrides (e.g., TRILIUM_PORT) in the dashboard.
  6. Attach a persistent volume at /home/node/trilium-data sized for your workspace.
  7. Deploy. On first start, set your Trilium password and begin organizing your notes.

Verification

  • UI: open https://example-app.klutch.sh and confirm the login/setup screen appears.

  • Quick check:

    Terminal window
    curl -I https://example-app.klutch.sh

Next steps

  • Enable regular backups of /home/node/trilium-data.
  • Configure sync or API integrations as needed.
  • Set strong credentials after initial setup.