.docs/panel-setup.md
Docs/panel-setup.md

Panel Setup

Monarch.panel is the central web control plane for Monarch hosts and generic Linux servers. It runs as a Nuxt 4 SPA backed by a Nitro server and built-in SQLite (node:sqlite).

Requirements

  • Node.js 22.13 or newer (required for node:sqlite)
  • OpenSSL (used on first start to generate a self-signed ECDSA P-256 certificate if TLS is enabled)

Installation

Arch Linux (AUR)

yay -S monarch-panel
sudo systemctl enable --now monarch-panel

From source

git clone https://code.weexnes.dev/monarch/panel.git
cd panel
npm install
npm run build
PORT=4382 ./start.sh

To install as a systemd unit when deploying from source:

sudo ./install-service.sh

First-run setup

  1. On first start, Nitro generates an ECDSA P-256 self-signed certificate under $MONARCH_PANEL_DATA/certs/{cert,key}.pem (with SANs for localhost, hostname, loopback, and local interfaces) unless MONARCH_PANEL_NO_TLS=1 is set.
  2. Check the journal or $MONARCH_PANEL_DATA/setup-token for the one-time setup token.
  3. Open https://<host>:4382, enter the setup token, and create the admin password (minimum 12 characters, stored with bcrypt).
  4. Optionally enable TOTP 2FA with single-use recovery codes under Settings.

Environment variables

Variable Default Purpose
PORT / HOST 3000 / 0.0.0.0 HTTP/HTTPS listen port and bind address (4382 is standard on Monarch hosts)
MONARCH_PANEL_DATA ~/.monarch-panel Directory for SQLite database, TLS certs, local-join.json, and collected logs (migrates ~/.controlcenter automatically)
MONARCH_PANEL_TRUST_PROXY unset Set to 1 to trust X-Forwarded-* headers behind Caddy/nginx
MONARCH_PANEL_NO_TLS unset Set to 1 for plain HTTP when terminating TLS at a reverse proxy or on loopback

Managed capabilities

  • Virtual machines: Full libvirt/QEMU/KVM lifecycle, wizard (ISO, imported disk, PXE, empty; BIOS or UEFI with Secure Boot and TPM; Windows presets), vCPU pinning (<cputune>), hot-plug disks and NICs, snapshots, raw XML editing, and tunnelled noVNC + serial consoles (VNC binds to loopback only).
  • Storage & Networking: Filesystems, live block device I/O, LVM, dm-cache, ZFS, RAID, SMART health, libvirt pools/volumes, ISO browser upload or direct node download, interface metrics, WireGuard peers, libvirt networks with DHCP leases, and a fleet-wide network monitor.
  • Host operations: systemd services/timers, live journalctl follow, Docker/Podman containers, accounts & SSH keys, pacman/apt/dnf/zypper updates, firewalld/ufw/nftables rules, web PTY terminal, Caddyfile editor (with caddy validate, backups, and automatic rollback on failed reload), and TLS certificate inventory + acme.sh deployment.
  • Log collection & Alerts: Scheduled or on-demand incremental log pulls (Collect logs now) with glob support and presets (PM2, nginx, Apache, Minecraft, Docker, Caddy, syslog); 2-second live telemetry with 90-day metric history (30 days for interfaces and VMs); Discord webhook alerts for offline/online nodes, CPU/memory/disk/temp thresholds, VM stop/crash, and failing cache SSDs.

Security model

  • HttpOnly, SameSite=Strict, Secure (over HTTPS) server-side sessions with idle and absolute expiry, revocable per session.
  • Strict Origin validation on state-changing requests and WebSockets; X-Frame-Options: DENY, nosniff, no-referrer, strict CSP, and HSTS on HTTPS.
  • Rate limits on login, 2FA verification, initial setup, and node enrollment.
  • Allowlisted daemon RPC methods and stream kinds only; full audit log with secrets redacted.