tutorial

Monitoring Lychee Photo Gallery with Vigilmon

Lychee is a self-hosted photo gallery that stores your memories — if it goes down, you lose access to years of photos. Here's how to monitor Lychee's web UI, API, album endpoints, storage, and SSL certificates with Vigilmon.

Lychee is a beautiful self-hosted photo gallery that gives you full control over your photos — no Google Photos subscription, no privacy concerns, no storage limits beyond your own disk. But photos stored on self-hosted infrastructure are only accessible if that infrastructure stays up. Vigilmon gives you uptime monitoring, API health checks, storage availability alerts, and SSL certificate expiry warnings so your photo gallery is always reachable.

What You'll Set Up

  • HTTP uptime monitor for the Lychee web UI
  • API health check for the Lychee backend
  • Album endpoint response monitoring
  • SSL certificate expiry alerts
  • Storage availability check via heartbeat

Prerequisites

  • Lychee deployed with Docker or LAMP/LEMP stack
  • Lychee accessible over HTTPS on a domain
  • A free Vigilmon account

Step 1: Monitor the Lychee Web UI

The Lychee web interface is the main entry point for viewing and managing your photo gallery. An HTTP monitor catches web server failures, PHP-FPM crashes, and container restarts:

  1. Log in to vigilmon.online and click Add Monitor.
  2. Set Type to HTTP / HTTPS.
  3. Enter your Lychee URL: https://photos.yourdomain.com.
  4. Set Check interval to 5 minutes.
  5. Set Expected HTTP status to 200.
  6. Click Save.

The root URL loads the gallery homepage. If it returns anything other than 200 — a 502 from nginx, a 500 from PHP, or a connection timeout — you get an alert immediately.


Step 2: Check the Lychee API Health Endpoint

Lychee's REST API powers both its own frontend and any third-party clients (LycheeOrg mobile apps, CLI tools). Monitoring the API endpoint separately gives you visibility into the application layer beyond just the web server:

  1. In Vigilmon, click Add MonitorHTTP / HTTPS.
  2. Set the URL to https://photos.yourdomain.com/api/v2/Session::init.
  3. Set Method to POST (Lychee's API uses POST for session endpoints).
  4. Set Expected HTTP status to 200.
  5. Set Check interval to 5 minutes.
  6. Click Save.

Verify from the command line:

curl -s -X POST https://photos.yourdomain.com/api/v2/Session::init \
  -H "Content-Type: application/json" \
  -d '{}'
# → {"user":null,"rights":{"..."},"..."}

A successful response — even for an unauthenticated session initialization — confirms that PHP, the Lychee application, and its database connection are all working.


Step 3: Monitor Album Endpoint Responses

Lychee organizes photos into albums. If your database connection drops or the photo storage becomes unavailable, the album listing endpoint will fail even if the homepage still renders:

  1. In Vigilmon, click Add MonitorHTTP / HTTPS.
  2. Set the URL to https://photos.yourdomain.com/api/v2/Albums.
  3. Set Method to GET.
  4. Set Expected HTTP status to 401 — an unauthenticated request to the albums API should return 401, confirming the endpoint is active.
  5. Set Check interval to 10 minutes.
  6. Click Save.

A 401 means the API is running and enforcing authentication. A 500 or 503 means something deeper is broken — your database is likely unreachable or the storage mount has disappeared.


Step 4: SSL Certificate Alerts

Photos are personal. Your gallery should always be served over HTTPS, and a lapsed certificate makes the site inaccessible in modern browsers:

  1. Open the HTTP / HTTPS monitor for https://photos.yourdomain.com (created in Step 1).
  2. Enable Monitor SSL certificate under the SSL section.
  3. Set Alert when certificate expires in less than 21 days.
  4. Click Save.

Twenty-one days gives you three weeks to investigate a Let's Encrypt renewal failure and manually trigger renewal before your gallery locks you out:

# Manually renew if auto-renewal failed
certbot renew --force-renewal -d photos.yourdomain.com

# Or with Docker using the official Certbot image
docker run --rm -v /etc/letsencrypt:/etc/letsencrypt certbot/certbot renew

Step 5: Monitor Storage Availability

Lychee stores photos on disk. If the storage volume fills up, unmounts, or becomes inaccessible, new uploads fail silently and existing photos may not load — but the web UI might still appear "up." A storage health check script can ping Vigilmon only when storage is confirmed available:

  1. In Vigilmon, click Add MonitorCron Heartbeat.
  2. Set the expected ping interval to 15 minutes.
  3. Copy the heartbeat URL.
  4. Create a script on your server:
#!/bin/bash
STORAGE_PATH="/path/to/lychee/uploads"
HEARTBEAT_URL="https://vigilmon.online/heartbeat/your-token"

# Check storage is mounted and has free space
if [ -d "$STORAGE_PATH" ] && [ "$(df "$STORAGE_PATH" | awk 'NR==2{print $5}' | tr -d '%')" -lt 95 ]; then
    curl -s "$HEARTBEAT_URL"
fi
  1. Make the script executable and add it to cron:
chmod +x /usr/local/bin/lychee-storage-check.sh
crontab -e

Add:

*/15 * * * * /usr/local/bin/lychee-storage-check.sh

If storage fills up or unmounts, the heartbeat stops and Vigilmon alerts you — before your users notice missing photos.


Step 6: Configure Alert Channels

  1. Go to Alert Channels in Vigilmon and add email, Slack, or a webhook.
  2. For a personal photo gallery, email is the most natural alert channel — it goes directly to your phone.
  3. Set Consecutive failures before alert to 2 to avoid false alerts from brief server restarts during automatic updates.
  4. Use Maintenance windows before applying Lychee updates or migrating storage volumes.

If you share the gallery with family members, consider adding a webhook to send an SMS via a service like Twilio — that way the person managing the server gets an immediate notification even without checking email.


Summary

| Monitor | Target | What It Catches | |---|---|---| | Web UI | https://photos.yourdomain.com | Frontend unavailable | | Session API | /api/v2/Session::init (POST, 200) | PHP / DB failure | | Albums API | /api/v2/Albums (GET, expect 401) | Application layer error | | SSL certificate | Your Lychee domain | Certificate expiry | | Storage heartbeat | Heartbeat URL | Disk full / unmounted storage |

Lychee lets you own your photo memories completely — but self-hosting means you own the reliability too. With Vigilmon checking your gallery's UI, API, album endpoints, storage, and certificates, you'll know the moment something needs attention, long before you (or your family) tries to access a photo and finds the gallery unreachable.

Monitor your app with Vigilmon

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

Start free →