Desert Forge IT — Arizona IT · Field-tested tools & guidesFree consult →

How to Back Up Game Server World Files with Restic

Intermediate 20 min — Automated encrypted backups of game server worlds.

Why Restic

Restic is a fast, encrypted, deduplicated backup tool. It's perfect for game server backups because:

  • AES-256 encryption by default
  • Deduplication — only changed blocks are stored
  • Supports local disk, S3, B2, SFTP, and more
  • Fast — incremental backups take seconds
  • Easy restore of individual files or full snapshots

Install Restic

apt install -y restic
# Or get the latest:
wget https://github.com/restic/restic/releases/latest/download/restic_linux_amd64.bz2
bunzip2 restic_linux_amd64.bz2
chmod +x restic_linux_amd64
mv restic_linux_amd64 /usr/local/bin/restic

Initialize Repository

# Local backup
restic init --repo /mnt/backups/gameservers

# Backblaze B2
export B2_ACCOUNT_ID=your_id
export B2_ACCOUNT_KEY=your_key
restic init --repo b2:bucket-name:gameservers

You'll be prompted for a repository password. SAVE THIS — you can't restore without it.

First Backup

# Minecraft
restic backup --repo /mnt/backups/gameservers /opt/minecraft/world /opt/minecraft/world_nether /opt/minecraft/world_the_end

# Terraria
restic backup --repo /mnt/backups/gameservers /opt/terraria/worlds

# Valheim
restic backup --repo /mnt/backups/gameservers /opt/valheim/data/worlds

Automate with Cron

crontab -e
# Add: backup every 6 hours
0 */6 * * * RESTIC_PASSWORD=your_password restic backup --repo /mnt/backups/gameservers /opt/minecraft/world /opt/terraria/worlds 2>&1 | logger -t restic-backup

Restoring from Backup

# List snapshots
restic snapshots --repo /mnt/backups/gameservers

# Restore latest
restic restore latest --repo /mnt/backups/gameservers --target /tmp/restore

# Restore specific file
restic restore latest --repo /mnt/backups/gameservers --target /tmp/restore --include /opt/minecraft/world

Retention Policies

# Keep 7 daily, 4 weekly, 6 monthly snapshots
restic forget --repo /mnt/backups/gameservers \
  --keep-daily 7 \
  --keep-weekly 4 \
  --keep-monthly 6 \
  --prune

Run this weekly to clean up old snapshots and free space.

Monitoring Backup Health

# Check repository integrity
restic check --repo /mnt/backups/gameservers

# List recent snapshots
restic snapshots --repo /mnt/backups/gameservers --latest 5

← Back to Knowledge Base