# CF-Server-Monitor
A lightweight multi-server monitoring dashboard built on Cloudflare Workers, D1, and Durable Objects.
简体中文
|
English
[](version.json)
[](https://github.com/huilang-me/CF-Server-Monitor/stargazers)
[](https://github.com/huilang-me/CF-Server-Monitor/forks)
[](#license)
[Live Demo](https://demo.huilang.me/) · [API Reference](API.md) · [Go Agent Guide](https://github.com/huilang-me/cfsm-agent) · [Theme Development](theme-develop.md)
## Overview
CF-Server-Monitor is a server monitoring system designed for Cloudflare Workers. Each server runs an Agent that reports metrics to a Worker. The Worker stores data in D1 and pushes realtime updates through Durable Objects and WebSocket, providing free-hosted, low-maintenance realtime monitoring.
It supports mainstream Linux distributions, Alpine Linux, OpenWrt, macOS, Synology DSM, Feiniu fnOS, Windows, and similar systems, and provides Docker image deployment.
Security is stricter by design: the Agent only reports metrics one way, does not provide WebSSH, remote command delivery, or a controller channel, and can run as a non-root user to reduce blast radius.
## Contents
- [Why CF-Server-Monitor](#why-cf-server-monitor)
- [Features](#features)
- [Architecture](#architecture)
- [Version Notes](#version-notes)
- [Quick Deployment](#quick-deployment)
- [First Use](#first-use)
- [Agent Parameters and Security](#agent-parameters-and-security)
- [Configuration](#configuration)
- [Notifications and Alerts](#notifications-and-alerts)
- [Security Notes](#security-notes)
- [Themes and Appearance](#themes-and-appearance)
- [Upgrade and Maintenance](#upgrade-and-maintenance)
- [Local Development](#local-development)
- [Project Structure](#project-structure)
- [FAQ](#faq)
- [Screenshots](#screenshots)
- [Support](#support)
## Why CF-Server-Monitor
Compared with traditional controller-style monitoring tools, CF-Server-Monitor is designed for low cost, low maintenance, and security-first operation:
- Free hosting: the dashboard, API, database, and realtime push run on Cloudflare and are designed around free-tier limits; the default 60-second reporting interval supports roughly 60 servers, and changing it to 120 seconds can theoretically double that capacity.
- Safer one-way reporting: no WebSSH, no remote command delivery, and no controller channel; the Agent only reports metrics to the Worker.
- Practical feature coverage: realtime metrics, history charts, maps, offline notifications, resource alerts, expiration reminders, theme store, multi-language UI, and mobile support are built in.
- Dynamic Agent config delivery: ping nodes, collect interval, report interval, network interfaces, traffic reset day, upload/download traffic correction, and similar parameters can be changed from the admin panel and picked up by the Agent later; Worker URL, `API_SECRET`, and the auto-update switch require running the install command again.
- Non-root installation: Linux systems with `systemd --user` can run the Agent as a regular user, with files stored under `~/.cf-probe/`.
- Clock-tolerant reporting: the Go Agent uses the Worker's HTTP `Date` response header to calibrate sample timestamps and `boot_time`, reducing the impact of wrong local server time on history charts; it does not change the system clock.
## Features
| Area | Capabilities |
| --- | --- |
| Realtime monitoring | CPU, GPU, memory, swap, disk, disk IO, network, connections, process count, load average, uptime |
| History | 7-day charts, long-range sampling, realtime network speed, monthly traffic and correction |
| Network quality | Latency and packet loss tracking for CT, CU, CM, and BGP nodes; when three-net details are enabled, the dashboard samples up to 20 real points from the last 2 hours of D1 history and caches them for 5 minutes |
| Dashboard views | Bar chart, ring chart, table, and map views for desktop and mobile |
| Admin panel | Server CRUD, drag sorting, hidden servers, import/export, batch delete, database maintenance |
| Cross-platform Agent | Mainstream Linux, Alpine Linux, OpenWrt, Synology DSM, Feiniu fnOS, FreeBSD, macOS, Windows, plus Docker image deployment; Go Agent by default, Shell/PowerShell still available |
| Realtime push | Durable Objects + WebSocket refresh the UI immediately after Agent reports |
| Alerts | Offline alerts, recovery notices, expiration reminders, resource load rules |
| Multi-language | Built-in Chinese and English frontend switch; Chinese and English documentation |
| Multi-site | GitHub Pages static frontend and aggregation of multiple Worker APIs |
| Widget | iOS Scriptable widget script for quick mobile status checks |
| Security | API Secret, admin password, JWT, Turnstile, CORS, CSP allowlists |
| Theme ecosystem | Built-in theme, Mikus mode, theme store, third-party theme proxy and preview |
| Cloudflare-friendly | Monthly table rotation, sampled history queries, caching, and rate controls for free-tier usage |
## Architecture
```mermaid
flowchart LR
Agent["Server Agent