← Build Log

Minecraft Server with Automated Backups

Status: complete
TrueNASMinecraftZFSDockerTelegram Bot

What It Is

A Minecraft Java Edition server running on TrueNAS, with automated ZFS snapshot backups every 6 hours. The world data replicates to a separate backup pool, so a bad update or world corruption doesn’t mean starting over.

Backup Strategy

ZFS makes this straightforward:

  • Snapshot frequency: Every 6 hours (more aggressive than the daily schedule on other datasets, because Minecraft worlds change fast)
  • Retention: 2-week rolling window
  • Replication: Local replication to the dedicated backup pool on separate physical drives
  • Recovery: Roll back to any snapshot within the retention window

The snapshots are recursive — they capture the full dataset including server configs, plugins, and world data in a consistent state.

Why It Matters

Anyone who’s run a Minecraft server knows the pain of a corrupted world. ZFS snapshots are atomic and copy-on-write, so they capture a consistent point-in-time state even if the server is actively writing chunks. Rolling back is a single command, not a “restore from last night’s tar.gz and hope nothing is missing” situation.

Deployment

The server runs in a Docker container on TrueNAS. The world data lives on a ZFS dataset that’s separate from the container itself — so the container can be rebuilt, updated, or replaced without touching the world.

Server properties, whitelist, and ops files are bind-mounted from the dataset into the container.

Future Plans

  • Telegram notifications: Alert on backup completion/failure using the homelab Telegram bot
  • Player activity logging: Track when players join/leave for usage-based resource allocation
  • Automatic server updates: Pull latest server jar on container rebuild