How to Back Up and Restore a Linux Server: 7 Methods (Step-by-Step)

Linux servers run critical applications, databases and websites, so a reliable backup is essential. This guide shows 7 ways to back up and restore a Linux server, from simple rsync and tar commands to snapshots, cloud backup and centralized backup software.

Free Download
for VM, OS, DB, File, NAS, etc.
dan-zeng

Updated by Darlene Yan on 2026/11/10

Table of contents
  • Linux Server Backup Methods Compared

  • Method 1: Back Up and Restore a Linux Server with rsync

  • Method 2: Back Up and Restore a Linux Server with tar

  • Method 3: Create a Full Disk Image with dd

  • Method 4: Back Up a Running Server with LVM Snapshots

  • Method 5: Back Up a Linux Server to the Cloud with rclone

  • Method 6: Roll Back System Changes with Timeshift

  • Method 7: Backup Linux Server Vinchin Backup & Recovery

  • Linux Server Backup Best Practices

  • Linux Server Backup FAQs

  • Wrap up

A Linux server can be lost to a failed disk, a bad update, a ransomware attack or a simple rm -rf in the wrong directory. Built-in tools such as rsync, tar and dd can protect it, and dedicated backup services add scheduling, versioning and central management on top. This guide explains how each method works, including how to restore from it, so you can pick the right one for your servers. If you only need specific folders, see how to back up Linux directories.

Quick answer: For a simple file-level backup, run rsync -aAXv to copy the server’s files to another disk or a remote server over SSH, and schedule it with cron. For a consistent backup of a running server, take an LVM snapshot first and back up the snapshot. For a complete disk image, use dd while the disk is offline. For production servers, use backup software that runs scheduled incremental backups and can restore the whole system to new hardware.

Linux Server Backup Methods Compared

MethodBackup typeServer can stay online?RestoreBest for
1. rsyncFiles, incrementalYesCopy files backDaily file and config backups to another server
2. tarCompressed archiveYes (files may change during backup)Extract the archivePortable archives of folders or the whole system
3. ddFull disk imageNo (disk should be offline)Write the image backExact clones before risky changes
4. LVM snapshotPoint-in-time copyYesMerge or copy backConsistent backups of busy servers
5. rcloneFiles to cloud/S3YesCopy back from cloudOffsite and disaster recovery copies
6. TimeshiftSystem snapshotsYesRoll back the systemUndoing failed updates on Ubuntu/Debian systems
7. Backup softwareFull system, incrementalYesFull system or filesMany servers, central management, bare-metal recovery

Method 1: Back Up and Restore a Linux Server with rsync

rsync copies files to another disk or server and, after the first run, transfers only what has changed. It works over SSH, so it can also replace scp for remote copies.

Back up the whole system to a remote server:

sudo rsync -aAXHv --delete \
  --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} \
  / user@backup-server:/backup/server01/
  • -a keeps permissions, owners, timestamps and symlinks.

  • -A and -X keep ACLs and extended attributes, and -H keeps hard links.

  • --delete removes files from the backup that no longer exist on the server, so the backup mirrors the current state.

To keep older versions instead of only the latest copy, write each run to a new dated folder with --link-dest pointing to the previous one. Unchanged files are then stored only once.

Back up only specific folders:

sudo rsync -aAXv /etc /var/www /home user@backup-server:/backup/server01/

Schedule the backup by adding a line to /etc/crontab, here every day at 2:00 AM:

0 2 * * * root rsync -aAXH --delete --exclude=
{"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} 
/ user@backup-server:/backup/server01/ >> /var/log/rsync-backup.log 2>&1

Set up SSH key login to the backup server first, so cron can connect without a password.

Restore:

To restore a folder, copy it back from the backup server:

sudo rsync -aAXv user@backup-server:/backup/server01/etc/nginx/ /etc/nginx/

To restore the whole system, boot the server from a Linux live USB, create and mount the root file system at /mnt/restore, and copy everything back:

sudo rsync -aAXHv user@backup-server:/backup/server01/ /mnt/restore/

If you restored to a new disk, update /etc/fstab with the new disk UUIDs and reinstall the bootloader from a chroot before rebooting.

Method 2: Back Up and Restore a Linux Server with tar

tar packs files and folders into a single archive, which you can compress and copy anywhere.

Back up a folder:

sudo tar -czpf /backup/etc-$(date +%F).tar.gz /etc

Back up the whole system:

sudo tar -czpf /backup/system-$(date +%F).tar.gz --acls --xattrs --one-file-system \
  --exclude=/backup --exclude=/proc --exclude=/sys --exclude=/dev \
  --exclude=/run --exclude=/tmp --exclude=/mnt --exclude=/media /
  • -c creates an archive, -z compresses it with gzip, -p keeps permissions, and -f names the archive file. -f must come last, right before the file name.

  • --one-file-system stays on the root file system, so add separate archives for other mounted partitions such as /home if needed.

  • Files that change while tar is running may be inconsistent, so stop busy services or use an LVM snapshot (Method 4) for databases.

Check what’s inside an archive:

tar -tzf /backup/etc-2026-11-10.tar.gz

Restore:

Extract a single file, using the path shown by tar -t, without the leading /:

sudo tar -xzpf /backup/etc-2026-11-10.tar.gz -C / etc/nginx/nginx.conf

Restore the whole system from a live USB, after mounting the new root file system at /mnt/restore:

sudo tar -xzpf /backup/system-2026-11-10.tar.gz --acls --xattrs -C /mnt/restore

Method 3: Create a Full Disk Image with dd

dd copies a disk or partition block by block, including the partition table and bootloader, so you get an exact clone.

Before you start: the disk should not be in use. Boot the server from a live USB, or at least make sure the partition is unmounted. Imaging a mounted, running system disk can produce an unusable copy. Double-check the device names with lsblk, because writing to the wrong disk destroys its data.

Back up the disk to a compressed image file:

sudo dd if=/dev/sda bs=4M status=progress | gzip > /backup/sda-$(date +%F).img.gz

Restore the image to a disk of the same size or larger:

gunzip -c /backup/sda-2026-11-10.img.gz | sudo dd of=/dev/sda bs=4M status=progress

dd copies every block, including empty space, so images are large and slow to create. Use it for occasional full clones, not daily backups.

Method 4: Back Up a Running Server with LVM Snapshots

If your server uses LVM, a snapshot freezes the state of a logical volume in a moment, so you can back up consistent data while applications keep running.

1. Check the volume group has free space for the snapshot:

sudo vgs
sudo lvs

2. Create the snapshot. Its size only needs to hold the changes made while the backup runs:

sudo lvcreate -L 5G -s -n root_snap /dev/vg0/lv_root

3. Mount it read-only and back it up:

sudo mkdir -p /mnt/snapshot
sudo mount -o ro /dev/vg0/root_snap /mnt/snapshot
sudo rsync -aAXHv /mnt/snapshot/ user@backup-server:/backup/server01/

For XFS file systems, add -o ro,nouuid to the mount command.

4. Remove the snapshot as soon as the backup finishes, because it slows down writes while it exists:

sudo umount /mnt/snapshot
sudo lvremove -y /dev/vg0/root_snap

Restore: copy files back from the backup server as in Method 1. To roll a volume back to the snapshot itself, for example after a failed update, merge it instead of removing it with sudo lvconvert --merge /dev/vg0/root_snap, then reboot. The merge completes when the volume is next activated.

Method 5: Back Up a Linux Server to the Cloud with rclone

rclone copies files to more than 70 cloud storage services, including Amazon S3, Azure Blob, Google Cloud Storage and S3-compatible storage, which gives you an offsite copy for disaster recovery.

1. Install rclone:

sudo apt install rclone -y      # Debian/Ubuntu
sudo dnf install rclone -y      # RHEL/Rocky/Fedora (EPEL may be required)

2. Configure the cloud storage by running rclone config and following the prompts to create a remote, for example one named s3backup. To encrypt backups before they leave the server, create a second remote of type crypt (for example secret) that points to a folder on s3backup.

3. Run the backup:

rclone copy /data secret:server01 --progress

rclone copy only adds and updates files. rclone sync also deletes files from the cloud that no longer exist locally, so with sync, add --backup-dir secret:server01-old to keep deleted and changed files instead of losing them.

4. Schedule it with cron, for example daily at 3:00 AM:

0 3 * * * rclone copy /data secret:server01 --log-file /var/log/rclone.log

Restore:

rclone copy secret:server01 /data --progress

Method 6: Roll Back System Changes with Timeshift

Timeshift takes snapshots of system files, so you can roll back after a failed update or configuration change. By default it excludes user data in /home, so use it together with a data backup method, not instead of one.

Install Timeshift:

sudo apt install timeshift      # Ubuntu/Debian
sudo dnf install timeshift      # Fedora/RHEL (EPEL)

On servers without a desktop, use the command line:

sudo timeshift --create --comments "Before kernel update"
sudo timeshift --list

Timeshift uses rsync snapshots on ext4 and native snapshots on Btrfs. To schedule snapshots, set the levels (for example daily and weekly) in /etc/timeshift/timeshift.json.

Restore a snapshot by its name from the list:

sudo timeshift --restore --snapshot '2026-11-10_02-00-01'

Timeshift then prompts you to choose the target device and whether to reinstall the bootloader, and reboots into the restored system.

Method 7: Backup Linux Server Vinchin Backup & Recovery

Vinchin Backup & Recovery is a professional backup software compatible with 19+ virtualization platforms (such as VMware, Hyper-V, Proxmox and Oracle OLVM), mainstream databases, NAS, Windows/Linux servers, and Kubernetes container. It provides speedy and effective backup and worry-free recovery options as follows with an extremely affordable and flexible pricing model.

It supports mainstream Linux distributions such as Ubuntu, Debian, RHEL, CentOS, Rocky Linux and SUSE, with features including:

  • Automated backup scheduling
    Fully automate backup tasks with flexible scheduling options and email notifications for abnormal events or job failures.

  • Multiple backup strategies
    Support various backup modes, including Full, Differential, Incremental, and Forever Incremental backups to meet different data protection needs.

  • Intelligent optimization techniques
    Improve storage efficiency with data deduplication and compression, significantly reducing backup size, while ensuring secure data transfer via SSL encryption.

  • Fast and secure server recovery
    Enable rapid Linux server recovery using multi-threaded transfer technology and encrypted transmission for enhanced security and performance.

  • Built-in anti-ransomware protection
    Protect backup data stored on the backup server from unauthorized access, modification, and potential ransomware attacks.

  • Offsite backup replication
    Create and maintain offsite backup copies in remote locations to ensure business continuity and disaster recovery readiness. 

With an intuitive web interface, it's simpler than ever to backup a Linux Server: 

  1.  Go to Physical Backup > Server Backup > Backup and select a licensed Linux host.

Select the source Linux server

2. Choose a target node and storage from the drop-down.

Select backup storage

3. Configure backup strategies like schedules, backup types, data reduction and retention policies, encrypted transmission, and more.

Select backup strategies

4. Review and hit Submit. The job will run on schedule.

Submit the job

How to restore Linux Servers With Vinchin?

1. Go to Physical Backup>Server Backup>restore, and select the Linux host you backed up just now from the expanded list.

2. Then, select the target host as the restore destination and set the volumes as well.

3. Configure the restore strategy; either to run the task immediately or schedule it (daily/weekly/monthly).

4. Finally, name the job, check all the details, and click Submit to initiate the recovery task.

To restore a failed server onto new hardware, see Linux bare metal backup and recovery.

Care for a test? Download the 60-day full-featured free trial of the new release Vinchin Backup & Recovery now to backup your Linux data.

Linux Server Backup Best Practices

1. Follow the 3-2-1 rule. Keep 3 copies of your data, on 2 different types of storage, with 1 copy offsite or in the cloud.

2. Back up running servers consistently. Use LVM snapshots or application-aware backup, and use database tools such as mysqldump or pg_dump for databases, rather than copying live database files.

3. Automate and monitor. Schedule backups with cron or backup software, log every run, and alert on failures.

4. Keep multiple versions. Retain daily, weekly and monthly restore points, so you can go back to before a problem started.

5. Encrypt and protect backups. Encrypt offsite copies, and keep at least one copy that ransomware on the server can’t delete.

6. Don’t forget configuration. Include /etc, crontabs, SSL certificates and a list of installed packages (dpkg --get-selections or rpm -qa).

Test restores regularly. Restore files and, at least occasionally, a whole server to confirm your backups work.

Linux Server Backup FAQs

1. Can you backup running Linux server without downtime?

Yes. With Vinchin Backup & Recovery, you just need to create the backup jobs and then your Linux servers will be backed up no matter they are running or powered off.

2. Can you backup a Linux server remotely?

Yes. Vinchin Backup & Recovery supports backing up Linux servers in both local and branch offices via a centralized console.

3. How can you backup a virtual machine on Linux?

For the native KVM virtual machines, you can use their commands to backup them; for enterprise KVM virtual machines like OLVM, oVirt, Proxmox, RHV, etc., you can use Vinchin Backup & Recovery to perform agentless backup to easily backup them.

4. Which directories should I exclude from a full Linux backup?

Exclude virtual and temporary file systems that Linux recreates at boot: /dev, /proc, /sys, /run and /tmp, plus mount points such as /mnt and /media, and the backup destination itself.

5. What’s the difference between a snapshot and a backup?

A snapshot captures the state of a volume at one moment and usually stays on the same storage, so it is fast but disappears if that storage fails. A backup is a separate copy on different storage. Use snapshots for quick rollback, and real backups for recovery after disk failure or ransomware.

6. How often should I back up a Linux server?

It depends on how much data you can afford to lose. A common schedule is daily incremental backups with weekly full backups, and more frequent backups or replication for critical databases.

Wrap up

You can back up and restore a Linux server with built-in tools: rsync for daily file backups, tar for portable archives, dd for full disk images, LVM snapshots for consistent backups of running servers, rclone for offsite cloud copies, and Timeshift for rolling back system changes. Combine them according to the 3-2-1 rule, and test your restores.

When you manage many servers, scripts become hard to maintain. Vinchin Backup & Recovery adds scheduled full and incremental backups, central management and fast system recovery. Try it free for 60 days. For more tools, see our list of the best Linux backup software.

Share on:

Categories: Linux Backup