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

Related Articles

How to Restore Your cPanel Account: A Complete Guide for New System Administrators

This guide explains how new system administrators can restore a cPanel account using WHM, transfer accounts and configurations between servers, and enable diagnostic logging for transfer and restore operations. It covers essential concepts such as WHM vs. cPanel, root access, backup handling, SFTP uploads, transfer methods, and advanced debugging tools.

Continue

آموزش کامل انتقال تمام اکانت‌های cPanel از یک سرور به سرور دیگر

این مقاله نحوه انتقال همه اکانت‌های cPanel، تنظیمات سرویس‌ها، گواهی‌های SSL و IP اصلی سرور را از یک سرور قدیمی (Source) به یک سرور جدید (Target) توضیح می‌دهد. شامل نصب سرور جدید، انتقال تنظیمات، انتقال اکانت‌ها، تغییر IP، تنظیم DNS و نصب مجدد SSL است.

Continue

How to Migrate a WordPress® Installation to a cPanel & WHM Server

This guide explains how to migrate a WordPress installation from a macOS-hosted environment to a cPanel & WHM server. It covers exporting the database, uploading WordPress files, creating and importing a MySQL database, updating URLs, configuring wp-config.php, fixing broken links, and finalizing the migration.

Continue

How to Manually Transfer an Account Between Servers in cPanel & WHM

This article explains how to manually transfer a cPanel account between servers when the account is too large for WHM’s automated transfer tools. It covers creating temporary directories, compressing public_html and log files, securely transferring data with SCP, and restoring the files on the destination server.

Continue

How to Manually Migrate Horde Calendars and Contacts to Roundcube in cPanel & WHM

This article explains how to manually migrate Horde calendars and contacts to Roundcube in cPanel & WHM version 108 through 118. It covers exporting Horde data, placing it in the correct directories, and importing it into Roundcube using built‑in plugins or manual import tools.

Continue

How to Manually Migrate Accounts to cPanel & WHM from Unsupported Control Panels

This article explains how experienced system administrators can manually migrate accounts from unsupported third‑party control panels to cPanel & WHM. It covers pre‑migration steps, installation requirements, file and directory transfers, database restoration, SSL migration, and post‑migration tasks.

Continue