r/portainer • u/Nefzaoui • 2d ago
Deploying a Minecraft server panel as a Portainer stack: the one env var that matters (DATA_DIR_HOST)
I make a free, MIT Minecraft server panel (https://github.com/anefzaoui/minecraft-server-manager) and it runs fine as a Portainer stack, so here's the short version of how, plus the one thing that trips people up. Disclosure: I built it with Claude Code. I designed it, decided every feature, review the changes and test every release on our own servers, and Claude wrote most of the code.
What it does: the panel container gets the Docker socket and creates each Minecraft server as a sibling container on the itzg image, each with its own RAM/CPU cap. Modpacks from Modrinth/CurseForge/FTB are pinned, with a backup before every update and one-click rollback.
As a stack: Stacks → Add stack → paste the repo's docker-compose.yml (image ghcr.io/anefzaoui/minecraft-server-manager:latest, amd64 and arm64), then set one environment variable:
DATA_DIR_HOST=/opt/msm/dataWhy that variable: the panel sees its data at /data inside its container, but when it asks Docker to bind-mount a server's folder into a new container, the daemon resolves the path on the host. DATA_DIR_HOST is the absolute host path behind the /data mount, and the panel re-roots every mount onto it. Without it, Docker would mount host folders that don't exist.
Then open port 25564, and the first run walks you through creating the admin.
Two cautions: anything with the Docker socket is root on the host, so keep it on your LAN/VPN or behind a TLS reverse proxy (publish 127.0.0.1:25564:25564 in that case). And you'll see the server containers show up in Portainer next to the panel, that's expected.
Java edition only, English UI.



