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
.└── DockerfileSample Dockerfile
FROM zadam/trilium:latest
# Default Trilium portENV TRILIUM_PORT=8080EXPOSE 8080Recommended environment variables
TRILIUM_PORT– internal port (default8080).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.shwhile Klutch.sh routes to port8080in the container.
Health check (recommended)
curl -I http://localhost:8080Deployment on Klutch.sh
- Push your Dockerfile to GitHub.
- In klutch.sh/app, create a new app and select GitHub as the source.
- Klutch.sh automatically detects the Dockerfile in the repository root.
- Select HTTP traffic and set the internal port to
8080. - Add any environment overrides (e.g.,
TRILIUM_PORT) in the dashboard. - Attach a persistent volume at
/home/node/trilium-datasized for your workspace. - Deploy. On first start, set your Trilium password and begin organizing your notes.
Verification
-
UI: open
https://example-app.klutch.shand 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.