A Minecraft server in 3 commands

Run a Minecraft Java server with a persistent world, resource limits and auto-restart.

Minecraft is a great first real workload: it needs memory limits, a persistent

world, TCP and UDP ports, and it should survive crashes. cardinal handles

all of that on one line.

The command

cardinal run -d -n mc \
  -p 25565:25565/tcp -p 25565:25565/udp \
  -v mc_world:/data \
  --memory 2g --cpus 2 --restart always \
  -e EULA=TRUE -e VERSION=LATEST -e DIFFICULTY=normal -e MAX_PLAYERS=10 \
  itzg/minecraft-server:latest

What each part does:

FlagWhy
-p 25565:25565/tcp -p 25565:25565/udpBoth protocols — the Java client uses both
-v mc_world:/dataWorld lives in a named volume, survives restarts
--memory 2g --cpus 2cgroups v2 limits so one game can't kill the box
--restart alwaysSupervisor restarts it after a crash or reboot
-e EULA=TRUEAccepts the Minecraft EULA (required by the image)
-e VERSION=LATESTRun the latest server version

Watch it boot

cardinal logs -f mc

The first boot downloads the server jar — give it a minute. You'll see the

Done line when it's ready.

Connect

Open Minecraft Java Edition → Multiplayer → Add Server:

your-server-ip:25565

Day-to-day ops

cardinal ps                     # status
cardinal stats mc               # live CPU / memory
cardinal backup enable mc --interval 6h --retention 14   # scheduled world backups
cardinal exec mc rcon-cli list # list players (if rcon is enabled)
cardinal stop mc                # stop; world is kept

One-liner via blueprint

The same setup ships as a blueprint — install it interactively instead:

cardinal blueprint install minecraft-server

Either way you end up with a persistent, auto-restarting Minecraft server.