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.
Requirements
Section titled “Requirements”- 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.
Path 1: run the one-liner
Section titled “Path 1: run the one-liner”-
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.
-
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).
Path 2: install over SSH
Section titled “Path 2: install over SSH”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.
Provisioning the stack
Section titled “Provisioning the stack”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).
Authentication
Section titled “Authentication”| Stage | Token |
|---|---|
| First registration | install token (one-time, 1 h TTL) |
| Steady state | long-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.
Agent updates
Section titled “Agent updates”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).
Automate it
Section titled “Automate it”REST and MCP work on every plan with an mzmcp_ token:
| Task | MCP tool | REST |
|---|---|---|
| Mint an install token and one-liner | servers_create (body name, optional install_config) | POST /v1/servers |
| List / revoke install tokens | install_tokens_list, install_tokens_revoke | GET /v1/install-tokens, DELETE /v1/install-tokens/{id} |
| Provision or repair the stack | servers_provision, then jobs_get | POST /v1/servers/{id}/provision (202 {job_id}) |
| Provisioning state | servers_provision_get | GET /v1/servers/{id}/provision |
| Re-apply a template | servers_provision_remediate (template_id) | POST /v1/servers/{id}/provision/remediate |
| Agent version and updates | agent_release, agent_update, agent_update_fleet, agent_rollout | /v1/servers/agent/*, /v1/servers/{id}/agent/update |
| Update policy | agent_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.
Uninstall
Section titled “Uninstall”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/mzagentand/usr/local/bin/mz, - removes
/etc/mzagentand/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):
sudo systemctl disable --now mzagent.servicesudo rm -f /etc/systemd/system/mzagent.service /usr/local/bin/mzagent /usr/local/bin/mzsudo rm -rf /etc/mzagent /opt/mzpanelsudo systemctl daemon-reloadRelated
Section titled “Related”- Getting started: your first server, end to end.
- Servers: the fleet page and server deletion.
- The agent: what runs on the box and how it updates.
- Agentless servers: SSH-only boxes without an agent.