Skip to content
Playbook: add a homelab box Walk a user through adding a machine at home or behind NAT (Linux, Proxmox VM, Raspberry Pi, Windows WSL2, macOS VM) to their MZPanel fleet — pre-install checks, the homelab install profile, the Cloudflare Tunnel (servers_tunnel_create) and deploying apps to it.

Playbook: add a homelab box

Goal: the user wants a machine at home (a mini PC, a Raspberry Pi, a Proxmox VM, their Windows PC through WSL2, a Mac through a Linux VM) in their fleet, with its apps reachable on the Internet.

You guide, the user owns the machine. MZPanel does not install WSL, VMs or anything on Windows/macOS. You give the user the commands, ask them to run what needs their machine (admin PowerShell, the BIOS, the router), and check the results. Human guide: Homelab and local machines.

Token: read to check, operate for servers_update and servers_tunnel_create. Adding the server itself happens on the box (the install one-liner) and needs a free server slot: a homelab box counts against the plan’s server quota like any server (402 server_limit).

Ask: which OS, which hardware, is it on all the time, and do they have a domain on Cloudflare? Then pick the guide:

MachineGuideNotes
Linux on the metal, or a VM on Proxmox/ESXi/Hyper-VLinux, Proxmox, Raspberry PiProxmox: a VM, not LXC
Raspberry Pi 4/5same page64-bit OS, SSD boot
Windows 10/11Windows (WSL2)beta; needs systemd in WSL and a keepalive task
macOSmacOS (Linux VM)OrbStack, Lima, UTM or Multipass

2. Pre-install checks (run them on the box, in Linux)

Section titled “2. Pre-install checks (run them on the box, in Linux)”

Ask the user to run these and paste the output:

Terminal window
. /etc/os-release && echo "$ID $VERSION_ID" # ubuntu 24.04+, debian 12/13, almalinux/rocky 9/10
uname -m # x86_64 or aarch64
ps -p 1 -o comm= # systemd
free -m | awk '/Mem:/{print $2" MB RAM"}' # 2048+ to build apps (1024 minimum)
df -h / | awk 'NR==2{print $4" free"}' # 10G+ free
curl -sI https://api.mzpanel.com | head -1 # HTTP/2 200 (outbound HTTPS works)

Stop and fix before installing when: the OS is older (upgrade or reinstall), PID 1 is not systemd (on WSL: /etc/wsl.conf [boot] systemd=true, then wsl --shutdown), or there is no outbound HTTPS.

  1. The user creates an install command in the dashboard (Servers > Add server > Generate install command, no components) or you call install_tokens_list to see open ones. Install tokens are single use and expire in 1 hour.

  2. They run it with MZ_PROFILE=homelab:

    Terminal window
    curl -fsSL https://get.mzpanel.com | sudo INSTALL_TOKEN=<token> MZ_PROFILE=homelab bash

    The homelab profile never touches the firewall, sshd, timezone, fstab or /home, and provisions Docker + Nginx. On WSL or a desktop the installer refuses without the flag.

  3. Confirm: servers_list shows the box online with homelab: true. If it was installed without the profile, servers_update {id, body: {name, homelab: true}} sets the flag (no offline notifications, no instant URL); host hardening already applied is not undone.

Skip this when the user only wants LAN access (apps then answer http://<app>.home.arpa once they map that name to the box’s LAN IP).

  1. dns_connections_list → there must be a Cloudflare connection with the zone the user wants (for example example.com). None → the user connects one under Connect > DNS providers.
  2. The token needs Account → Cloudflare Tunnel: Edit (besides Zone → DNS: Edit). Tell the user to add it to the token in the Cloudflare dashboard (My Profile > API Tokens > edit); the token value does not change, so the connection needs no update.
  3. servers_tunnel_create {id, body: {zone: "example.com"}} → 202 {jobId, tunnel}. Errors: 403 cf_tunnel_scope (step 2 missing), 409 agent_update_required (run agent_update, needs 0.2.145+), 409 server_offline, 400 zone_required (pass zone).
  4. Poll servers_tunnel_get {id} every few seconds until tunnel.status is active and cfStatus is healthy (failed → read tunnel.error, then jobs_get {jobId}).

Use the normal deploy playbook with the box’s id:

  • domain omitted → url is https://<app>.<zone> and the hostname is routed through the tunnel automatically;
  • uploads through the tunnel are limited to 100 MB (maxBytes, note); for bigger projects deploy from Git;
  • apps_fleet_deploy only picks a homelab box when it has a tunnel; pin it with placement.serverId otherwise.

Extra names (a Docker stack, a site): servers_tunnel_route_add {id, body: {hostname, service: "https"}} for stacks (their vhost forces HTTPS), "http" for apps and sites.

  • Linux/Proxmox: start at boot, “restore on AC power loss”, a DHCP reservation.
  • Windows: the keepalive scheduled task, no sleep on AC, automatic sign-in if the PC must come back alone after Windows Update.
  • macOS: the VM starts at login, “prevent automatic sleeping”.

A homelab box going offline sends no notifications by design. Suggest an uptime monitor on the public URL (uptime_monitors_create) if the user wants to know when it is down.

  • Never ask for or handle the user’s Cloudflare token yourself; they edit it in Cloudflare.
  • servers_tunnel_delete and servers_tunnel_route_delete take the box’s public hostnames offline (scope data:delete): confirm with the user first.
  • Removing the server (servers_delete) also deletes its tunnel and the CNAMEs MZPanel made at Cloudflare; deleting an app (app.delete) drops that app’s tunnel routes. Records the user changed since are kept. To unpublish a box but keep managing it, use servers_tunnel_delete.
  • Install or remove the connector with servers_tunnel_create / servers_tunnel_delete, never jobs_create with tunnel.install / tunnel.uninstall (refused: service_only).