How To Host A DIY Minecraft Server At Home Using Docker

From Wifi Adapters DB
Jump to: navigation, search

My oldest son discovered Minecraft recently. While his peers play Bedrock Edition on an iPad or game console, my son plays the venerable Java Edition on an old computer. (And he can launch it via the terminal! ) To play together I decided to run an Dockerized Minecraft server on my home server and it was more straightforward than I anticipated.



A dedicated server is running



The official server distribution includes a single Javajar. It's likely to be simple to use. Before trying it, though, I searched for Docker images, and found a good one: itzg/minecraft-server.



You can start the container with an individual docker run command and/or daemonize it. I prefer to keep it simple and use docker compose within my byobu session.



Here's my current docker.yml file.



There are many available configuration options, but I'd like to highlight two things above:



The game's data that is persistent is stored on a volume mounted to the host to allow us to easily access the files. - The "WORLD" option is useful to import the save file that was originally created on another computer.



Connecting to the Server



The server will accept connections within a few seconds. However my clients aren't in a position to see it. Minecraft will sit on the "Scanning for games on your local network" screen for the rest of the time. You can still "Add Server" to manually add it, and voila!



Web Map



My Minecraft knowledge is a decade old. Third-party tools can produce a web view of the Minecraft environment similar to Google Maps. It seems that Minecraft Overviewer is the most popular tool these days.



While the installation of this tool is simple, I came across a Docker file that was easier to install. Cracked Minecraft Servers This is a one-shot (not an ongoing) procedure, so we'll be using docker to run:



With read-only access to game data produced by the other container and another volume to write to, this will result in an online map using Leaflet. This directory could be linked to a web-served directory on the host, like /var/www/public_html, for easy access from any internet browser.



While it only takes just a few minutes, the results are quite impressive. Cracked Minecraft Servers



Makefile



As per my own wishes, I added some shortcuts to a Makefile to make it easier to access.



Motives to Build a Dockerized Minecraft Server



Most people don't require dedicated servers. If you're wanting to play locally using multiplayer and one of your computers is powerful enough it is possible to "Open to LAN" directly from the game. A paid hosted server is better if you want to play with a greater number of players outside of your home. This could be the official "Realms" or one of the many third-party options.