PocketBase is a single-binary backend that bundles a SQLite database, authentication, realtime subscriptions, and file storage — all in one executable you can self-host on a $5 VPS. That's a compelling stack, but self-hosting means you're the ops team. If your PocketBase process crashes, your SQLite file gets corrupted, or your VPS runs out of disk space, there's no managed platform to alert you. Vigilmon gives you external uptime monitoring that watches your PocketBase instance from outside your server and notifies you the moment something goes wrong.
What You'll Build
- A Vigilmon ping monitor on PocketBase's built-in health endpoint
- A keyword assertion to confirm the backend is actually healthy, not just responding
- An alerting setup for crashes, disk issues, and slow responses
Prerequisites
- A running PocketBase instance accessible over HTTPS (recommended: reverse proxy with Caddy or Nginx)
- A free account at vigilmon.online
Step 1: Locate PocketBase's Built-In Health Endpoint
PocketBase ships with a health check endpoint at /api/health. No configuration required — it's active on every PocketBase installation out of the box.
curl https://your-pocketbase-domain.com/api/health
A healthy PocketBase returns:
{"code":200,"message":"API is healthy."}
If PocketBase is running but the database is locked or inaccessible, it will return a non-200 status. If the process has crashed, the connection will be refused entirely.
HTTPS requirement: Run PocketBase behind a reverse proxy (Caddy or Nginx) with a TLS certificate. Vigilmon requires HTTPS for production monitors. Caddy makes this trivial:
your-domain.com { reverse_proxy localhost:8090 }
Step 2: Create a Vigilmon Ping Monitor
A ping (HTTP) monitor makes an HTTP GET request on a schedule and alerts you if the response is non-200 or times out.
- Log in to Vigilmon → Add Monitor → HTTP.
- URL:
https://your-pocketbase-domain.com/api/health. - Check interval: 60 seconds.
- Response timeout: 10 seconds (PocketBase is fast; 10 s is generous).
- Expected status:
200. - Click Save.
Vigilmon will immediately start probing your PocketBase health endpoint every 60 seconds from an external location.
Step 3: Add a Keyword Assertion
A status code of 200 confirms the HTTP server responded, but it doesn't confirm PocketBase itself is healthy. Add a keyword assertion to verify the response body contains the expected content.
In the same monitor (or as a separate Keyword monitor):
- Keyword:
API is healthy - Keyword must be present: yes
Now Vigilmon fails the check if:
- PocketBase returns 200 but a reverse proxy error page (e.g., Nginx's "502 Bad Gateway" page with a 200 override)
- The response body is empty (e.g., the process is restarting)
- A misconfigured upstream returns unexpected content
Custom health endpoint: PocketBase's built-in
/api/healthis sufficient for most cases, but you can extend it by writing a Go plugin or running a small sidecar. For most self-hosters, the built-in endpoint is all you need.
Step 4: Monitor the Admin UI (Optional)
If you use PocketBase's admin dashboard, add a second monitor to catch cases where the backend process is up but the admin UI is inaccessible (e.g., a port conflict or binding issue):
- Add Monitor → HTTP.
- URL:
https://your-pocketbase-domain.com/_/(the admin panel path). - Expected status:
200. - Keyword:
PocketBase(appears in the page title).
This catches situations where PocketBase is partially broken — serving the API but not the admin panel, or vice versa.
Step 5: Monitor Disk Space (Indirect)
PocketBase stores all data in a single SQLite file. If your VPS disk fills up, SQLite writes fail and PocketBase returns errors. Vigilmon can detect this indirectly: when SQLite writes fail, PocketBase's health endpoint returns a non-200 status.
For direct disk monitoring, combine Vigilmon with a lightweight agent on your VPS. Alternatively, use a cron job that pings Vigilmon's heartbeat URL only when disk usage is below a threshold:
# /etc/cron.d/pocketbase-disk-heartbeat
*/5 * * * * root \
DISK=$(df / --output=pcent | tail -1 | tr -d '% ') && \
[ "$DISK" -lt 80 ] && \
curl -fsS -X POST https://vigilmon.online/api/heartbeat/YOUR-HEARTBEAT-ID
Create a Heartbeat monitor in Vigilmon with a 10-minute grace period. If disk usage exceeds 80%, the cron job stops pinging, and Vigilmon alerts you before the disk fills completely.
Step 6: Configure Alerting
In Vigilmon under Settings → Notifications, set up your alert channels:
| Trigger | Channel | Notes |
|---|---|---|
| PocketBase health endpoint returns non-200 | Email + Slack | Process likely crashed; restart with systemctl restart pocketbase |
| Response timeout (> 10 s) | Email | SQLite may be locked; check pocketbase.log |
| Keyword API is healthy missing | Email | Proxy misconfiguration or partial startup |
| Disk heartbeat misses | Email | SSH in and run df -h immediately |
Alert after: 1 consecutive failure. PocketBase is a single-process binary; it doesn't flap — if it's down, it's down.
Re-notify: every 5 minutes while the issue persists.
Keeping PocketBase Running with systemd
If you're running PocketBase directly on a VPS, use a systemd service so it auto-restarts on crash:
# /etc/systemd/system/pocketbase.service
[Unit]
Description=PocketBase
After=network.target
[Service]
Type=simple
User=pocketbase
WorkingDirectory=/opt/pocketbase
ExecStart=/opt/pocketbase/pocketbase serve --http=127.0.0.1:8090
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
sudo systemctl enable --now pocketbase
With systemd auto-restart and Vigilmon external monitoring, your coverage looks like this:
- PocketBase crashes → systemd restarts it within 5 seconds
- If it doesn't come back up, Vigilmon detects the outage within 60–120 seconds and alerts you
- You SSH in and check
journalctl -u pocketbase -n 50
What Vigilmon Catches That Server Logs Miss
| Scenario | Server logs | Vigilmon |
|---|---|---|
| Process crashes and systemd restart fails | May log the crash | HTTP monitor fires within 60–120 s |
| VPS out of disk → SQLite write failures | Errors in pocketbase.log | Health endpoint returns non-200; monitor fires |
| Reverse proxy misconfiguration | Nginx/Caddy error log | Keyword monitor catches unexpected response |
| Network issue isolates VPS from internet | Logs inaccessible | External Vigilmon still detecting unreachable |
| Admin panel inaccessible | Not in health logs | Second monitor on /_/ catches it |
PocketBase's simplicity is its strength, but simplicity means there's less infrastructure watching over it. Vigilmon fills that gap — an independent, external eye on your self-hosted backend that never goes offline when your VPS does.
Start monitoring your PocketBase instance in under 5 minutes — register free at vigilmon.online.