tutorial

Monitoring Trilium Notes with Vigilmon

Trilium Notes is your self-hosted hierarchical knowledge base — but a downed server means your notes are inaccessible when you need them most. Here's how to monitor Trilium availability, API health, and sync server uptime with Vigilmon.

Trilium Notes is a powerful self-hosted note-taking application with a hierarchical tree structure, rich text editing, scripting, and an optional sync server for multi-device access. When your Trilium server goes down, you lose access to your knowledge base — the exact moment you need to look something up. Vigilmon keeps your Trilium instance under constant watch, alerting you the moment the web UI, REST API, or sync server stops responding.

What You'll Set Up

  • Web UI availability monitor at the default :8080 port
  • API health check via the /api/app-info endpoint
  • Database connectivity monitoring through API response validation
  • SSL certificate alerts for secure installations
  • Sync server uptime monitoring for multi-device Trilium setups

Prerequisites

  • Trilium Notes running as a server instance (not the desktop app)
  • Trilium accessible on your local network or a VPS
  • A free Vigilmon account

Step 1: Monitor the Trilium Web UI

Trilium's server interface runs on port 8080 by default. Add a basic availability monitor as your first line of defense:

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your Trilium URL: http://192.168.1.100:8080 (or your domain if behind a proxy).
  4. Set Check interval to 2 minutes.
  5. Set Expected HTTP status to 200.
  6. Click Save.

This catches the most common failure mode: the Node.js process crashes and the port stops responding. If Trilium is only accessible on your home network, deploy a Vigilmon agent on the same LAN to reach it without external exposure.


Step 2: Check the Trilium App-Info API Endpoint

Trilium exposes an /api/app-info endpoint that returns application version and status information. Unlike a web UI check, this confirms the application layer — including its database connection — is functioning correctly:

  1. Add another HTTP / HTTPS monitor.
  2. Enter http://192.168.1.100:8080/api/app-info.
  3. Set Expected HTTP status to 200.
  4. Under Response body check, enter appVersion to confirm the JSON response contains version information.
  5. Set Check interval to 3 minutes.
  6. Click Save.

A healthy response looks like:

{
  "appVersion": "0.63.7",
  "dbVersion": 213,
  "nodeVersion": "v20.11.0",
  "syncVersion": 34
}

The presence of dbVersion in the response confirms that Trilium successfully queried its SQLite database. If the database becomes corrupted or locked, this endpoint will return an error even if the web server is technically running.


Step 3: Verify Database Connectivity via Response Content

Trilium uses SQLite as its database. SQLite is generally very stable, but corruption can occur after unexpected shutdowns or disk full events. The app-info endpoint is your proxy check for database health:

  1. Edit the /api/app-info monitor from Step 2.
  2. Add a second Response body check for dbVersion — this field is only present when the database is accessible and the schema version was successfully read.
  3. Consider adding a check for syncVersion if you use the sync feature.

For additional database protection, configure periodic backups on the Trilium host and monitor the backup job with a heartbeat:

#!/bin/bash
# Daily backup script
cp /path/to/trilium/document.db /backups/trilium-$(date +%Y%m%d).db
# Only ping if backup succeeded
if [ $? -eq 0 ]; then
  curl -s https://vigilmon.online/heartbeat/trilium_backup_url
fi

Set the heartbeat expected interval to 25 hours to catch missed daily backups.


Step 4: SSL Certificate Alerts

If Trilium is exposed over HTTPS — either directly or via a reverse proxy like nginx or Caddy — certificate expiry will break all access. This is especially critical for self-hosted setups on VPS where you need remote access to your notes:

  1. Open the Trilium HTTP monitor using your domain URL.
  2. Enable Monitor SSL certificate in the SSL section.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

For Caddy users, automatic renewal is handled without cron jobs, but Vigilmon's SSL monitor still catches edge cases where renewal fails due to DNS propagation delays or port conflicts.


Step 5: Monitor the Trilium Sync Server

If you run Trilium Notes across multiple devices, you likely have a dedicated sync server or use your main Trilium server as the sync endpoint. Sync server outages are particularly disruptive because they can cause notes to diverge across devices without obvious errors.

The sync server uses the same port and exposes status via API:

  1. Add an HTTP / HTTPS monitor for http://your-sync-server:8080/api/app-info.
  2. Set Expected HTTP status to 200.
  3. Under Response body check, enter syncVersion to confirm sync capability is active.
  4. Set Check interval to 5 minutes.

If you run a dedicated sync server separate from your main Trilium instance, add it as a completely independent monitor so failures in either are caught independently.


Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add your preferred notification method: email, Slack, Discord, or a webhook.
  2. Set Consecutive failures before alert to 2 on the web UI monitor — Trilium can take 15–20 seconds to restart after a crash and reload its SQLite database.
  3. Set Consecutive failures before alert to 1 for the sync server monitor — sync gaps accumulate quickly across devices.

Summary

| Monitor | Target | What It Catches | |---|---|---| | Web UI | http://trilium-host:8080 | Server crash, process exit | | App info API | /api/app-info body: appVersion | Application layer failure | | Database check | /api/app-info body: dbVersion | SQLite corruption, lock | | SSL certificate | Proxied domain | Certificate expiry | | Sync server | Sync host /api/app-info | Sync endpoint outage | | Backup heartbeat | Heartbeat URL | Missed or failed backup |

Your Trilium knowledge base only helps you when it's accessible. With Vigilmon monitoring the web interface, API health, and sync server independently, you'll know within minutes when something goes wrong — and never discover a problem at the moment you most need your notes.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →