Late night fun with Docker and Minecraft

Brian Lee
3 min readDec 9, 2022
Minecraft gamebox art

The past several weeks I have been learning more about containerization, specifically Docker. I have become just captivated with how useful and powerful Docker actually is. Granted there is a learning curve and I still have much to learn, but with just a bit of understanding on how the containerization works, you too can create multiple independent servers running on just one box!

Last night, for fun, I dusted off VMWare Workstation and put an install of Ubuntu on a VM — just a small VM with 4 GB ram and 40GB disk. Then I got Docker setup and added 4 containers of Minecraft server. I can play on each of these servers from anywhere on the local network. Overall, this was so fun because it illustrates just how powerful containerization is — and I somehow stayed up until midnight doing this without even noticing how late (or early in the morning) it had gotten!

The Docker image I used is located on DockerHub: https://hub.docker.com/r/itzg/minecraft-bedrock-server

Here are all the containers running. The web GUI is called Portainer, which is an easy install on Linux. Portainer also runs as a docker image and it starts up automatically. https://docs.portainer.io/

Multiple containers spun up from the same base image. Just the container name and ports are different.

Here are the docker run commands I used:

  • sudo docker run -d -it -e EULA=TRUE -e SERVER_PORT=19132 — name “MC-Server” -p 19132:19132/udp itzg/minecraft-bedrock-server
  • sudo docker run -d -it -e EULA=TRUE -e SERVER_PORT=19131 — name “mc-31” -p 19131:19131/udp itzg/minecraft-bedrock-server
  • sudo docker run -d -it -e EULA=TRUE -e SERVER_PORT=19130 — name “mc-30” -p 19130:19130/udp itzg/minecraft-bedrock-server
  • sudo docker run -d -it -e EULA=TRUE -e SERVER_PORT=19134 — name “mc-34” -p 19134:19134/udp itzg/minecraft-bedrock-server

Note: Firewall was turned off on the Ubuntu box (the VM).

I had to manually add the 4 servers to the server list. Technically the server on port 19132 will show up automatically under Friends tab, under LAN Games. I haven’t customized any of these servers, so they are all running the same configurations. Also it is recommended to attach a dedicated volume to each container so that game data can persist after a container is removed and rebuilt.

I hope you all enjoyed this short article on creating and running Minecraft Linux containers. Obviously some details were left out, but this should give you a bit more understanding how useful containers are.

Now that you see how simple this was, please give me a nerd rating on my endeavor from 1 to 10 ( 1 being “my grandma can do this” and 10 being “all hail the Uber Nerd”).

--

--