How To Host A DIY Minecraft Server At Home With Docker

From Trade Britannica
Jump to: navigation, search

My oldest son recently jumped into Minecraft. While a lot of his friends play Bedrock Edition on an iPad or game console, my son plays the old-fashioned Java Edition on an old computer. (And he launches it from the terminal! ) To play with each other I thought about running a Dockerized Minecraft server on my home server and it was simpler than I had expected.



A dedicated server is running



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



You can either open the container using a 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.yml file.



There are a variety of configuration options however I'd like to focus on two:



- Game's persistent data are written to a volume that is mounted on the host. This lets us quickly access the files. The "WORLD" option allows you to import a save that was created on a different computer.



Connecting to the Server



The server will accept connections within a couple of seconds. However my clients aren't in a position to see it. Minecraft will remain on the "Scanning games on your local network" screen for as long as. Whatever the case you want to do, simply click "Add Server" to add it manually, and voila!



Web Map



Most of my Minecraft knowledge is 10 years old. However, I'm aware of third-party tools can produce an online representation of a Minecraft world, similar to the one in Google Maps. After searching around, it seems like Minecraft Overviewer is the prominent one in the present.



Although the installation process is easy, I discovered an Docker file that was simpler. This one's a one-shot process (not an ongoing service) We'll make use of docker 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. This directory can be symlinked to a web-served directory on the host, such as the /var/www/public_html directory, which allows easy access from any web browser.



Even though it only takes just a few minutes to complete but the results are impressive.



Makefile



Lastly, as is my custom I added a few shortcuts in the Makefile to make them easy to access:



Reasons You Might Want to build a Dockerized Minecraft Server



The majority of people don't require dedicated servers. If you're just looking to play local multiplayer and one of your computers is sufficiently powerful you can click "Open to the LAN" directly from the game. If you're looking to play with a large group of players outside of your household it's best to go with a paid hosted server. It could be the official "Realms" or one of the many third-party alternatives.