This guide outlines the steps to install Trilium on your own server. You might consider this option if you want to set up synchronization or use Trilium in a browser - accessible from anywhere.
There are several ways to install Trilium on a server, each with its own advantages:
The server installation includes both web and mobile frontends.
After setting up your server installation, you may want to configure settings such as the port or enable TLS. Configuration is managed via the Trilium config.ini
file, which is located in the data directory by default. To begin customizing your setup, copy the provided config-sample.ini
file with default values to config.ini
.
You can also review the configuration file to provide all config.ini
values as environment variables instead.
By default, config.ini
, the database, and other important Trilium data files are stored in the data directory. If you prefer a different location, you can change it by setting the TRILIUM_DATA_DIR
environment variable:
export TRILIUM_DATA_DIR=/home/myuser/data/my-trilium-data
If you are running Trilium on localhost only or if authentication is handled by another component, you can disable Trilium’s authentication by adding the following to config.ini
:
[General]
noAuthentication=true
To configure a reverse proxy for Trilium, you can use either nginx or Apache.
Add the following configuration to your nginx
setup to proxy requests to Trilium:
location /trilium/ {
proxy_pass http://127.0.0.1:8080/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
To avoid limiting the size of payloads, include this in the server {}
block:
# Set to 0 for unlimited. Default is 1M.
client_max_body_size 0;
For an Apache setup, refer to the Apache proxy setup guide.