Backing Up and Restoring Game Server Data
Regular backups protect your game server world saves, configurations, and plugins from data loss.
What to Back Up by Game
- Minecraft:
~/server/world/,~/server/server.properties,~/server/plugins/ - Rust:
~/rustserver/server/myserver/(contains save files) - Valheim:
~/.config/unity3d/IronGate/Valheim/worlds_local/ - ARK:
~/arkserver/ShooterGame/Saved/ - Project Zomboid:
~/Zomboid/Saves/ - CS2:
~/cs2server/game/csgo/cfg/
Simple Backup Script
nano ~/gamebackup.sh
#!/bin/bash
DATE=$(date +%Y-%m-%d_%H-%M)
GAME="minecraft"
SAVE_DIR="$HOME/server/world"
BACKUP_DIR="$HOME/backups"
mkdir -p "$BACKUP_DIR"
tar -czf "$BACKUP_DIR/${GAME}-${DATE}.tar.gz" "$SAVE_DIR"
# Keep only the last 10 backups
ls -t "$BACKUP_DIR"/${GAME}-*.tar.gz | tail -n +11 | xargs rm -f
echo "Backup complete."
chmod +x ~/gamebackup.sh
# Schedule: crontab -e → 0 4 * * * ~/gamebackup.sh
Restore from Backup
# Stop the server first
screen -S minecraft -X stuff "stop$(printf '
')"
sleep 10
# Extract backup
tar -xzf ~/backups/minecraft-2026-04-01_04-00.tar.gz -C ~/server/
echo "Restore complete — start the server."
Tips
- Always stop the server before backing up live world files to avoid corruption
- Store a copy of backups off-server (use rclone to sync to cloud storage)
- Test your restore process periodically