How to Backup Linux VPS: Step-by-Step Guide

Learn a complete, step-by-step guide on how to back up your Linux VPS in this article. Protect your data and ensure continuous access to important information using reliable methods and useful tools.
3 min read
Beginner
Backup Linux VPS

Backup your Linux VPS (Virtual Private Server) is crucial to ensure the security of your data and the continuity of your services. Whether you manage a website, an application or important business data, a reliable backup strategy can save you from potential disasters such as data loss, server failure or cyber-attacks.

In this comprehensive guide, we explain the best methods for backing up your Linux VPS to ensure your data is safe and easily recoverable.

Linux VPS Backup Methods

Manual backup using rsync

rsync is mainly used to transfer and synchronize files between local directories or remote servers. One of the biggest advantages of rsync is that it only copies changed or new files. This saves considerable time and bandwidth, especially when frequent backups are required.

1. If rsync is not already installed, run this command to install it:

If you are using Ubuntu or Debian:

BASH
sudo apt-get install rsync

If you are using CentOS or RHEL:

BASH
sudo yum install rsync

2. Run rsync command:

BASH
rsync -avz /path/to/source /path/to/destination

3. Cron jobs can be used to automate your backups by running commands at scheduled times.

BASH
crontab -e

Add the following line to run daily at 00:00 AM:

BASH
0 0 * * * rsync -avz /path/to/source /path/to/destination

Backup using tar

This tool archives files and directories in a compressed archive (usually in .tar.gz format). Tar is ideal for creating local backups or sending a compressed package to another server. It allows you to collect and compress all the data you want in a single file, which is ideal for long-term storage or one-time data transfer.

BASH
tar -cvpzf /path/to/backup.tar.gz /path/to/directory

Database backup

To back up MySQL or PostgreSQL databases, use the following commands:

MySQL backup:

BASH
mysqldump -u username -p database_name > backup.sql

PostgreSQL Backup:

BASH
pg_dump -U username -d database_name -f backup.sql

Secure Your Backup Files

To increase data security, you should store your backups in a secure location such as an external hard disc or cloud storage. Consider using backup software such as Bacula, Timeshift and Cloudberry to take advantage of advanced features such as scheduling, incremental backups and remote storage. To further protect your data, encrypt your backups and keep multiple copies in different locations.

Important Tips for Backup a Linux VPS:

  • Schedule regular backups (daily, weekly, or monthly).
  • Store multiple copies of backups in secure locations like external drives or the cloud.
  • Regularly verify that backups can be restored.
  • Encrypt your backups using tools like GPG to enhance security.

Conclusion

Secure your data by regularly backing up your Linux VPS. Using methods such as rsync and tar can significantly increase the security of your data. We will discuss other backup strategies including automated tools, WHM/cPanel and cloud storage, in future articles.

Share:

Related Posts

You May Also Like

Explore more tutorials, guides, or documentations, from VPSMakers.

Learn how to check open ports in Linux using netstat, ss, lsof, Nmap, and Netcat with practical commands and examples.
Richard Mourar
October 12, 2026
The combination of WordPress and cPanel builds a robust system for website management. Go to cPanel and log into your cPanel account. Click WordPress Toolkit.
Richard Mourar
October 10, 2026
Learn to enable and disable automatic package updates on Ubuntu, and CentOS, including service restarts with needrestart and dnf post transaction.
Jacob Rafet
October 8, 2026
Install Docker on CentOS Stream 9 via rpm repo, RPM package, or shell script. include verify the docker installation with running a test image.
Robert Smith
October 5, 2026