Skip to content

Containerized Minecraft server that runs on Alpine Linux

Notifications You must be signed in to change notification settings

dtp/docker-minecraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft server for Docker

Containerized Minecraft server that runs on Debian Slim

Available tags and Dockerfiles

Using this image

Starting the server

Start a detached instance with port 25565 bound to the host (the default minecraft port), where /path/to/minecraft is the path to the minecraft server directory.

$ docker run -itd --name minecraft -p 25565:25565 -v /path/to/minecraft:/data cmstar/minecraft

By default, the container will download and run the latest release version of Minecraft. To use a different version, set the VERSION environmental variable.

$ docker run -itd --name minecraft -e VERSION="1.10.2" -p 25565:25565 -v /path/to/minecraft:/data cmstar/minecraft

Additionally, to use RCON (when enabled in server.properties), simply bind port 25575.

$ docker run -itd --name minecraft -p 25565:25565 -p 25575:25575 -v /path/to/minecraft:/data cmstar/minecraft

To customize the Java Virtual Machine (JVM) arguments, pass them as arguments after specifying the container image.

$ docker run -itd --name minecraft -p 25565:25565 -v /path/to/minecraft:/data cmstar/minecraft -Xms512M -Xmx1G

Using the Forge image

Starting a simple Forge server is similar to vanilla.

$ docker run -itd --name minecraft -e VERSION="1.10.2-recommended" -p 25565:25565 -v /path/to/minecraft:/data cmstar/minecraft

To load a (zipped) Curse modpack, where modpack.zip is the path to modpack in /path/to/minecraft.

$ docker run -itd --name minecraft -e VERSION="1.10.2-recommended" -e MODPACK="modpack.zip" -p 25565:25565 -v /path/to/minecraft:/data cmstar/minecraft

Alternatively, load a (zipped) Curse modpack from a URL.

$ docker run -itd --name minecraft -e VERSION="1.10.2-recommended" -e MODPACK="https://example.com/modpack.zip" -p 25565:25565 -v /path/to/minecraft:/data cmstar/minecraft

Accessing the server's TTY

$ docker attach minecraft

Notes

This container is fully compliant with the Minecraft End User License Agreement (EULA). It does not contain any code or JARs distributed by Mojang, and is instead downloaded at runtime. For more information about Minecraft's EULA, please refer to https://account.mojang.com/documents/minecraft_eula.

Minecraft® is a registered trademark of Mojang AB.