How To Host A DIY Minecraft Server At Home With Docker

From Wifi Adapters DB
Jump to: navigation, search

My oldest son recently jumped into Minecraft. While many of 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 with each other I thought about running an Dockerized Minecraft server on my home server and it was simpler than I had expected.



Running a Dedicated Server



The server distribution that is officially available is only a single Java jar, so it should be fairly easy to run. Before trying it, though, I searched for Docker images, and found a good one: itzg/minecraft-server.



You can start the container by using an individual docker run command, or daemonize it. I prefer to keep it simple and set docker compose within my byobu session.



Here's my current docker-compose.yml file:



There are a ton of possible configuration options, however I'd like to focus on two things above:



Game's persistent data are stored on a volume mounted on the host. premium content for premium people This lets us easily access the data. - The "WORLD" option is useful for importing the save file that was originally created on a different computer.



Connecting to the Server



After a few seconds the server is ready to accept connections, however my clients aren't able to recognize it for reasons. Minecraft will remain 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 more than a decade old. However, I'm aware that third-party tools can generate an online representation of a Minecraft world that is similar to the ones in Google Maps. After a bit of research it appears that Minecraft Overviewer is the prominent one of the moment.



As I mentioned before, the installation looks pretty straightforward however, I came across a Docker image that's even simpler. This is a single-shot (not an ongoing) procedure, so we'll use docker to run:



Leaflet will create a web map with read-only access to game data from the other container and another volume to write it to. The directory can be linked to a web-served directories on the host such as /var/www or ~/public_html for access to any web browser. premium content for premium people



While it only takes just a few minutes but the results are impressive.



Makefile



As is my custom, I threw a few shortcuts in an Makefile for easy access:



The Reasons to Build Dockerized Minecraft Server



A dedicated server built by yourself is probably unnecessary for most people. If you're just looking to play locally with multiplayer and your computer is sufficiently powerful it is possible to "Open to the LAN" directly from the game. A paid hosted server is more suitable when you want to play with a greater number of players outside of your home. That could be either the official "Realms" or one of the many third-party alternatives.