Create a Debian 8 Template

Create a VPS using the ISO template option. We recommend 5 GB disk size. This should be the minimim size of a VPS you wish to offer and it should be large enough to accommodate a minimal installation of Debian.

On the server this VPS has been created, you need to download the ISO to the /virt/iso/ folder.

mkdir -p /virt/iso && cd /virt/iso && wget http://cdimage.debian.org/debian-cd/8.3.0/amd64/iso-cd/debian-8.3.0-amd64-netinst.iso


Configure the VPS ISO as "debian-8.3.0-amd64-netinst.iso" and then start the VPS. It should boot to ISO.

 

Connect to VNC and proceed with the VPS installation. When you get to the network configuration you will need to setup static configuration. VirtPanel uses routes to pass the traffic to the VPS so the gateway and netmask your web hosting provider gave to you will not work. The gateway needs to be the node's IP and the netmask should allow communication to this gateway. For example, 255.255.255.0 is usually fine. Try 255.0.0.0 0.0.0.0 if that doesn't work. This is just a temporary solution to get the installation files.

 


If you installed the minimal verison of Debian you may need to install the SSH server through VNC.

apt-get install openssh-server


Allow root login with a password through SSH.

sed -i "s/PermitRootLogin .*/PermitRootLogin yes/g" /etc/ssh/sshd_config


Reduce LoginGraceTime

sed -i "s/LoginGraceTime .*/LoginGraceTime 30/g" /etc/ssh/sshd_config


Install the virtpanel service which configures VPS networking, resolvers, hostname and root password when the VPS is started.

wget -O /etc/init.d/virtpanel https://site.virtpanel.com/files/debian8init && chmod +x /etc/init.d/virtpanel && systemctl enable virtpanel

Reboot the VPS, you should now be able to login with the control panel password.

 

Cleanup temp files

apt-get clean

 


Zero free space to reduce the size of the template file.

dd if=/dev/zero of=/zerodisk bs=10M;rm -f /zerodisk


To finish you should delete the host SSH keys so they are regenerated at first boot.

/bin/rm -v /etc/ssh/ssh_host_*


Shutdown cleanly.

shutdown -h now


After the VPS has cleanly shutdown you can now create a template from within VirtPanel.




Next: Common Errors
Previous: VPS Templates » Create a Windows Server 2008 Template

Testimonials