How to Clone Ubuntu Server with Clonezilla
Clone an Ubuntu Server disk with Clonezilla: disk to disk or to an image file, the screens in order, and what to change on the copy before both machines run.
3 min readBy Daniel
Reviewed by the AmazingRDP technical team

Moving to bigger hardware? See our dedicated servers. See Cheap Dedicated Servers from $38.99
Clonezilla copies a whole disk: partitions, boot loader, system and data. You use it to move Ubuntu Server to a new disk, to keep a full backup, or to set up several identical machines. It runs from a USB stick, so the system being copied is not running, and the copy is consistent.
What you need
- A USB stick of 1 GB or more, and the Clonezilla Live image from clonezilla.org. The "stable" version is based on Debian; the "alternative" version is based on Ubuntu and helps with very new hardware.
- For a disk-to-disk copy: a target disk at least as large as the source.
- For an image: somewhere to store it, such as an external drive or a network share.
- Physical access to the machine, or a remote console that can start it from an ISO file.
Everything on the target disk is erased. Know which disk is which before you start: note the sizes and model names with lsblk -o NAME,SIZE,MODEL while Ubuntu is still running.
1. Make the USB stick and start from it
Write the image to the stick with Rufus, balenaEtcher or dd. Shut the server down properly, plug in the stick, and choose it in the boot menu (often F11, F12 or Esc at power-on).
2. First screens
- Choose Clonezilla live with the default settings.
- Pick the language and keep the default keyboard layout unless you need another.
- Choose Start Clonezilla.
3. Choose the mode
| Mode | Use it to |
|---|---|
| device-device | Copy one disk straight to another disk in the same machine |
| device-image | Save the disk as a compressed image, to restore later or on other machines |
4a. Disk to disk
- Choose device-device, then Beginner mode.
- Choose disk_to_local_disk.
- Select the source disk, then the target disk. Check sizes and models against your notes.
- Keep the default for checking the source file system, unless you want the extra check.
- Clonezilla asks twice whether you are sure. Read the disk names once more, then answer
y.
4b. Disk to image
- Choose device-image.
- Tell Clonezilla where the image goes: local_dev for an external drive (plug it in now), or ssh_server, samba_server or nfs_server for a network location.
- Choose Beginner, then savedisk, give the image a name and select the source disk.
- Keep the default compression. Say yes to checking the saved image; it costs time once and saves you from a backup that cannot be restored.
To restore, start Clonezilla again, choose device-image, the same storage location, and restoredisk.
5. First start of the copy
When Clonezilla has finished, choose poweroff, remove the stick, and for a disk-to-disk copy disconnect the old disk before the first start, so that you know the machine is running from the new one.
6. If the copy will run next to the original
A clone is identical down to its identity. Two machines with the same identity on one network cause odd faults, so change these on the copy:
sudo hostnamectl set-hostname new-name
sudo rm /etc/machine-id
sudo systemd-machine-id-setup
sudo rm /etc/ssh/ssh_host_*
sudo dpkg-reconfigure openssh-server
These lines set a new host name, a new machine ID (routers hand out addresses by it) and new SSH host keys. Also check /etc/netplan/: a fixed IP address there must be changed, and a network card named by its hardware address will not come up on different hardware until you correct it.
Common questions during cloning
- The target is larger. The extra space stays unused. Grow the partition afterwards, for example with
sudo growpart /dev/sda 2andsudo resize2fs /dev/sda2, or the matching LVM commands. - The target is smaller. Clonezilla refuses by default. Shrink the partitions on the source first so that they fit, then use Expert mode with the option to skip the size check.
- The copy does not start. On UEFI machines the firmware may still point to the old disk. Pick the new disk in the boot menu once, or reinstall the boot loader.
On a VPS
A VPS usually cannot start from your USB stick. Use the provider's snapshot or backup function, which does the same job from outside the machine. On a dedicated server, a remote console with ISO mounting lets you run Clonezilla as described. Related guides: why Ubuntu freezes and how to fix it and copy and paste in Ubuntu Server.
Questions
Can Clonezilla clone a running Ubuntu Server?
No. Clonezilla starts from its own USB stick, so the server is offline during the copy.
Can I clone a larger disk to a smaller one?
Only if the partitions are first shrunk to fit and the size check is skipped in Expert mode.
What must I change on a cloned server?
The host name, the machine ID, the SSH host keys and any fixed IP address, if the copy will run alongside the original.
Is Clonezilla free?
Yes. It is free, open-source software.