Trilium is an offline-first note-taking application that stores all data locally on the desktop client. However, it also offers the option to set up synchronization with a server instance, allowing multiple desktop clients to sync with a central server. This creates a star-shaped topology:
In this setup, a central server (referred to as the sync server) and multiple client (or desktop) instances synchronize with the sync server. Once configured, synchronization is automatic and ongoing, requiring no manual intervention.
Setting up the server securely is critical and can be complex. It is crucial to use a valid TLS certificate (HTTPS) rather than an unencrypted HTTP connection to ensure security and avoid potential vulnerabilities.
This method is used when you already have a desktop instance of Trilium and want to set up a sync server on your web host.
This method is used when you already have a sync server and want to configure a new desktop instance to sync with it.
Once synchronization is complete, you will be automatically redirected to the Trilium application.
Two proxy setups are supported:
For successful synchronization, both client and server must have the same date and time, with a tolerance of up to five minutes.
When using TLS, Trilium will verify the server certificate. If verification fails (e.g., due to self-signed certificates or certain corporate proxies), you can run the Trilium client with the NODE_TLS_REJECT_UNAUTHORIZED
environment variable set to 0
:
export NODE_TLS_REJECT_UNAUTHORIZED=0
This will disable TLS certificate verification, significantly reducing security and exposing the setup to MITM attacks. It is strongly recommended to use a valid signed server certificate. Newer Trilium versions include a script called trilium-no-cert-check.sh
for this purpose.
If you edit the same note on multiple instances before synchronization, Trilium resolves conflicts by retaining the newer change and discarding the older one. The older version remains accessible in note revisions, allowing data recovery if needed.
After each synchronization, Trilium computes a hash of all synced data on both the client and the sync server. If there is a discrepancy, Trilium will automatically initiate a recovery mechanism to resolve the issue.