A Minecraft server running on a VPS accumulates a huge amount of player effort and memories: elaborate builds, intricate redstone contraptions, player data, and plugin configurations. One mishap, whether a failed disk, a corrupted world, or an accidental delete command, and it can all vanish in an instant. This guide walks you through setting up automated backups with cron, combined with tar and rsync, plus offsite copies so your world stays safe even if the VPS goes down.
Why Automate Backups
Manual backups get forgotten, and they are usually remembered only when it is already too late. Automating backups through cron gives you consistent copies without relying on memory. The more players and updates your server has, the more frequently you should back up, because a single day of lost data can mean hours of building for an entire community.
The key principle is that having a backup does not mean you are safe until you have successfully tested a restore. At least once a month, extract your latest backup into a test folder to confirm the archive is not corrupt and can actually be recovered.
What to Back Up
Many people back up only the main world folder but forget other equally important parts. For a server running Paper or Spigot, you should back up the following:
- All world folders —
world,world_nether,world_the_end(Paper stores each dimension in a separate folder) - server.properties — the server's core configuration
- The plugins/ folder — the plugin jars and all their config files
- ops.json and whitelist.json — your admin list and whitelist
- bukkit.yml, spigot.yml, paper-global.yml — server-level configs
The Data Consistency Problem
This is where beginners most often go wrong. If you copy the world folder while the server is actively writing region files, you may capture a torn snapshot or a corrupted region file that will not load. To prevent this, you have two options.
Option 1: Stop the Server Briefly
This is the safest approach: issue a stop command, run the backup, then start it again. It suits private servers that can go offline at 4 a.m. without affecting anyone.
Option 2: Use save-off + save-all
For servers that must stay online, issue commands through the console or RCON before backing up. Type save-all to flush everything to disk, followed by save-off to temporarily stop the server from writing world files. Then copy or tar the files. When finished, run save-on to resume normal saving. This gives you a complete, consistent copy without shutting the server down.
Never copy the world folder while the server is running without issuing save-off first. Region files (.mca) can be written mid-copy, silently corrupting your backup, and you will not find out until the day you actually need to restore.
A tar Backup Script
Create a file at /opt/minecraft/backup.sh like the example below. This script compresses all world folders into a timestamped .tar.gz archive and automatically deletes backups older than 7 days.
#!/bin/bash
set -euo pipefail
SERVER_DIR="/opt/minecraft/server"
BACKUP_DIR="/opt/minecraft/backups"
KEEP_DAYS=7
mkdir -p "$BACKUP_DIR"
cd "$SERVER_DIR"
# If using RCON, issue save-off + save-all here first (see consistency section)
# mcrcon -H 127.0.0.1 -P 25575 -p PASS "save-all" "save-off"
tar czf "$BACKUP_DIR/backup-$(date +%F-%H%M).tar.gz" \
world world_nether world_the_end \
server.properties ops.json whitelist.json plugins
# mcrcon -H 127.0.0.1 -P 25575 -p PASS "save-on"
# Delete backups older than KEEP_DAYS days
find "$BACKUP_DIR" -name "backup-*.tar.gz" -mtime +$KEEP_DAYS -delete
echo "Backup completed: $(date)"
Do not forget to make it executable with chmod +x /opt/minecraft/backup.sh and run it manually once before scheduling it in cron.
Scheduling with crontab
Open your crontab with crontab -e and add the line below to back up every day at 4 a.m., when player activity is lowest.
# Back up Minecraft daily at 04:00
0 4 * * * /opt/minecraft/backup.sh >> /var/log/mc-backup.log 2>&1
Redirecting output to a log lets you verify whether cron ran successfully. Check the log periodically at first to confirm everything is running according to plan.
Comparing Backup Strategies
| Strategy | Frequency | Retention | Best For |
|---|---|---|---|
| Full tar (local) | Daily | 7 days | Small-medium servers |
| rsync offsite | Daily | 7-14 days | Guarding against VPS failure |
| restic/borg (dedup) | Every 6 hrs | 30+ days | Large worlds |
| Host snapshot | Twice monthly | Provider policy | System-level backup |
Offsite Copies and the 3-2-1 Rule
A backup that lives on the same VPS as your server is useless if the disk fails or the VPS is deleted. The 3-2-1 rule states that you should keep 3 copies of your data on 2 types of media, with at least 1 copy offsite. The simplest way is to use rsync to push the backup folder to another server or to object storage.
# Send backups to a remote host over SSH
rsync -avz --delete /opt/minecraft/backups/ user@remote-host:/backups/minecraft/
Alternatively, use restic to back up to S3-compatible storage, which gives you deduplication, encryption, and retention built in.
export RESTIC_REPOSITORY="s3:https://s3.example.com/mc-backups"
restic backup /opt/minecraft/backups
restic forget --keep-daily 7 --keep-weekly 4 --prune
Incremental Backups for Large Worlds
As a world keeps growing, a full tar every day consumes a lot of space and time. The solution is incremental backups that store only what has changed. Tools like restic and borg use deduplication, letting you keep many snapshots with very little space. With rsync, you can use --link-dest to hard-link to the previous backup so unchanged files are not copied again.
Restore Procedure
A backup only has value if it can be restored. The basic steps are:
- Always stop the server completely first.
- Back up the current world folder first (in case you restore the wrong archive).
- Extract the backup over the existing folders:
tar xzf backup-2026-07-02-0400.tar.gz -C /opt/minecraft/server - Verify file permissions (the owner must be the user that runs the server).
- Start the server again and log in to confirm the world loads correctly.
Backups on an AsiaGB VPS
If you run Minecraft on an AsiaGB Linux VPS, starting from 500 THB/month, you can deploy the cron job and scripts above immediately on SSD-backed storage. At the hosting level, AsiaGB provides automated backups twice a month (on the 1st and the 15th) as a system-level safeguard, with a 99% uptime guarantee and management through DirectAdmin. Even so, we recommend setting up your own Minecraft-specific backups at a higher frequency, because game data changes daily and you should control the backup cadence to suit your own community.
Frequently Asked Questions
Do I have to stop my Minecraft server every time I back up?
No. If you use RCON to issue save-all followed by save-off before backing up, then save-on afterward, you get a complete copy without shutting the server down. That said, briefly stopping the server is still the safest method for private servers.
How often should I back up my Minecraft server?
It depends on how active the server is. Busy servers should back up every 6 hours or daily, while small servers are fine with daily backups. You should always keep at least one offsite copy following the 3-2-1 rule.
Why is a backup on the same VPS not safe?
Because if the disk fails, the VPS is deleted, or it gets hacked, both the server and the backup disappear together. That is why the 3-2-1 rule requires at least one copy to be offsite, such as an rsync to another host or to object storage.
AsiaGB already backs up my server, so why set up my own?
AsiaGB's backup runs twice a month (on the 1st and 15th) as a system-level safeguard, which may not be frequent enough for game data that changes daily. Setting up your own Minecraft-specific backups lets you restore far more granularly and frequently.
Ready to launch your Minecraft server?
AsiaGB Linux VPS (SSD, DirectAdmin, 99% uptime) from 500 THB/month — Thailand & Singapore datacenters for low ping, perfect for Minecraft servers of any size.
View VPS Plans