Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk11 min

How to Secure a Self-Hosted Trilium Notes Server

Secure remote Trilium Notes access by keeping authentication enabled, using HTTPS behind a correctly configured reverse proxy, reducing container privileges, disabling risky features, and testing full data-directory recovery.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A remotely reachable Trilium Notes server should keep Trilium authentication enabled, accept traffic through HTTPS, and expose only a deliberately configured entry point. Put a reverse proxy in front of the application, preserve WebSocket and client-IP behavior, run the container with the fewest practical privileges, leave high-risk features disabled unless you genuinely need them, and back up the complete data directory to a separate failure domain. The exact screens and file paths depend on whether you use Docker, a packaged installation, or another supported deployment, so verify each setting against the Trilium release you run.

Start with an inventory of your installation

Hardening begins with knowing what is actually exposed. Record the Trilium version, installation method, data-directory location, listening ports, reverse-proxy software, certificate arrangement, and authentication mode. This prevents a security change in one layer from being undermined by an old setting in another.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Trilium configuration can be supplied through environment variables or config.ini. When both define a value, the environment variable takes precedence. Check both locations before concluding that a setting has been changed or removed. Container deployments also commonly separate the application image from the persistent data volume; identify the host path behind that volume before changing permissions or planning backups.

  • Write down the exact Trilium release and image tag, rather than relying on a floating “latest” tag.
  • List every host port published by Docker or your service manager and identify which one is intended for users.
  • Identify whether TLS terminates at a reverse proxy or inside Trilium.
  • Confirm where the persistent data directory resides and which operating-system account owns it.
  • Record whether Trilium uses its local password system, OpenID Connect (OIDC), or deliberately disabled authentication.

Documentation and interface labels can change between releases. Recheck security settings after an upgrade, especially when a release changes defaults.

#1 Best Overall
Yubico - YubiKey 5C NFC - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified - Protect Your Online Accounts
  • POWERFUL SECURITY KEY: The YubiKey 5C NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
  • WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5C NFC secures 100+ of your favorite accounts, including email, password managers, and more
  • FAST & CONVENIENT LOGIN: Plug in your YubiKey 5C NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
  • MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
  • PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts

Keep the application private behind one controlled entry point

Remote access does not require publishing every service port. The safer pattern is to keep Trilium’s backend reachable only from the reverse proxy or a restricted internal network, and expose the proxy as the public entry point. A published container port that bypasses the proxy can expose a second route with different TLS, authentication, logging, or firewall behavior.

Inspect Docker port mappings, host firewall rules, cloud security-group rules, and any router port-forwarding rules together. Remove mappings that are not required. Do not publish the Docker control socket as a substitute for application access: that socket grants powerful control over the container host and is unrelated to safely serving notes.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If you need access only from a home network or VPN, restrict the listening address or firewall source ranges accordingly instead of treating an internet-facing deployment as necessary. A service that is reachable from the public internet should be hardened as an internet service even if you expect to be its only user.

Require authentication for every remotely accessible instance

Never set noAuthentication=true on a server that can be reached by untrusted networks. Trilium documents this option for localhost-only use or for arrangements in which another component truly handles authentication. It disables Trilium authentication and bypasses TOTP; it is not merely a way to hide the login form.

A reverse-proxy login page is not automatically equivalent to Trilium authentication. In particular, an interactive forward-auth challenge can interfere with unattended clients and synchronization. Trilium recommends using its built-in authentication for the web interface, with the proxy enforcing transport and routing controls around it.

Local password plus TOTP

Trilium’s local account system can be strengthened with time-based one-time passwords (TOTP). Set a strong, unique password, enable TOTP in Trilium’s authentication settings, and store the recovery codes in a protected location before signing out. Recovery codes are effectively spare authentication factors: anyone who obtains them may be able to bypass the authenticator app.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Use an authenticator account or device protected by its own screen lock or passcode.
  • Keep recovery codes offline or in a separately protected password manager vault.
  • Do not place recovery codes in the Trilium data directory, container environment, proxy configuration, or a shared team chat.
  • Test the second-factor flow from a separate browser or device before closing your existing administrative session.

OpenID Connect

Trilium can delegate sign-in to an OIDC identity provider. The provider can supply its own MFA or passkey policy, while Trilium consumes the resulting identity. Configure the provider’s client details exactly as Trilium specifies for your release, including redirect and issuer values, then link the intended identity-provider account inside Trilium. Configuration alone does not establish that account link; omitting the link can leave you unable to sign in as the expected user.

Rank #2
Yubico - Security Key C NFC - Basic Compatibility - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-C or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key C NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
  • WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key C NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key C NFC via USB-C and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
  • TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
  • BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.

Keep a recovery path while testing OIDC. Do not disable the local administrator account until you have confirmed that the provider login, account link, and synchronization behavior all work. If your provider uses passkeys, a compatible hardware security key can be an optional provider-level factor; Trilium itself does not require a particular key model.

What not to use as a shortcut

Do not disable Trilium authentication because the proxy already has a password prompt, and do not assume that a successful browser login proves that desktop or mobile synchronization will work. Automated clients may not be able to complete an interactive proxy challenge. Keep Trilium’s own authentication available unless you have tested every client and have a deliberate, documented reason to delegate identity.

Use HTTPS and validate certificates

Remote notes and credentials should travel over HTTPS. Trilium’s usual deployment guidance is to terminate TLS at a reverse proxy, although Trilium also supports its own TLS configuration. Use a certificate trusted by the clients that will synchronize; a self-signed certificate requires an explicit trust arrangement on each client and increases the chance of unsafe workarounds.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not disable certificate validation to make a client connect. Trilium explicitly warns that this is insecure. Fix the certificate chain, hostname, expiration, or client trust store instead. During renewal, confirm that the proxy presents the renewed certificate and that the full chain is available to clients.

  • Use a hostname whose certificate matches the address users enter.
  • Redirect plain HTTP to HTTPS, or keep HTTP reachable only for the narrow certificate-issuance method you intentionally use.
  • Monitor expiration and test renewal before the old certificate expires.
  • After renewal, test both the web interface and synchronization from an external network.

Configure the reverse proxy for Trilium’s traffic

A proxy that merely forwards ordinary HTTP requests can still break Trilium. Preserve WebSocket upgrades, and configure Trilium’s trusted-proxy handling so it can determine the real client IP rather than recording only the proxy address.

Preserve WebSocket upgrades

The proxy route must forward the Upgrade and Connection headers required for WebSockets. If those headers are stripped, pages may load while live updates, interactive features, or synchronization fail intermittently. Check the proxy’s WebSocket support explicitly rather than assuming that a generic HTTP reverse-proxy template includes it.

Pass the real client address safely

Configure the trusted-proxy setting for the actual proxy addresses in front of Trilium. Trusting arbitrary client-supplied forwarding headers would allow a user to forge an address; trusting only the known proxy network lets Trilium use the forwarded address while keeping the boundary meaningful. Verify in Trilium’s logs or administrative information that requests show the expected client address after the change.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Yubico - YubiKey 5 NFC - Multi-Factor authentication (MFA) Security Key and passkey, Connect via USB-A or NFC, FIDO Certified - Protect Your Online Accounts
  • POWERFUL SECURITY KEY: The YubiKey 5 NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
  • WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5 NFC secures 100+ of your favorite accounts, including email, password managers, and more
  • FAST & CONVENIENT LOGIN: Plug in your YubiKey 5 NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
  • MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
  • PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts

Do not trap synchronization behind interactive forward-auth

Forward-auth systems that redirect a browser to an identity portal can be useful for some web applications, but unattended Trilium synchronization may not be able to follow an interactive challenge. If you use a proxy identity layer, test every synchronization client and retain Trilium’s built-in authentication for the web interface as recommended by Trilium’s documentation. A proxy policy that works in a browser is not evidence that background synchronization will work.

Reduce container and process privileges

Docker is not a security guarantee. It changes the isolation boundary, but a misconfigured container, writable host mount, excessive capability, or exposed control socket can still enlarge the impact of a compromise.

Trilium provides a rootless Docker image. Running containers as non-root is a security best practice that reduces the potential impact of container breakouts. If you choose the rootless image, verify that the persistent volume is owned and writable by the non-root UID and GID expected by that image. A failed write after migration is preferable to silently making the entire host path world-writable; correct ownership narrowly instead.

  • Use the least-privileged image and user mode compatible with your deployment.
  • Do not add host networking, privileged mode, or broad Linux capabilities unless a documented requirement demands it.
  • Mount only the persistent data directory that Trilium needs, not the host filesystem or unrelated secrets.
  • Keep the Docker control socket off the public network and out of the application container.
  • Review volume permissions after image changes, host migrations, and restore operations.

Packaged or native installations need the same principle: run the service under a dedicated account with access to its data directory, and avoid granting that account administrative rights it does not need.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Disable high-risk application capabilities unless required

Trilium includes features that can execute or query more powerful operations than ordinary note editing. Starting with v0.104.0, backend scripting and the SQL Console are disabled by default to reduce attack surface. Preserve that version qualifier: older or customized installations may have different defaults.

Backend scripting

Leave backend scripting disabled unless a specific, trusted workflow requires it. If you enable it, limit access to administrators who understand the code being run, review scripts before execution, and treat imported or shared notes that contain executable content as untrusted until inspected. Recheck the setting after upgrades because defaults and security screens are version-dependent.

SQL Console

Leave the SQL Console disabled unless you need it for a defined maintenance or diagnostic task. Direct database queries can expose or alter the entire notes store and can bypass assumptions made by the application interface. If it must be enabled temporarily, restrict who can use it, perform the task, and disable it again; record the change so it is not forgotten.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Yubico - Security Key NFC - Basic Compatibility - Multi-Factor Authentication (MFA) Key, Connect via USB-A or NFC, FIDO Certified
  • POWERFUL SECURITY KEY: The Security Key NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
  • WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key NFC secures 100 of your favorite accounts, including email, password managers, and more.
  • FAST & CONVENIENT LOGIN: Plug in your Security Key NFC via USB-A and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
  • TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
  • BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.

Review imported content and extensions

Use the same caution for scripts, templates, custom actions, and extensions supplied by other people. Treat capabilities that read files, execute commands, or modify the database as administrative tools, not ordinary formatting options. Keep them off in a public-facing instance unless their benefit clearly outweighs the additional exposure.

Protect the complete data directory

Trilium’s data directory contains the database, configuration, backups, and logs. Trilium’s documentation states: “If you want to back up your Trilium data, just backup this single directory – it contains everything you need.” That convenience also makes the directory highly sensitive: a copy may contain every note, credentials or identity settings, historical backups, and operational details.

Restrict access

Allow only the Trilium service account and the administrators who must perform backup or recovery work to read the directory. Check parent-directory permissions as well as the files themselves. Do not serve the directory through the web server, place it in a publicly shared folder, or include it in an image layer that will be distributed.

Make copies outside the failure domain

Back up the full directory, not only the database file. Keep at least one recoverable copy outside the Trilium host’s failure domain, such as separate storage or another system with independent credentials. Protect backup copies with access controls and encryption appropriate to the sensitivity of your notes. A backup that is readable by every host user is a second copy of the original exposure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prove that recovery works

A completed backup job is not proof of a usable backup. Periodically restore a copy into an isolated test instance, confirm that notes and configuration are present, and document the steps required to bring the service back. Test after changing the image, installation method, data-directory location, or authentication provider. Keep the test instance off the public network while validating it.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use a deployment-specific hardening checklist

Docker deployment

  1. Confirm the image tag and Trilium version you intend to run.
  2. Check published ports and remove direct exposure that bypasses the reverse proxy.
  3. Use the rootless image where practical and verify persistent-volume ownership for its UID and GID.
  4. Ensure the container is not privileged and does not receive unnecessary capabilities or the Docker socket.
  5. Store configuration secrets outside publicly readable files and confirm which environment variables override config.ini.
  6. Back up the host directory mounted as Trilium’s data directory and test a restore with a matching release.

Packaged or native installation

  1. Identify the service account, listening address, and data-directory path used by the package.
  2. Bind the service to the intended local or private interface when the reverse proxy is on the same host.
  3. Apply restrictive ownership and permissions to the data directory and its parent path.
  4. Keep TLS and proxy settings separate from the application account’s writable data where your platform allows it.
  5. Confirm that service restarts preserve authentication, proxy, and data-directory settings.
  6. Back up and restore the same directory structure the package uses, including configuration and logs.

Verify the result from an outside network

Perform a deliberate check after initial setup and after changes to the host, proxy, identity provider, certificate, or Trilium release.

  1. From a network that is not your server’s local LAN, open the public hostname and confirm that HTTPS is used.
  2. Confirm that an unauthenticated request reaches a Trilium login or the intended OIDC flow, not the notes interface.
  3. Complete local-password-and-TOTP or OIDC sign-in and verify that the expected account is linked.
  4. Test a synchronization client without relying on a browser’s already-authenticated session.
  5. Check that live updates and other interactive behavior work, indicating that WebSocket upgrades are preserved.
  6. Review logs or administrative information to verify that the real client address is recognized through the trusted proxy.
  7. Confirm that direct backend ports are closed or restricted and that only the intended public entry point responds.
  8. Run a backup and verify that the resulting copy can be read by the recovery process but not by ordinary users.

Review after every material change

Security settings drift when infrastructure changes. Repeat the inventory and external checks after moving hosts, changing proxies, adding an identity provider, renewing certificates, restoring a backup, or upgrading Trilium. Pay particular attention to authentication status, exposed ports, WebSocket headers, trusted-proxy ranges, data-directory permissions, rootless-container ownership, and whether backend scripting or the SQL Console remained disabled.

Best Value
Thetis FIDO2 Security Key (USB-A, 2-Pack) - Hardware MFA & Passkey Access for Business, School ERP & Employee Accounts | Compatible with Windows, Google Workspace, Apple ID, Coinbase, Salesforce
  • FIDO2 & Passkey Ready: Business-ready and FIDO2 L1 certified. This key is supported by major management suites and is ideal for both individual and enterprise deployment. Works seamlessly with Gmail, Facebook, GitHub, Dropbox, Coinbase, and more.
  • Universal Connectivity (USB-A ): Features a built-in USB-A connector—simply unfold the key and plug it into your compatible PC or laptop for seamless authentication on the go.
  • Dedicated Manager App: Use the Thetis Manager App for the initial hardware PIN setup. Setting the PIN on the device first ensures a smooth registration process. Once the PIN is configured, you can begin registering the key across your favorite FIDO2-compatible online services.
  • Ultra-Durable & Portable: Featuring a rotating metal cover, this key is water, crush, and tamper-resistant. It fits easily on a keychain and requires no batteries or network connectivity.
  • Check FIDO2 compatibility before purchase - Known limitations: ID Austria is not supported (requires FIDO2 Level 2). Windows Hello login only works with Windows Enterprise editions that support Entra ID, and NFC is NOT supported.

This process reduces avoidable exposure, but no deployment choice by itself guarantees security or prevents compromise. The useful standard is a controlled attack surface, authenticated access, encrypted transport, limited privileges, and a recovery copy that you have actually restored.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Frequently Asked Questions

Is it safe to expose Trilium’s Docker port directly to the internet?

Direct exposure is not the preferred arrangement. Keep the backend private and publish a deliberately configured HTTPS reverse-proxy entry point, restricting or removing other port mappings.

Can I turn off Trilium authentication if my reverse proxy has its own login?

Do not use that as a casual shortcut. noAuthentication=true disables Trilium authentication and bypasses TOTP, while interactive proxy authentication can prevent unattended synchronization.

What should I do if synchronization fails after adding a proxy?

Check that the proxy forwards WebSocket Upgrade and Connection headers, that the hostname and certificate are trusted by the client, and that synchronization is not being stopped by an interactive forward-auth challenge.

Do I need to enable backend scripting or the SQL Console?

Usually no. Both are disabled by default starting with Trilium v0.104.0. Enable either only for a specific trusted task, restrict access, and disable it again when finished.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What exactly should a Trilium backup contain?

Back up the complete data directory. It contains the database, configuration, backups, and logs, and Trilium’s documentation identifies that single directory as the complete backup unit.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.