How to Guide – Setup Custom Image on your VPS

Contents

    This article assumes you are already logged into your VPS/Dedicated Server. Don’t have an account with us, feel free to sign up over at our Portal. Once registered check out our selection of VPS and Dedicated Servers.
    Already have one? Then feel free to proceed to follow the how-to guide below.

    Important – this is destructive and irreversible. Writing your image overwrites the entire disk, wiping the template OS and all data on it. Back up anything you need first. Once written, the only way back to a working template is a fresh OS reload from your control panel. Do not run this on a server holding data you care about, spin up a fresh VPS for it instead.

    Before You Begin – Use the Console, Not SSH

    Because this process overwrites the running operating system, your SSH connection will drop the instant the disk is rewritten. If the write has not finished by then, you are left with an unbootable server. For this reason we strongly recommend running the whole procedure from the noVNC / HTML5 console in your Packetra client area rather than over SSH. From the console you can watch the write finish and the reboot happen, with no session to drop mid-way.

    You will find the console under your service in the client portal. Log into your server there as cloudvpsXXX/root before continuing.

    What Kind of Image Can I Use?

    This method writes a whole-disk, BIOS-bootable image onto the disk, so the file you write must be a full disk image, not just any download. Good candidates are prebuilt cloud images (Debian, Ubuntu, Alpine and similar), a vendor appliance image, or an image you built yourself. The file is usually a .img or .raw, sometimes compressed as .gz, .xz or .zip, which you extract first.

    Two things to know before you start:

    • The image must already be set up to let you in — a known password, an injected SSH key, or a cloud-init datasource. There is no rescue shell once your image is on disk, so if you cannot log in, your only option is to reload the template from the panel and try again.
    • This is for disk images, not interactive install ISOs. If you specifically want to run an OS installer, write a network boot loader such as netboot.xyz instead, which gives you an installer menu on the console. That is a separate workflow and generally wants a second disk to install onto.

    Select your Linux OS to Prepare the Tools

    First, install the tools we need, wget to download the image and the extractors for the common compressed formats. Select the tab matching the OS your VPS is currently running.

    • Ubuntu
    • Debian
    • AlmaLinux

    # Update the system and install the download and extract tools
    apt update
    apt install -y wget unzip xz-utils gzip

    # Update the system and install the download and extract tools
    apt update
    apt install -y wget unzip xz-utils gzip

    # Update the system and install the download and extract tools
    dnf install -y wget unzip xz gzip

    Download & Extract Your Image into RAM

    We download the image into /dev/shm, which is a RAM-backed folder. This matters because we are about to overwrite the disk, the source image needs to live somewhere that isn’t the disk we are wiping. Keeping it in RAM means the write can read the image cleanly right up to the end. Replace the URL with the image you want to run.

    cd /dev/shm
    wget https://your-image-source/os-image.img.gz -O image.gz
    
    # Extract with the tool that matches your file's format:
    gunzip image.gz        # .gz
    # unzip image.zip      # .zip
    # xz -d image.xz       # .xz

    Match the extractor to the archive format. A .zip needs unzip, a .gz needs gunzip, a .xz needs xz -d. Using the wrong tool leaves you with an unextracted file, and if you then write that to disk the server will not boot. If your image is already an uncompressed .img or .raw, skip the extract step entirely.

    Verify the Image Before Writing

    This one check saves the most common failure. Confirm the extracted file is a real disk image and note its exact name.

    ls -la
    file image.img

    The file command must report something like DOS/MBR boot sector or data. If it says Zip archive, gzip compressed or XZ compressed, the extract did not happen, go back and run the right extractor. Do not proceed until this reports a boot sector.

    Identify Your Target Disk

    Next, find the disk your server boots from, this is the device we write your image onto. It is usually vda or sda, but you must confirm rather than assume, as writing to the wrong device will fail.

    lsblk

    Example: a line reading sda   25G disk with a partition sda1 mounted at / tells you the boot disk is /dev/sda. Use the whole disk (sda), not the partition (sda1). Note the name for the next step.

    Booting mode: All Packetra VPS boot in BIOS (SeaBIOS) mode, so a legacy BIOS image works out of the box, there is no action needed. If your image is UEFI-only it will write fine but fail to boot, because the disk here has no EFI firmware to load it. Stick to images that support BIOS/legacy boot.

    Write the Image and Reboot Into It

    Now write the image to the disk. Replace image.img with the exact filename from the verify step, and /dev/sda with the disk you confirmed with lsblk. The sync flushes the write, then echo b forces an immediate reboot into your new image.

    dd if=/dev/shm/image.img of=/dev/sda bs=4M conv=notrunc oflag=direct
    sync
    echo b > /proc/sysrq-trigger

    The console will freeze briefly, then you will see the server reboot. SeaBIOS loads, and within a few seconds your image starts. Watch the console for the boot messages and a login prompt.

    First Boot, Login & Networking

    Log in with whatever credentials your image ships with, its default account, a password you set, or the SSH key you injected. If it is a cloud image relying on cloud-init, log in through the method your image expects.

    Your image comes up with its own network configuration, which is often DHCP or cloud-init. If it does not get online automatically, set the networking manually. Everything you need — your IP address, gateway, netmask/prefix and usable DNS — is listed on your VPS’s page in the client area. Apply those values using whatever the OS you installed uses (for example netplan, systemd-networkd, or /etc/network/interfaces on Debian-based systems).

    Once networking is up, confirm it before you rely on it:

    ip address show
    ping -c 3 YOUR_GATEWAY
    ping -c 3 1.1.1.1

    If both pings reply, your server is online and reachable, and you can connect over SSH as normal.

    Final Words

    You now run your own image on your Packetra VPS, installed directly from the running server with no special tooling and no ISO mounting required. This suits anyone who would rather bring their own OS, bootloader and network setup than use a prebuilt template. If you ever want to go back, reload the OS from your control panel and you are on a clean template again, we do not lock you into ours.

    Frequently Asked Questions

    Your panel doesn’t let me upload an ISO. Is this the only way?
    Our module does not do client-side ISO uploads or mounting, so writing a whole-disk image from inside the running VPS is the way to bring your own OS. If you specifically want an interactive installer, write a network boot loader like netboot.xyz to the disk instead, which gives you an installer menu on the console.

    The server does not boot after the reboot. What happened?
    Almost always the file written was not a whole-disk BIOS-bootable image, or the extract did not finish before writing. Reload the OS from the panel, then repeat the steps making sure the file command reports a boot sector before you run dd, and that your image supports BIOS/legacy boot.

    It boots but I cannot log in.
    There is no rescue shell once your image is on disk, so the image has to be prepared to let you in beforehand, with a set password, an SSH key, or a cloud-init datasource. If you are locked out, reload the template from the panel and rebuild the image with valid credentials first.

    Can I go back to your template?
    Yes. Reload the OS from the control panel, which wipes your image and restores a clean Packetra template.

    Good to Know

    Always run this from the noVNC console rather than SSH, and always verify the extracted image with the file command before writing. Those two habits prevent most failed installs. Keep the image in /dev/shm so the write can read it cleanly while overwriting the disk, but note that /dev/shm is limited by your RAM, so a very large image may not fit on a small VPS. Make sure the image already has a working login before you write it. Your network details are on your VPS’s page in the client area. A cloud image smaller than your disk will only use part of it until you grow the partition, though most cloud images do this automatically on first boot. Want to revert? Reload the OS from your control panel for a clean template. Run into any issues? Open a support ticket through the client portal and our team will help you.

    Updated on September 22, 2026
    Was this article helpful?