Skip to content
Install the agent Requirements, the two install paths (one-liner and install over SSH), provisioning the stack, tokens, agent updates and update policy, MZPanel Local, and self-uninstall.

Install the agent

The agent is a single static Go binary (mzagent, about 10 to 15 MB) that idles at around 15 MB RAM. It has no runtime dependencies and runs on amd64 and arm64. The same binary is also the on-box mz CLI: the installer links /usr/local/bin/mz to /usr/local/bin/mzagent.

  • Ubuntu 24.04 or 26.04 LTS, Debian 12 or 13, or AlmaLinux / Rocky Linux 9 or 10 (the RHEL family is beta: the core stack works, a few panel features report “not available on this OS”)
  • Older releases (Ubuntu 22.04, Debian 11, EL 8) are refused by the installer
  • 1 CPU / 1 GB RAM minimum
  • Root (or sudo)
  • Outbound HTTPS:443 open (no inbound ports needed)
  • A free server slot on your plan: over quota, adding a server returns 402 server_limit (see Tiers & quotas)
  • systemd running as PID 1 (the installer checks it)

A machine you also use for other things (a desktop, a Windows PC through WSL2, a box at home behind NAT) installs with MZ_PROFILE=homelab, which never touches the firewall, SSH, timezone or disk quotas. On WSL or a desktop session the installer refuses without it. See Homelab and local machines.

  1. In the dashboard, Servers > Add server, name the server, optionally choose a preset, components or a server template, keep Run a command, and click Generate install command.

  2. On the VPS, as root:

    Terminal window
    curl -fsSL https://get.mzpanel.com | sudo INSTALL_TOKEN=<install-token> SERVER_NAME='web-1' bash

The script downloads the binary, creates the systemd unit mzagent.service, links mz, and registers with the control plane using the install token (valid for 1 hour, single use).

In Add server, pick Install over SSH and enter the host, port, user and a password or private key. The control plane opens one SSH session, runs the same installer with a fresh token, and streams the steps (connect, download agent, register, start). The credential is held in memory for the install only. Loopback, private and reserved addresses are refused.

If you chose components or a template, the agent installs them right after it first connects (Nginx, PHP versions, MariaDB, PostgreSQL, Redis, Docker, Node.js, Supervisor, phpMyAdmin, firewall and Fail2ban, plus timezone, swap and SSH hardening). Provisioning is idempotent: installed parts are skipped, so you can run it again to repair or add components later (servers_provision over the API).

StageToken
First registrationinstall token (one-time, 1 h TTL)
Steady statelong-lived agent token

If the control plane is briefly unreachable, the agent keeps running and reconnects on its own. Jobs sent while it is offline are delivered when it reconnects (they expire after 24 hours as expired_offline). Scheduled backups keep running from the box (see Backups), and you can manage the box directly with MZPanel Local.

The agent can update itself. Each server has an update policy: pinned, manual, security or auto, or it inherits the workspace default. Releases roll out in stages (canary first, then wider percentages). Open the Agent update panel from the server switcher or the update notice to update one server now or the whole fleet. Every update is checked against the release’s SHA-256 before it replaces the binary (see The agent).

REST and MCP work on every plan with an mzmcp_ token:

TaskMCP toolREST
Mint an install token and one-linerservers_create (body name, optional install_config)POST /v1/servers
List / revoke install tokensinstall_tokens_list, install_tokens_revokeGET /v1/install-tokens, DELETE /v1/install-tokens/{id}
Provision or repair the stackservers_provision, then jobs_getPOST /v1/servers/{id}/provision (202 {job_id})
Provisioning stateservers_provision_getGET /v1/servers/{id}/provision
Re-apply a templateservers_provision_remediate (template_id)POST /v1/servers/{id}/provision/remediate
Agent version and updatesagent_release, agent_update, agent_update_fleet, agent_rollout/v1/servers/agent/*, /v1/servers/{id}/agent/update
Update policyagent_policy_get, agent_policy_set (policy, or null for the org default)GET/PATCH /v1/servers/{id}/agent/policy

servers_create needs a token at level full with the opt-in scope servers:enroll. Provisioning can take up to 30 minutes; poll jobs_get.

Deleting the server in the dashboard uninstalls the agent. Use Settings > Danger zone > Remove from account (or servers_delete, which needs the opt-in scope servers:delete). The control plane sends the agent an uninstall message and the agent, in a detached unit:

  • stops and disables mzagent.service,
  • removes /etc/systemd/system/mzagent.service, /usr/local/bin/mzagent and /usr/local/bin/mz,
  • removes /etc/mzagent and /opt/mzpanel.

Websites, apps, databases, mail and files are not touched, and neither is the on-box registry under /etc/mz. If the agent was offline when you deleted the server, it uninstalls itself the next time it tries to connect (the control plane answers 410 Gone).

To remove the agent by hand (for example on a box you no longer have in your account):

Terminal window
sudo systemctl disable --now mzagent.service
sudo rm -f /etc/systemd/system/mzagent.service /usr/local/bin/mzagent /usr/local/bin/mz
sudo rm -rf /etc/mzagent /opt/mzpanel
sudo systemctl daemon-reload