DocsServer templates

Server templates

Sell VPS images with Zopanel for Windows already installed: prepare a template server with zopanel-setup generalize, and every server made from it becomes a new installation at its first boot.

You can build a VPS image with Zopanel for Windows and the hosting software already installed, then create many servers from it. Each server made from the image becomes its own installation at its first boot. Status: experimental (from 0.9.220).

What each new server gets

At its first boot, every server made from the template gets:

  • a new Installation ID, so each server needs its own license and starts on the Free plan;
  • a new certificate for the panel, made for the server's own name and addresses;
  • new keys for the panel's stored secrets, a new recovery key and a new one-time setup code;
  • a new root password for MariaDB;
  • the right time: the clock is corrected if the image started with a wrong one (the timezone is not changed).

IIS, PHP, MariaDB, MailEnable, Microsoft DNS and their data stay as they were in the template, so the new server is ready in seconds instead of 10 to 30 minutes.

Prepare the template server

  1. Install Zopanel for Windows on a clean server, with the screens or from the command line, and let the recommended software finish (Servers → this server → Recommended set).
  2. Do not add customers, websites, databases or mail. A template must not carry anyone's data.
  3. Install only the recommended software. MySQL, PostgreSQL and MongoDB cannot be in a template yet.
  4. In PowerShell as Administrator, run:
& 'C:\Program Files\Zopanel\releases\0.9.220\zopanel-setup.exe' generalize -confirm $env:COMPUTERNAME

generalize refuses a server that has customers, websites (also deleted ones kept for restore), databases, mail, or MySQL, PostgreSQL or MongoDB. Otherwise it stops the Zopanel services, removes everything that identifies this installation, and sets up a one-time first-boot task.

  1. Shut the server down and capture the image with your VPS platform. Do not start the Zopanel services again before capturing.

You can also run Windows Sysprep after generalize if your platform needs it.

First boot of a new server

The task ZopanelFirstBoot runs at startup and logs to C:\ProgramData\Zopanel\first-boot.log. It takes about 15 seconds. Then the administrator is created in one of two ways:

  • The customer opens https://<server>:8443 and completes the setup wizard. The setup link is printed by zopanel-setup setup-link.
  • Or your provisioning script creates it, for example from cloudbase-init:
$exe = 'C:\Program Files\Zopanel\releases\0.9.220\zopanel-setup.exe'
while (Test-Path C:\ProgramData\Zopanel\generalized.json) { Start-Sleep 5 }
$data = 'name=' + [uri]::EscapeDataString($Name) + '&email=' + [uri]::EscapeDataString($Email) +
        '&password=' + [uri]::EscapeDataString($Password) + '&org=' + [uri]::EscapeDataString($Company) + '&lang=en&software=1'
& $exe first-run -data $data

The server then connects to its own panel. Install the customer's license on the License page with the server's new Installation ID.

Not supported

  • Cloning a server that already hosts customers. Move customers with site move instead.
  • MySQL, PostgreSQL or MongoDB in the template.

← Licensing Websites on IIS →