GamingAugust 4, 20265 min read

How to Back Up and Restore a Minecraft Server

Losing a Minecraft world is heartbreaking and avoidable. Here's how to back up and restore a server, including automated nightly backups.

NBy Nxeon

A corrupted world or a griefing incident can wipe months of building. Backups are cheap insurance. This guide covers what to save, how to snapshot it safely, restoring, and automating the whole thing with cron.

What to back up

At minimum, the world folders. Java worlds are world, world_nether, and world_the_end. For a full restore you also want configs and player data:

  • world (+ nether/end): the actual save.
  • server.properties, ops.json, whitelist.json: settings and access.
  • plugins/ or mods/: so a restore is a working server, not just terrain.

Snapshot safely with save-off

The safe way to back up a *running* server is to flush the world to disk and pause saving first, so you don't copy a half-written file. In the server console:

save-off
save-all

Now copy the files, then re-enable saving:

tar -czf ~/backups/world-$(date +%F-%H%M).tar.gz world world_nether world_the_end

Back in the console:

save-on
Deploying a new server with the Nxeon one-click deploy wizard
Deploying a new server with the Nxeon one-click deploy wizard

Automate nightly backups

Wrap that in a script and schedule it with cron. Create ~/backup-mc.sh:

#!/bin/bash
DIR=/home/minecraft/server
DEST=/home/minecraft/backups
mkdir -p "$DEST"
tar -czf "$DEST/world-$(date +%F-%H%M).tar.gz" -C "$DIR" world world_nether world_the_end
# keep only the 14 most recent backups
ls -1t "$DEST"/world-*.tar.gz | tail -n +15 | xargs -r rm

Make it executable and add a cron job for 4 AM daily:

chmod +x ~/backup-mc.sh
crontab -e
# add this line:
0 4 * * * /home/minecraft/backup-mc.sh

For a busy server, briefly toggling save-off/save-on around the copy (via RCON) makes snapshots cleaner.

Restore a world

To roll back, stop the server, remove the current world, and extract a backup:

# stop the server first
cd ~/server
rm -rf world world_nether world_the_end
tar -xzf ~/backups/world-2024-05-01-0400.tar.gz
# start the server

Always keep the broken world aside (mv world world.broken) before overwriting, in case you extracted the wrong snapshot.

Off-server copies

A backup on the same disk won't help if the disk fails. Copy archives off-box periodically with rsync or scp:

rsync -avz ~/backups/ user@another-host:/mc-backups/

This matters most before risky changes — updating the server version, adding mods, or migrating to a new server. Take a backup first, every time.

Fully automated snapshots with RCON

The cron script above works, but for a busy server you want the save-off/save-on toggle automated too, so snapshots are never taken mid-write. Enable RCON in server.properties:

enable-rcon=true
rcon.port=25575
rcon.password=choose-a-strong-password

Then use a small RCON client like mcrcon inside your backup script:

mcrcon -H 127.0.0.1 -P 25575 -p "$RCON_PW" "save-off" "save-all"
tar -czf "$DEST/world-$(date +%F-%H%M).tar.gz" -C "$DIR" world world_nether world_the_end
mcrcon -H 127.0.0.1 -P 25575 -p "$RCON_PW" "save-on"

Now a scheduled backup pauses saving, snapshots, and resumes — with no manual steps and no risk of a torn file.

Test your restores

A backup you've never restored is a guess, not a safety net. Every so often, prove it works: spin up a throwaway server, extract a recent archive into it, and confirm the world loads with everything intact. This catches problems — a missing folder, a truncated archive — while it's harmless, not during a real emergency. It's the same discipline as migrating a world, just to a test box.

Retention and off-site copies

Keep a sensible history rather than one backup: the script above prunes to the 14 most recent. For real protection, copy archives off the server so a disk failure doesn't take your saves with it:

rsync -avz ~/backups/ user@another-host:/mc-backups/

Block storage is a cheap place to keep a deeper archive. Always take a fresh backup before risky changes — version updates and adding mods are the classic moments a good backup saves the day.

Incremental backups for large worlds

Full tar snapshots are simple, but for a large or modded world they get big fast. Once you're archiving nightly, tools like restic or borg deduplicate data so each backup only stores what changed — dramatically less disk for a long history, with easy point-in-time restore. A basic restic flow:

restic init --repo /home/minecraft/restic-repo
restic --repo /home/minecraft/restic-repo backup /home/minecraft/server/world
restic --repo /home/minecraft/restic-repo snapshots

You still want the save-off/save-all pause around the backup for consistency, but the storage savings on a big world are significant, and restic can push straight to remote storage. For most small survival servers the plain tar + cron approach is plenty; reach for deduplicating backups when worlds grow into the tens of gigabytes. Whatever tool you use, the golden rule holds: keep a copy off the server, and test a restore before you actually need one. This discipline is what makes a server migration or a bad version update a non-event.

FAQ

How do I back up a Minecraft server without stopping it?

Run save-off then save-all in the console, copy the world, then save-on. This avoids copying a file mid-write.

What folders do I need to back up?

The world folders (world, world_nether, world_the_end) at minimum, plus configs and your plugins/mods for a full restore.

How often should I back up?

Nightly for an active server, and always before updates or big changes. Keep two weeks of history and copy some off-server.

How do I restore a Minecraft world?

Stop the server, move the current world aside, extract the backup archive over the world folders, and start again.

Reliable backups need reliable storage. Nxeon's Minecraft server hosting runs on NVMe with root access for scripts and cron, and block storage gives you space for off-disk archives.

#minecraft#backup#restore#world#cron#seobatch

Deploy your first server in under a minute

Creating an account is free and takes no card details. You pay when you deploy — choose a billing term and pay from your wallet or by card at checkout.