Maintenance Scripts

NexusPanel ships with six command-line scripts for managing, monitoring, and troubleshooting your installation. All scripts are located in /opt/nexuspanel/ and must be run as root (sudo).

Quick Reference

ScriptPurposeQuick Run
troubleshoot.shFull system diagnostics + auto-repairsudo bash troubleshoot.sh --repair
logs.shUnified log viewer with filterssudo bash logs.sh -f
errors.shError checklist with fix commandssudo bash errors.sh
health.shHealth monitor for cron (auto-recovery)sudo bash health.sh
update.shUpdate to latest versionsudo bash update.sh
uninstall.shComplete removalsudo bash uninstall.sh

1. Troubleshoot — troubleshoot.sh

The most powerful diagnostic tool. Runs 30+ checks across 8 categories and can auto-repair issues.

sudo bash troubleshoot.sh           # Diagnostic report only
sudo bash troubleshoot.sh --repair  # Interactive fix mode
sudo bash troubleshoot.sh --yes     # Full auto-repair, no prompts

Checks Performed

Example Output

━━━ System Information ━━━
  ✓ OS: AlmaLinux 10.2 (almalinux)
  ✓ Kernel: 6.12.0
  ✓ Memory: 2048M / 4096M (50%)
  ✓ Disk: 34% used (45G free)
  ✓ CPU Load: 0.45 (22%)

━━━ Services ━━━
  ✓ nexuspanel: RUNNING
  ✓ nginx: RUNNING

============================================================
  ✓ All checks passed — NexusPanel is healthy

2. Log Viewer — logs.sh

View, follow, filter, and search across all NexusPanel log sources in one command.

sudo bash logs.sh                    # Last 50 lines of service logs
sudo bash logs.sh -f                 # Follow logs in real-time
sudo bash logs.sh -n 200             # Show last 200 lines
sudo bash logs.sh -s "error"         # Filter lines containing "error"
sudo bash logs.sh --all -e           # All logs, errors only
sudo bash logs.sh --nginx            # Nginx error log only
sudo bash logs.sh -f -s "license"    # Follow logs filtered by "license"

Log Sources

Filter Options

3. Error Checklist — errors.sh

Scans your installation for 15 common problems and prints the exact commands to fix each one. No interactivity — just diagnosis and solutions.

sudo bash errors.sh

Categories Checked

Example Output

━━━ Connection Errors ━━━

  ✓ Port is listening — OK
  ✓ nginx is running — OK
  ✗ nginx config is valid
    Fix: Check /etc/nginx/conf.d/nexuspanel.conf

  ✓ Firewall allows HTTP/HTTPS — OK

  ✗ 1 issue(s) found — review fixes above

4. Health Monitor — health.sh

Designed for continuous monitoring via cron. Checks 9 health metrics every run, auto-recovers from common failures, and optionally sends email alerts.

sudo bash health.sh

Cron Setup

# Run every 5 minutes:
crontab -e
# Add this line:
*/5 * * * * /opt/nexuspanel/health.sh

What It Monitors

Email Alerts

Add ADMIN_EMAIL=you@example.com to your .env file. Ensure the mail command is installed and configured on your server.

5. Update — update.sh

Updates NexusPanel to the latest version from GitHub.

sudo bash update.sh

Steps

  1. Pulls latest code from GitHub (with force-reset fallback if stash/pull fails)
  2. Runs npm install --production
  3. Restarts the nexuspanel service
  4. Shows before/after commit hashes

6. Uninstall — uninstall.sh

Completely removes NexusPanel from your system. Requires typing DELETE to confirm.

sudo bash uninstall.sh

What It Removes

What It Keeps

Log File Locations

FileContent
/var/log/nexuspanel-health.logHealth check run history
journalctl -u nexuspanelService stdout/stderr output
/var/log/nginx/error.logNginx proxy errors
/opt/nexuspanel/data/Application data (backups.json, users.json, etc.)