Docs

Packaged server installation

This is essentially Trilium sources + node modules + node.js runtime packaged into one 7z file.

Steps

The problem with above steps is that once you close the SSH connection, the Trilium process is terminated. To avoid that, you have two options:

Configure Trilium to auto-run on boot with systemd

tar -xvf trilium-linux-x64-server-[VERSION].tar.xz
sudo mv trilium-linux-x64-server /opt/trilium
sudo nano /etc/systemd/system/trilium.service
[Unit]
Description=Trilium Daemon
After=syslog.target network.target

[Service]
User=xxx
Group=xxx
Type=simple
ExecStart=/opt/trilium/trilium.sh
WorkingDirectory=/opt/trilium/

TimeoutStopSec=20
# KillMode=process leads to error, according to https://www.freedesktop.org/software/systemd/man/systemd.kill.html
Restart=always

[Install]
WantedBy=multi-user.target
sudo systemctl enable --now -q trilium

Common issues

Outdated glibc

Error: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /var/www/virtual/.../node_modules/@mlink/scrypt/build/Release/scrypt.node)
    at Object.Module._extensions..node (module.js:681:18)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

If you get an error like this, you need to either upgrade your glibc (typically by upgrading to up-to-date distribution version) or use some other server installation method.

TLS

Don’t forget to configure TLS, which is required for secure usage!