Best Practices for cPanel Virtualization Templates

This article explains the recommended best practices for creating cPanel & WHM virtualization templates for VPS and VM environments. It covers minimal installation guidelines, pre‑installation configuration files, snapshot preparation, preventing license locks, template deployment, updating templates, and resolving common issues in OpenVZ and Virtuozzo environments.

cPanel virtualization templates VPS templatebest practicessnapshot_prep cPanel

~3 min read • Updated Feb 18, 2026

1. Overview


While the standard cPanel & WHM installation process is recommended and supported, it may take longer than necessary for VPS and VM hosting environments. To speed up provisioning, you can deploy pre‑built cPanel & WHM templates.


Note: If you offer cPanel templates commercially, becoming a cPanel Partner is recommended.


  • Partners can automatically provision cPanel, CloudLinux™, and KernelCare licenses via API.
  • Partners can enable or disable specific WHM options.

2. Create a Minimal Installation for Templating


  • Use only 64‑bit operating systems (cPanel does not support 32‑bit).
  • Keep templates small — virtual disks of 20 GB or more.
  • After deployment, expand the disk using your virtualization platform.

3. Pre‑Installation Configuration Files


Preconfiguring these files reduces the need to log in before handing the VPS to the customer.


3.1 Update Configuration — /etc/cpupdate.conf


Controls release tiers and update preferences. These settings appear in WHM’s Update Preferences interface.


3.2 Update Source Settings — /etc/cpsources.conf


Defines where the server downloads updates from.


Example for Partners using FastUpdate:


HTTPUPDATE=fastupdate.example.com

3.3 Basic Server Settings — /etc/wwwacct.conf


Contains IP address, nameservers, and home directory settings.


3.4 cPanel Configuration — /var/cpanel/cpanel.config


Includes most WHM Tweak Settings and other internal configuration options.


4. Install cPanel & WHM


After preconfiguring the system, install cPanel & WHM using the official Installation Guide.


5. Post‑Installation Tasks


Before creating the template image:


  • Apply new default settings.
  • Secure SSH.
  • Update security configurations.

Do not shut down the VM before completing these steps.


6. Prevent Locked Licenses


To avoid license locking, create templates on an unlicensed IP address.


Run the snapshot preparation script:


/usr/local/cpanel/scripts/snapshot_prep --yes

Verify:


  • No failed tasks
  • Final line: System is ready for snapshotting.

If you must use a licensed IP, maintain one VM per template to avoid license conflicts.


7. Remove Copied Files


The snapshot_prep script stores backup copies of configuration files. Remove them before creating the template:


/usr/local/cpanel/scripts/snapshot_prep --delete-saved-copies

Successful output:


Deleted saved copies of configuration files.

8. Template Requirements


Your templates must meet — and preferably exceed — cPanel’s system requirements.


Note: Each VPS or VM must include a swap file or partition (minimum 256 MB).


9. Deployment Tasks


When deploying a customer VPS, additional system files must be updated automatically.


If using libguestfs virt-sysprep, use:


--firstboot or --firstboot-command

Warning: Ensure that user accounts or cron jobs are not removed accidentally.


If not using libguestfs, consult your hypervisor’s documentation for first‑boot scripting.


10. Updating Templates Over Time


Regular updates are essential. To update a template:


yum update -y
/scripts/upcp

Before shutting down the VM to rebuild the template, rerun the snapshot_prep script.


11. Common OpenVZ and Virtuozzo Issues


11.1 Hostname Problems


Virtuozzo manages hostnames via VPS configuration. Ensure the hostname is a valid FQDN — cPanel requires this.


11.2 Quota Issues


OpenVZ and Virtuozzo require second‑level quotas, which may cause initialization issues.


11.3 Jailshell Issues


Jailshell requires a full /proc mount. Follow the troubleshooting guide for Virtuozzo/OpenVZ environments.


Conclusion


By following these best practices, you can build fast, secure, and reliable cPanel & WHM templates for VPS and VM deployments. Proper preparation ensures smooth provisioning, avoids license conflicts, and maintains long‑term stability.


Written & researched by Dr. Shahin Siami