How to Monitor PocketBase Applications with Vigilmon
PocketBase is a single-binary backend that bundles SQLite, authentication, file storage, and a REST API into one deployable file. It's become popular for solo developers and small teams building apps fast. But like any backend, PocketBase needs external monitoring - SQLite can corrupt, the process can crash, and the built-in admin UI doesn't alert you when things go wrong.
Here's how to set up uptime monitoring for PocketBase with Vigilmon.
PocketBase's Built-In Health Endpoint
Good news: PocketBase ships with a health endpoint out of the box.
GET /api/health
Response:
json
{
"code": 200,
"message": "API is healthy."
}
No configuration needed. You can point Vigilmon directly at this endpoint.
Setting Up Vigilmon for PocketBase
- Sign up at vigilmon.online
- Click Add Monitor
- Select HTTP(S)
- URL: https://your-domain.com/api/health
- Method: GET
- Keyword check: Enter "message":"API is healthy" - this verifies PocketBase responded with its standard health message, not just any HTTP 200
- Check interval: 1 minute for production apps
- Alert channels: Add your email, Slack webhook, or PagerDuty
That's it. Vigilmon will now check your PocketBase instance every minute from multiple geographic regions.
What the Health Check Actually Verifies
PocketBase's /api/health checks that:
- The HTTP server is running and accepting connections
- The API layer is responding
It does not check:
- SQLite database integrity
- File storage accessibility
- Specific collection data
For a deeper health check, you can create a lightweight custom health route.
Custom Health Check with PocketBase Hooks
PocketBase supports hooks written in Go or JavaScript. You can create a custom health endpoint that verifies more:
`javascript
// pb_hooks/health.pb.js
routerAdd("GET", "/api/custom-health", (e) => {
try {
// Test database connectivity with a simple query
const records = .dao().findRecordsByFilter(
"_admins", // system collection
"1=1",
"-created",
1,
0
);
return e.json(200, {
status: "ok",
db: "connected",
timestamp: new Date().toISOString()
});
} catch (err) {
return e.json(503, {
status: "error",
message: "Database check failed"
});
}
});
`
Point Vigilmon at /api/custom-health and use "status":"ok" as your keyword check.
SSL Certificate Monitoring
If PocketBase is behind a reverse proxy (Caddy, nginx, Traefik) that handles TLS, add a separate SSL monitor:
- Add a new Vigilmon monitor
- Select SSL Certificate
- Enter your domain
- Alert 14 days before expiry
This catches certificate renewal failures before they break your app.
Common PocketBase Deployment Setups
Fly.io + PocketBase: The health endpoint works the same way. Use your Fly.io app URL: https://your-app.fly.dev/api/health.
VPS with Caddy: Caddy handles SSL/reverse proxy. Vigilmon checks the public HTTPS endpoint; your health monitor verifies PocketBase is running behind Caddy.
Docker Compose: Set up Vigilmon to check the public domain. Add Docker's own healthcheck config for internal orchestration - the two complement each other.
Heartbeat Monitoring for PocketBase Cron Jobs
PocketBase supports scheduled jobs via hooks. Add a heartbeat to Vigilmon to ensure your cron jobs run:
`javascript
// pb_hooks/daily_sync.pb.js
cronAdd("dailySync", "0 0 * * *", () => {
// ...your job logic
// Signal Vigilmon
const res = .send({
url: "https://vigilmon.online/hb/your-heartbeat-id",
method: "POST",
});
});
`
Vigilmon alerts you if the heartbeat isn't received within the expected window.
Monitoring a PocketBase + Frontend Stack
If you're running a JavaScript frontend (SvelteKit, Nuxt, React) with PocketBase as the backend, monitor both independently:
| Monitor | URL | Check |
|---|---|---|
| PocketBase API | https://api.yourapp.com/api/health | "message":"API is healthy" |
| Frontend | https://yourapp.com | Status 200 |
| SSL | yourapp.com | Valid certificate |
Why External Monitoring Matters for PocketBase
PocketBase's simplicity is its strength, but that single-process architecture means there's no built-in redundancy. If the process crashes:
- No automatic restart unless you've configured a process supervisor (systemd, Docker restart policy)
- No internal alerts - the process is simply gone
- Users see connection refused errors
Vigilmon's external monitoring catches this immediately and routes the alert to wherever your team is.
Get started free on Vigilmon - add your PocketBase health endpoint in under 2 minutes.
Top comments (0)