Trilium Notes 0.107: Self-Host a Hierarchical Knowledge Base with Docker Compose

Trilium Notes is an AGPL-licensed, hierarchical note-taking app for large personal knowledge bases. Version 0.107 turns text notes into a block editor, adds an AI chat that asks before it acts and a non-root Docker image. Here's what it does and how to self-host it with Docker Compose.

Share
The Trilium Notes interface with a deep note tree on the left and the rich text editor showing the Trilium demo note on the right
Trilium Notes with its note tree and editor. Official screenshot from the TriliumNext/Trilium repository (AGPL-3.0 project).

Most note apps are great for the first hundred notes. Things get interesting at a few thousand: meeting notes, homelab documentation, code snippets, book excerpts and half-finished ideas all fighting for space in the same flat list. Trilium Notes was built for exactly that stage. It organises everything in a tree that can go as deep as you like, and it lets one note live in several places at once.

Trilium has been around for years, but it is very much alive: version 0.107.0 shipped on 8 November 2026, and its release notes call it "the release where a text note stops being a single document". If you liked our posts on Memos or Alexandrie, Trilium is the heavyweight in the same family – here's what it can do and how to run it on your own server.

What is Trilium Notes?

Trilium Notes describes itself as "a free and open-source, cross-platform hierarchical note taking application with focus on building large personal knowledge bases". It is licensed under the GNU Affero General Public License v3 (or later).

A bit of history: Trilium was created by zadam. The original developer later handed the repository over to the community project TriliumNext, which now develops it under the lead of Elian Doran. That's why you'll see both names. According to the README, there are no special migration steps from an old zadam/Trilium instance – a new install simply uses the existing database (direct sync compatibility only goes up to v0.90.4, though).

You can use Trilium in three ways:

  • as a desktop app for Windows, macOS and Linux (now also on Flathub, according to the 0.107 release notes),
  • as a server with a web interface that is almost identical to the desktop app, plus a touch-optimised mobile frontend,
  • as a sync server that keeps several desktop installations in sync.

For homelabs, the server option is the interesting one, and Docker is the installation method the docs recommend. Images are available for AMD64 and ARM.

Key features

Based on the README and the official documentation, Trilium offers:

  • A tree without limits. Notes can be nested arbitrarily deep, and a single note can be cloned into several places in the tree. Any note can have children, so there's no separate folder type.
  • Many note types. Rich text with tables, images and math, code notes with syntax highlighting, Excalidraw canvases, Mermaid diagrams, mind maps, relation and link maps, and geo maps with pins and GPX tracks.
  • Collections. Children of a note can be shown as a grid, list, table, board or calendar.
  • Attributes and scripting. Labels and relations organise and query notes, and they power Trilium's scripting. A REST API (ETAPI) is available for automation.
  • Note versioning and protected notes. Revisions are saved automatically, and individual notes can be encrypted.
  • Sharing. Single notes or whole subtrees can be published to the web as read-only pages.
  • Security options. Built-in TOTP two-factor authentication and OpenID Connect login.
  • Import and export. Markdown import and export plus importers for Evernote and other apps, and a web clipper.
  • Scale. The README says Trilium "scales well in both usability and performance upwards of 100 000 notes".
  • Metrics. A metrics endpoint with a Grafana dashboard.
Trilium calendar collection showing a month view with an appointment, a shopping reminder, Christmas and a multi-day vacation
A calendar collection in Trilium: child notes with dates show up as events. Source: triliumnotes.org (official screenshot, AGPL-3.0 project)

What's new in Trilium 0.107

The 0.107.0 release notes are long, so here are the highlights that matter most:

  • Text notes became a block editor. Notes can include other notes and edit them in place (editable transclusion), quote blocks of another note as live excerpts that stay in sync, and link to a single paragraph, heading or table via block references.
  • New layout tools. Two to four columns side by side, Excalidraw drawings sketched directly inside a text note, inline PDFs and spreadsheets, and embedded YouTube videos.
  • Much better tables. Merge and unmerge cells, sort columns (dates, numbers and text are detected), move rows and columns with Alt+arrow keys and scroll wide tables under a sticky header.
  • AI that asks before it acts. The built-in AI chat now shows what a tool call is about to read or change and waits for your approval. You can choose between "always ask", "ask only before changes" and "never ask". New providers include ChatGPT Codex subscriptions and OpenRouter, and web search can use a self-hosted SearXNG, among others.
  • Shared pages look like the app, including light and dark themes and shared collections that render with their own views.
  • Mobile navigation without the sidebar, with a redesigned iOS layout.

For self-hosters, the Compatibility section is the important part:

  • The sync protocol went from version 39 to 41. Server and clients on different versions can't sync, so update the server and every desktop and mobile client together.
  • The database is migrated from version 240 to 242 on first start (after an automatic backup). Older versions refuse to open it afterwards, so a downgrade means restoring the backup.
  • The Docker image can now run as a non-root user – more on that below.
  • Breaking changes: the old layout is gone, multi-level #sorted values now need # in front of label names, and POST /etapi/auth/login requires a TOTP code if TOTP is enabled.

Also worth knowing: v0.106.1 (23 October 2026) was a security release that updated Node.js in the Docker images to fix a Brotli decoder vulnerability reachable before authentication. If you're still on something older, update.

Trilium AI chat panel where the assistant loads a skill, creates two notes and sets an attribute to build an analog clock render note
Trilium's built-in AI chat creating notes through tool calls. Since 0.107, such tool calls can require your approval first. Source: triliumnotes.org (official screenshot, AGPL-3.0 project)

Why self-host Trilium?

  • Your knowledge base stays yours. Everything lives in one SQLite database (document.db) inside a single data directory on your hardware.
  • One server, every device. The web UI works in the browser and on phones, and the desktop apps sync through your server, so you can keep working offline.
  • It grows with you. Clones, attributes, collections and scripting make it more of a personal database than a notebook.
  • Free and open source. AGPL-3.0, no account, no subscription.

Installing Trilium with Docker Compose

You need a Linux host with Docker and the Docker Compose plugin. The example below is based on the official docker-compose.yml from the repository, with three changes: a pinned version, a port bound to localhost (for use behind a reverse proxy) and the new non-root mode from 0.107.

1. Create a directory and the data folder

mkdir -p ~/trilium/trilium-data
cd ~/trilium
sudo chown 1000:1000 trilium-data

The chown is required for the non-root setup: without root, the container can't change file ownership, so the data directory must exist and belong to the user the container runs as before the first start.

2. Create docker-compose.yml

services:
  trilium:
    image: triliumnext/trilium:v0.107.0
    restart: unless-stopped
    # Run as non-root (supported since v0.107.0). Remove this line to use
    # the classic mode, where the container starts as root and drops to UID 1000.
    user: "1000:1000"
    ports:
      # Only reachable from the host itself – put a reverse proxy in front.
      # Use "8080:8080" instead if you want to access it directly on your LAN.
      - "127.0.0.1:8080:8080"
    volumes:
      - ./trilium-data:/home/node/trilium-data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro

The docs explicitly recommend pinning a version instead of latest, because an automatic upgrade can break sync with clients that are still on an older version.

3. Start it

docker compose up -d
docker compose logs -f trilium

If Trilium can't use its data directory, it stops at startup and prints which files it can't access, who owns them and the command to fix it.

4. Run the setup

Open http://localhost:8080 (or your reverse proxy URL). On a fresh instance, Trilium shows a setup screen: you can create a new document, sync from an existing Trilium instance or restore a backup. Then set a strong password – that's your login from now on. A new document comes with a demo tree that shows off the features; you can delete it whenever you like.

Configuration tips

Behind a reverse proxy

Trilium listens on plain HTTP on port 8080, so terminate TLS at your reverse proxy. The docs contain examples for Nginx, Apache and Traefik. Two details are easy to miss:

  • Trusted proxy. Trilium limits each IP address to 10 failed sign-in attempts in 15 minutes. Behind a proxy, all requests seem to come from the proxy unless you tell Trilium to trust it, e.g. with TRILIUM_NETWORK_TRUSTEDREVERSEPROXY=172.18.0.0/16 (the subnet of your Docker network). Don't use true here – the docs explain that this lets clients spoof their address.
  • Traefik 3.6.4 to 3.6.6 reject percent-encoded characters like # in image URLs, which breaks some images. The docs recommend Traefik 3.6.7 or later.
  • Nginx: set client_max_body_size 0; (or a large value) so big attachments and syncs aren't rejected.

A minimal Traefik label set looks like this (replace notes.example.com with your domain):

    labels:
      - traefik.enable=true
      - traefik.http.routers.trilium.rule=Host(`notes.example.com`)
      - traefik.http.routers.trilium.entrypoints=https
      - traefik.http.routers.trilium.tls=true
      - traefik.http.services.trilium.loadbalancer.server.port=8080

Turn on two-factor authentication

Go to Options → Password & Auth, keep Local password selected and set up TOTP under Two-factor authentication. Save the eight recovery codes. Since 0.107, connecting a new sync client and requesting an ETAPI token with a password also ask for the second factor. For scripts, create a token under Options → ETAPI instead. If you already run an identity provider like Pocket ID, you can use OpenID Connect instead.

Hardening

According to the docs, the image also runs with a read-only root filesystem and without any capabilities. You can add read_only: true, tmpfs: [/tmp], cap_drop: [ALL] and security_opt: [no-new-privileges:true] to the service if you run it in non-root mode.

Backups

Trilium creates automatic backups – daily, weekly, monthly and before every database migration – in the backup folder inside the data directory. The docs themselves call this "only very basic", so copy the whole data directory to another machine as well. It contains everything: document.db, config.ini, logs and backups. A monitored cron job with Healthchecks tells you when that copy stops working.

Updating

Change the image tag, then run docker compose pull && docker compose up -d. Read the release notes first: when the sync protocol changes (as in 0.107), update your desktop and mobile clients at the same time.

Limitations

  • Single-user by design. The FAQ explains that multi-user collaboration isn't planned, partly because the scripting features would become a security problem in a multi-user app. For a shared team wiki, look elsewhere.
  • Mobile is web-first. The README points phone users to the server's mobile web interface and lists community apps (TriliumDroid and Pocket Trilium for Android, Trinote for iOS). TriliumDroid needs a matching sync version, so check compatibility before you update the server.
  • Version lock-step. Sync only works when server and clients are on the same sync version, and database migrations can't be undone without a backup.
  • Database, not files. Notes live in SQLite, not in a folder of Markdown files. Export is available, but you can't just edit your notes with another editor.
  • Browser support. The README says only the latest versions of Chrome and Firefox are supported and tested.
  • Lots of features. Trilium is powerful, which also means a learning curve – especially attributes and scripting.

Trilium vs. other self-hosted note apps

We've covered several note and wiki tools on this blog. Memos is the opposite approach: a quick timeline for short notes, not a deep tree. Alexandrie is a lighter Markdown-based option. And if several people need to edit the same documentation, a multi-user wiki like BookStack or Wiki.js is the better choice. Trilium shines as a single person's long-term knowledge base, with offline desktop sync, scripting and many note types. More tools like these are collected under our Wiki tag.

Conclusion

Trilium Notes is one of the most capable open-source note apps you can self-host, and 0.107 is a big step: block references, live excerpts and better tables make it feel more modern, and the non-root image makes it easier to run securely. Pin the version, put it behind your reverse proxy with TOTP enabled, back up the data directory – and enjoy a knowledge base that can actually grow with you.

Sources