Self-Hosting · Game Servers
Run a Minecraft Server in Docker
A Minecraft world your household owns, running on the NAS or mini PC that is already switched on, costs nothing per month and answers to nobody’s platform decisions. This guide sets one up the durable way: Paper server software in a Docker container, using the itzg image, with the memory set deliberately, the world in a folder you can back up, and an update path that never puts the world at risk. The generic “how to host Minecraft” advice points at rented servers; everything here assumes the opposite — your hardware, your world.
Published Nov 24, 2026
Why Paper, and why Docker
There are three common ways to run a Minecraft server at home: the raw server jar on a spare PC, a management panel, and a Docker container. This guide uses the container, because it is the option that behaves best on the hardware this site’s readers already run. The server lives in one folder on your NAS or mini PC, it restarts itself after a power cut, updating it means pulling a new image rather than reinstalling anything, and the world sits in a volume you can back up without touching the program. The image is itzg/minecraft-server, the long-maintained community image that most home Minecraft servers run on. It downloads and manages the server software for you, driven entirely by environment variables in a Compose file.
The server software choice matters more than the container does. Paper is a drop-in replacement for Mojang’s vanilla server: same world format, same client, no mods required to join — but with the performance work the vanilla server never got, so the world’s tick rate holds up when several players are exploring in different directions at once. Vanilla is fine for a first night with two players. For a world you intend to keep, start on Paper; moving a vanilla world to Paper later also works, because the format is shared, but there is no reason to wait.
What the server needs before you start
You need a host with Docker running — a NAS or a mini PC both work — and enough RAM set aside for the server. The short version, worked in full in the game server hardware sizing guide: give the server 2 GB of memory for a small group, 4 GB for five to ten players, and 8 GB or more for a busy world or a lightly modded one. Heavy modpacks want 8 to 16 GB. Just as important is the processor, and not in the way spec sheets suggest: Minecraft’s main world loop runs on effectively one core, so a mini PC with a fast modern processor core will run a smoother world than an old server chip with many slow cores. If you are new to running containers on a NAS at all, the Docker on a NAS beginner guide and the Compose basics guide cover the ground this one builds on.
The Compose file
Create a folder for the server, put this file in it as docker-compose.yml, and start it with docker compose up -d:
services:
minecraft:
image: itzg/minecraft-server
container_name: minecraft
tty: true
stdin_open: true
environment:
EULA: "TRUE"
TYPE: PAPER
MEMORY: 4G
VIEW_DISTANCE: 8
ports:
- "25565:25565"
volumes:
- ./minecraft-data:/data
restart: unless-stopped
The two terminal settings (tty and stdin_open) keep the server console attachable, so you can run in-game commands such as docker compose attach minecraft when you need to make someone an operator. The port is Minecraft’s default, 25565 over TCP. The volume is the important line: everything that makes this world yours — the world itself, player data, the server settings — lives in the minecraft-data folder next to the Compose file, and the container is disposable around it.
The four settings that decide how it runs
EULA=TRUE accepts Mojang’s end-user license agreement on the server’s behalf. The server will not start without it, and setting it in the file is the acceptance.
MEMORY sets the Java heap — the memory the game itself gets. Here is the rule that saves a crashed server later: the container needs roughly 1 GB more than the heap, for the Java runtime and the image’s own working room. A host with 8 GB free can run a 4 GB heap comfortably alongside its other services; setting MEMORY to the host’s entire free RAM invites the operating system to kill the server mid-evening. If Docker or your NAS lets you cap the container, cap it at the heap plus about a gigabyte and let the heap be the number you tune.
VIEW_DISTANCE is how many chunks of world the server loads and sends around each player. The game’s default of 10 is generous; 8 is the deliberate choice for a home server, and it is the first knob to lower — to 6 or 7 — if the world stutters when players spread out. Simulation distance exists as a separate setting on Paper for the same reason. Chunks are the server’s real workload, and every step down is load removed from that single hard-working core.
TYPE is where Paper is chosen. Leave it set; the image also accepts VANILLA, which is the same setup with the slower server software, and modded options that belong in a guide of their own.
First start, and joining the world
The first start takes a few minutes: the image downloads Paper, generates a fresh world, and prints a line in the log when the server is ready — watch it with docker compose logs -f. Players on your home network join from Minecraft’s multiplayer screen using the host’s local address (for example 192.168.1.50) with no port needed at the default. Friends joining from outside your network is a separate topic — it involves your router and a deliberate exposure decision, and the cluster’s anchor guide on self-hosted game server panels and exposure covers the rules for doing it safely. Read that before you forward anything.
Backups: the world is a folder
Because the world lives in minecraft-data, a backup is a copy of that folder — nothing more exotic is required. The safe rhythm is to stop the container (docker compose stop), copy the folder, and start it again; copying a running world can catch files mid-write. A nightly copy kept for a week of history covers the realistic disasters: a griefer, a corrupted chunk, a bad experiment near the good builds. NAS snapshot schedules and the backup routine you already use for the rest of the box work on this folder exactly as they do on any other, which is the quiet advantage of the container approach.
Updating without losing the world
Updating the server is three commands: docker compose pull to fetch the newer image, then docker compose up -d to recreate the container from it. The world folder is untouched by both, because it was never inside the container. Two cautions keep updates boring. First, back up before an update that also moves the game version — a world opened by a newer Minecraft version cannot go back to an older one. Second, if you would rather update on your schedule than the image’s, pin the game version by adding a VERSION environment variable (for example the current release number) and change it deliberately, the same day you take the backup.
What to run it on
Almost any always-on box the site recommends will run this server; the choice is about headroom. A compact mini PC with a modern processor is the comfortable home for a Paper world and leaves room for a second server later. These are the two boxes from the site’s catalogue that suit the job:
Prices are editorial estimates, checked against retailer listings on the date stated on the page, and change often — the links open current listings where you can verify price and availability. Some links may earn a commission at no cost to you — see the disclosure page.
Whichever box you choose, judge it by the sizing rules above — memory for the heap plus its extra gigabyte, and single-core speed over core count — rather than by the size of its spec sheet. The mini PC home server guide covers the wider field if neither fits.
Official documentation and references
- itzg/docker-minecraft-server — the image’s own documentation: every environment variable, Paper setup, and data layout
- PaperMC — the Paper server software: downloads, documentation and performance notes
- itzg documentation site — the long-form version of the image docs, including backup and update patterns
Frequently asked questions
Paper or vanilla: which should a home server run?
Paper, for anything beyond a first night. It reads the same world format as Mojang’s vanilla server, needs no mods on the players’ computers, and holds its tick rate far better when players explore in different directions. Vanilla is the same setup with slower software, and a vanilla world can move to Paper later without starting over.
How much RAM does a Minecraft server actually need?
For a friends-and-family Paper world: 2 GB of heap for a small group, 4 GB for five to ten players, 8 GB or more for a busy or lightly modded world, and 8 to 16 GB for heavy modpacks. Whatever heap you choose, the container needs about 1 GB on top of it, and that total is what the host must have free.
Will my world survive updating the container?
Yes — that is the point of the volume. The world lives in the data folder on the host, and pulling a new image or recreating the container never touches it. The one real caution is game versions: back up before moving to a newer Minecraft version, because a world opened by the newer version cannot return to an older one.
Why does the server lag when we explore in different directions?
Because Minecraft’s world simulation runs on effectively one processor core, and exploration is the heaviest thing players do: every traveler generates and loads new chunks. Lowering VIEW_DISTANCE is the fastest relief. After that, a host with a faster individual core beats a host with more, slower cores.
Can my NAS run this and everything else it already does?
Usually yes, if the memory adds up. Count the heap plus its extra gigabyte against the NAS’s free RAM after its existing services. A 4 GB Paper world on a 16 GB NAS that also runs a media server is a normal arrangement; the same world on an 8 GB NAS that is already busy is where corners get cut.

