DEV Community

Vigilmon
Vigilmon

Posted on

How to Monitor Your PocketBase App with Vigilmon

PocketBase is an open-source backend-in-a-file: a SQLite database, REST API, realtime subscriptions, auth, and file storage — all in a single Go binary. It's a favorite for indie developers and side projects. Here's how to monitor your PocketBase instance with Vigilmon.

PocketBase's Built-in Health Endpoint

PocketBase exposes a health check endpoint at:

GET /api/health
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "code": 200,
  "message": "API is healthy.",
  "data": {
    "canBackup": true
  }
}
Enter fullscreen mode Exit fullscreen mode

This is the ideal endpoint for Vigilmon — it verifies PocketBase is running and the API is responding.

Setting Up Monitoring

  1. Verify the endpoint from your browser or terminal:
curl https://your-pocketbase-host.com/api/health
# Returns {"code":200,"message":"API is healthy.",...}
Enter fullscreen mode Exit fullscreen mode
  1. Sign up at vigilmon.online (free, 5 monitors)

  2. Create a monitor:

Setting Value
URL https://your-pocketbase-host.com/api/health
Method GET
Interval 60 seconds
Expected status 200
Keyword check healthy
  1. Add your email address and save.

Vigilmon now checks your PocketBase every minute.

Common PocketBase Deployment Setups

Fly.io

# fly.toml
[http_service]
  internal_port = 8090
  force_https = true

[[http_service.checks]]
  grace_period = "10s"
  interval = "30s"
  method = "GET"
  timeout = "5s"
  path = "/api/health"
Enter fullscreen mode Exit fullscreen mode

Your external URL: https://your-app.fly.dev

Monitor URL: https://your-app.fly.dev/api/health

VPS (systemd service)

# /etc/systemd/system/pocketbase.service
[Unit]
Description=PocketBase
After=network.target

[Service]
Type=simple
User=pocketbase
ExecStart=/usr/local/bin/pocketbase serve --http=0.0.0.0:8090
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
Enter fullscreen mode Exit fullscreen mode

With Nginx proxying to 8090, monitor at:

https://yourdomain.com/api/health
Enter fullscreen mode Exit fullscreen mode

Railway / Render

Both platforms auto-detect PocketBase and expose a public URL. Just append /api/health.

Admin Dashboard Monitoring

For a secondary check that the admin UI is also accessible:

URL: https://your-pocketbase-host.com/_/
Expected status: 200
Enter fullscreen mode Exit fullscreen mode

If the admin dashboard loads (200), the whole PocketBase process is functioning.

Monitoring PocketBase Data Endpoints

For production apps, add a second Vigilmon monitor that checks actual data retrieval:

URL: https://your-pocketbase-host.com/api/collections/posts/records?perPage=1
Method: GET  
Expected status: 200
Keyword: items
Enter fullscreen mode Exit fullscreen mode

Use a public collection or add ?skipTotal=1 for performance. This verifies the database layer is working, not just the API layer.

Database Backup Health

PocketBase has auto-backup via /_/api/backups. The /api/health response includes "canBackup": true/false. If you're worried about backup disk space:

// Custom check script (optional — for CI or advanced setups)
const health = await fetch('https://your-pb.com/api/health').then(r => r.json())
if (!health.data.canBackup) {
  console.error('PocketBase: backup disabled — check disk space')
}
Enter fullscreen mode Exit fullscreen mode

Vigilmon's keyword check can catch "canBackup":false if you want to alert on that specifically:

  • Keyword: "canBackup":true — alert if this string is missing from the response

What Breaks When PocketBase Goes Down

  • All client app API calls fail (data, auth, file uploads)
  • Realtime subscriptions disconnect
  • User login/registration breaks
  • File storage access fails

For PocketBase apps with active users, even a 5-minute outage is noticeable. Vigilmon's 60-second check means you know within a minute.

Alerting for Side Projects

PocketBase is popular for side projects and small production apps. Right-sized alerting:

  • Email (free): you get an alert, deal with it when you can
  • Slack/Discord webhook: if you have a community server for your app

For apps with paying users: set up a status page (Vigilmon paid plans) at status.yourdomain.com and link to it from your app so users can check it themselves.

Keeping PocketBase Updated

PocketBase releases frequently. Set a reminder to update monthly. Before updating, verify your health endpoint after each upgrade:

# After updating
systemctl restart pocketbase
sleep 5
curl https://yourdomain.com/api/health
Enter fullscreen mode Exit fullscreen mode

If something breaks in an upgrade, Vigilmon catches it within 60 seconds.

Summary

PocketBase monitoring in 3 steps:

  1. PocketBase already has /api/health — no code needed
  2. Create a Vigilmon monitor pointing at it
  3. Add email alert

One-time setup, permanent visibility.

Start monitoring PocketBase free on Vigilmon →

Top comments (0)