WHMCS addon module that displays live VPS server statistics (load, memory, disk, uptime, web apps) directly on the client product details page, by connecting to the VPS over SSH.
Built by Alexandre Alves at Collectif WEB and released as open source for the WHMCS / RunCloud community.
Module addon WHMCS qui affiche les statistiques temps réel des serveurs VPS (charge, mémoire, disque, uptime, applications web) directement sur la page produit du client, via une connexion SSH.
- Load average (1 / 5 / 15 min) with color indicator
- Memory progress bar + MB values
- Disk progress bar + GB values
- Uptime formatted (days / hours / minutes)
- Web Applications list with PHP version (RunCloud-aware)
- Configurable DB-backed cache (default 5 min)
- Bilingual (EN / FR), auto-detects the client language
- Hardened against SSRF, XSS, path traversal
- WHMCS 8.x+
- PHP 7.4+
- SSH connectivity from the WHMCS server to the VPS hosts
- VPS managed by RunCloud (recommended) or any Linux host exposing
/proc/loadavg,free,df,/proc/uptime
-
Copy
modules/addons/hub_rc_vps/into your WHMCS install:/your-whmcs/modules/addons/hub_rc_vps/ -
Install dependencies:
cd /your-whmcs/modules/addons/hub_rc_vps/ composer install --no-dev -
Activate the module in WHMCS Admin:
- Setup → Addon Modules → HUB RunCloud VPS Stats → Activate
-
Configure:
- SSH Private Key Path – absolute path to the SSH private key on the WHMCS server
- SSH Username – SSH user (recommended:
runcloud) - Cache TTL – cache duration in seconds (default: 300)
ssh-keygen -t ed25519 -f /path/to/hub_rc_vps_key -N "" -C "hub-rc-vps-whmcs"Important (open_basedir): if WHMCS runs under PHP-FPM with
open_basedir, the key must live inside an allowed directory. We recommend placing it directly inside the module folder as a hidden file:/your-whmcs/modules/addons/hub_rc_vps/.ssh_keyDotfiles are blocked by nginx-rc (403), so the key stays unreachable from the web.
In RunCloud → Server → SSH → SSH Key → Add New:
- Label:
WHMCS - User:
runcloud(recommended; avoidsPermitRootLoginissues) - Paste the public key (
.pub)
In WHMCS Admin → Setup → Addon Modules → HUB RunCloud VPS Stats:
- SSH Private Key Path:
/your-whmcs/modules/addons/hub_rc_vps/.ssh_key - SSH Username:
runcloud
- Some RunCloud servers ship with
PermitRootLogindisabled - The
runclouduser has access to everything we need (/proc/loadavg,free,df,/proc/uptime, FPM configs) - Less risk of being blocked by SSH security policies
For each VPS client service, fill in the Dedicated IP field with the VPS IP address. The stats widget will appear automatically on the product details page.
Custom SSH port supported via IP:PORT format (e.g. 1.2.3.4:2222).
You can restrict the SSH key so it is only accepted from the WHMCS server IP. On each VPS, in /home/runcloud/.ssh/authorized_keys, prefix the key:
from="WHMCS_IP",no-port-forwarding,no-X11-forwarding,no-agent-forwarding ssh-ed25519 AAAA... hub-rc-vps-whmcs
Note: RunCloud may overwrite
authorized_keyswhen SSH keys are edited via its UI. Re-check after any change.
- SSRF: private and reserved IPs rejected (
FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) - XSS: all output escaped with
htmlspecialchars() - Path traversal: language name sanitized (
preg_replace('/[^a-z0-9_-]/', '', $language)) - Sensitive files:
.ssh_keyand.debug.logare dotfiles, blocked by nginx-rc - SQL injection: Capsule ORM (parameterized queries)
- Make sure the WHMCS public key is added to the
runclouduser (notroot) in RunCloud → SSH - Verify the SSH Username module setting is
runcloud - If using
root, check thatPrevent root loginis not enabled - Purge the module cache from the admin page
- Check port 22 is open in RunCloud → Security → Firewall (Global type)
- Check that fail2ban has not banned the WHMCS IP (failed attempts can trigger bans)
- To unban:
fail2ban-client unban WHMCS_IPon the VPS
Some servers require a root password change on first connection. Either log in manually once or switch to the runcloud user.
modules/addons/hub_rc_vps/
├── hub_rc_vps.php # Main module (config, admin, SSH test)
├── hooks.php # ClientAreaProductDetailsOutput hook + HTML rendering
├── lib/
│ ├── ServerStats.php # SSH client (phpseclib) + system stats parser
│ └── Cache.php # DB cache (mod_hub_rc_vps_cache)
├── lang/
│ ├── english.php
│ └── french.php
├── .ssh_key # Private SSH key (NOT committed, blocked by nginx)
├── .debug.log # Debug log (NOT committed, blocked by nginx)
└── vendor/ # phpseclib (composer)
The module detects RunCloud webapps by scanning FPM sockets in /run/, mapping each socket to its php-fpm: master parent process to extract the PHP version. Format: app-name|phpversion (e.g. app-mysite|82 → PHP 8.2).
This approach works for both root and runcloud SSH users (no privileged file access required).
Pull requests are welcome! See CONTRIBUTING.md for guidelines.
For bug reports and feature requests, please use the GitHub issue tracker.
