Servers
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
Servers (/servers) is the home of your fleet: one card per VPS, each with
live CPU, RAM and disk usage, OS, site and Docker counts, and an online/offline
badge that updates in real time. It’s also the single entry point for connecting
a new server. Available on all plans — the number of servers you can connect
is set by your plan’s VPS quota (Free = 1, Plus = 3, Pro = 10, Max = 50).
Add a server, step by step
Section titled “Add a server, step by step”- Click Add server (top-right of the toolbar) to open the push-dock composer.
- Give the server a name — how it shows in your fleet (you can rename it later).
- Pick how the agent gets installed:
- Run a command — you SSH into the VPS yourself and paste a one-liner.
- Install over SSH — you hand MZPanel the host, port, user and a password or private key, and the control plane connects once and installs for you.
- Optionally start from a template (a saved install blueprint) or use the install composer to choose the stack: pick a preset (WordPress & PHP, Docker & Apps, Database server, App runtime) or toggle individual components (Nginx, PHP + versions, WP-CLI, MariaDB, PostgreSQL, Redis, Docker, Node.js, Supervisor, phpMyAdmin, Firewall + Fail2ban), plus timezone, swap file, automatic security updates and SSH hardening.
- Finish:
- Run a command → click Generate install command, copy the one-liner, SSH into the VPS as root and run it. The install token is valid for 1 hour.
- Install over SSH → click Connect & install and watch the four install steps stream live (connect → download agent → register → start the service).
- The new card appears and flips to Running within seconds of the agent’s first heartbeat.
What else you can do
Section titled “What else you can do”The page is a searchable, filterable grid of server cards.
- Search — by name, hostname, or IP.
- Filter by status — All / Running / Stopped.
- Filter by tag — once you’ve created tags, narrow to one tag or to Untagged.
- Rename in place — hover a card and click the pencil next to its name.
- Copy the IP — click the IP under the server name to copy it.
- Tag a server — click the tag pill on a card to assign, clear, or create a classification tag (color + icon).
- Open a server — click a card (or View details) to jump into that server’s own sections (Sites, PHP, Databases, Cron, Monitoring, and more).
Each card also shows OS, Load avg, Sites and Docker counts, and per-metric CPU / RAM / Disk bars that turn amber over 60% and red over 85%, plus hostname, architecture and uptime in the footer.
How it works
Section titled “How it works”The page loads once from GET /v1/servers — a single call that returns every
managed server in your org along with its latest heartbeat snapshot (lastMetrics)
and its site/Docker counts (folded in server-side from the agent-pushed inventory
cache, so there’s no per-card fetch and no N+1).
After that first load, the card stays live over a Server-Sent Events stream
(GET /v1/servers/stream): the agent’s heartbeats push fresh CPU/RAM/disk/load/
uptime values and online/offline transitions, and the cards update without polling.
Adding a server drives one of two API routes:
| Method | Route | What happens |
|---|---|---|
| Run a command | POST /v1/servers | Mints a 1-hour install token, returns a curl … | sudo INSTALL_TOKEN=… bash one-liner you paste on the box |
| Install over SSH | POST /v1/servers/install-ssh | The control plane SSHes into the box (ssh2), runs the same installer, and streams output over GET /v1/servers/install-ssh/:runId/stream |
Either way the installer downloads the agent + mz CLI, registers with the
control plane (swapping the one-time token for a long-lived agent token), and
starts the mzagent service. Agentless “Lite” (SSH-only) boxes are not shown
here — they live on their own page.
API & automation
Section titled “API & automation”This is a control-plane page, so the on-box mz CLI does not apply here. To
manage your fleet programmatically, use the MZPanel HTTP API (Max plan):
GET /v1/servers— list every server with its latest metrics and counts.POST /v1/servers— mint an install token + one-liner for a new box.
See the API reference for authentication and the full endpoint
list. For driving an individual box from its own shell, use the
mz CLI once the server is connected.
Gotchas & troubleshooting
Section titled “Gotchas & troubleshooting”- A card stuck on “Installing”. A server shows Installing while
install.shis still setting up; the badge is time-guarded so a failed or stuck install stops showing “Installing” after ~30 minutes and falls back to Stopped. Re-run the installer if it never comes online. - Metrics show ”—” or 0%. The usage bars come from the agent’s heartbeat. Until the first heartbeat lands (or on an older agent that omits a field), you’ll see ”—” rather than a fabricated value. Bring the agent online and the bars fill in.
- Counts read 0 for a brand-new box. Site and Docker counts come from the inventory cache; a server that has never connected contributes no cache, so it’s counted as 0 until its first sync.
- Install token expired. Tokens are valid for 1 hour. If you didn’t run the one-liner in time, click Add server again to mint a fresh one.
- “Install over SSH” is refused. The control plane won’t connect to a loopback or private/reserved address — use the box’s public host or IP.
- A server you connected isn’t listed. Agentless “Lite” servers are intentionally excluded from this fleet view; they’re SSH/terminal-only and don’t have Sites/PHP/ etc. Managed servers whose agent has never registered also won’t appear until the install completes.
Related
Section titled “Related”- Getting started — install the agent and connect your first VPS.
- The agent — how the dial-out WebSocket connection works.
- Tiers & quotas — how many servers each plan allows.
- The mz CLI — driving a connected box from its own shell.