/etc), your data (/home, /var/www, /srv, /root) and a fresh database dump to storage that is not on the same server. Use rsync for a plain copy to another server, restic for encrypted versioned backups, or rclone for cloud storage. Run it daily from cron and test a restore.
Before you start
- Connect with SSH as a user with
sudo. Root users can leave outsudo. - Decide where backups go: another server, object storage (S3-compatible), or your own computer. A backup that lives only on the same disk disappears with that disk.
- On a VPS, you can also take full-disk backups in the panel. See VPS Panel backups. File-level backups below are a second, independent copy you control.
What should I back up on a Linux server?
You do not need
/proc, /sys, /dev, /run, /tmp or package caches. They are created at boot or can be downloaded again.
What is the 3-2-1 backup rule?
Keep 3 copies of your data, on 2 different types of storage, with 1 copy off-site. For a server that usually means: the live data, a panel or snapshot backup, and an off-server copy (another server or cloud storage) that the server itself cannot delete.Which backup tool should I use?
If you are unsure, start with restic: it encrypts, keeps old versions and only uploads changes.
How to make a simple backup with tar
This makes one compressed archive. It is a good first step, but copy the file off the server afterwards.1
Create a backup folder
2
Dump your databases
For MariaDB or MySQL:
sudo tee writes the file as root, because /backup belongs to root. See back up MySQL databases for details and PostgreSQL.3
Save the package list and crontab
4
Create the archive
-p keeps file permissions. $(date +%F) adds today’s date, for example server-2026-11-04.tar.gz. tar prints Removing leading '/' from member names; this is normal.5
Protect the archive
The archive holds passwords and keys from
/etc and your database. Make it readable only by your user, so you can download it:6
Copy it off the server
How to run backups automatically
Put your backup commands in a script, for example/usr/local/bin/backup.sh, make it executable with sudo chmod 700 /usr/local/bin/backup.sh, then add it to root’s crontab with sudo crontab -e:
How to check your backups work
A backup you have never restored is a guess. Once a month:- Restore one folder to a temporary location, for example
/tmp/restore-test. - Open a few files and compare them with the live ones.
- Import a database dump into a test database.
- Check the backup log for errors and the date of the last successful run.
Frequently asked questions
How often should I back up my server?
Back up at least daily for anything that changes, such as websites, databases and game worlds. Configuration can be backed up less often, but backing it up with the rest costs very little.Are VPS panel backups enough?
They are a useful full-disk copy, but they are one copy in one place. Keep at least one more copy that you control, off the server. See VPS Panel backups for what the panel backs up.Can I back up a running database by copying its files?
Not safely. Files copied while the database is writing can be inconsistent. Usemysqldump/mariadb-dump or pg_dump, then back up the dump file.
Is RAID a backup?
No. RAID keeps a server running when a disk fails, but it copies deletions and corruption to every disk instantly. See software RAID with mdadm.How do I back up a Windows server?
Use Windows Server Backup or a third-party tool. See back up a Windows server.Related guides
VPS and dedicated server guides
Every guide in this section.
Encrypted backups with restic
Versioned, encrypted, deduplicated.
Back up with rsync
Copy to another server over SSH.
Back up to cloud storage
S3, Google Drive and more with rclone.
Back up MySQL databases
Dump and restore your databases.
VPS Panel backups
Full-disk backups and restores.
Checked against the official Ubuntu Server backup documentation on 4 November 2026;
tar, dpkg --get-selections and the folder list tested on Ubuntu 24.04 LTS. Commands can differ on other distributions or releases.Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026