Backing up your server data
You need to back up your server's data yourself. If you accidentally delete files, change a setting the wrong way, or the server is deleted because it expired, it can't be undone, so regularly keep important data outside the server, such as on your PC.
What should I back up?
- Website files and bot code (keeping them on GitHub is easiest)
- Databases (see "DB backups" below)
- Game server world folders (e.g., Minecraft's
world) - Configuration files and secrets files like
.env
Linux — compress and download
1. Compress on the server
tar -czf backup-$(date +%F).tar.gz ~/my-project
This creates an archive with the date in its name, like backup-2026-10-08.tar.gz.
2. Download to your PC
Run this in PowerShell or a terminal on your PC. (You can also use WinSCP or FileZilla from Uploading and downloading files.)
scp username@server-ip:~/backup-2026-10-08.tar.gz ./
3. Restore
tar -xzf backup-2026-10-08.tar.gz -C ~/
DB backups (MySQL / MariaDB)
sudo mysqldump --all-databases > db-$(date +%F).sql # Back up
sudo mysql < db-2026-10-08.sql # Restore
If this is your first time installing a DB, see Installing a database.
Back up automatically every day (cron)
You can schedule a backup to be created on the server every day at 4 a.m., with backups older than 7 days deleted.
mkdir -p ~/backups
crontab -e
The first time you run it, you'll be asked to choose an editor; nano is the easiest. Add the two lines below at the very bottom and save.
0 4 * * * tar -czf ~/backups/backup-$(date +\%F).tar.gz ~/my-project
30 4 * * * find ~/backups -name "*.tar.gz" -mtime +7 -delete
Backups that exist only on the server disappear along with it if the server is deleted. Even with automatic backups in place, download them to your PC from time to time.
Windows server
The simplest way is to compress important folders (right-click → Compress) and copy them to your PC using Remote Desktop's drive sharing. For details, see Uploading and downloading files.
Be sure to do this before your server expires
If you won't renew a server, download all the data you need before its expiry date. Data can't be recovered after expiry. Renewing your server