A Docker container for Minecraft Server configured with environment variables.
docker pull silenthunter44/docker-minecraft-server:latestRun the default configuration with the following:
docker run --detach --name minecraft-server --publish 25565 silenthunter44/docker-minecraft-server:latestAlternatively, you can use an external volume for data and configuration, and/or environment variables:
docker run --detach --name minecraft-server \
--volume /local-path-to-minecraft:/minecraft \
--publish 25565 \
--env MC_XMS=1024M \
--env MC_XMX=4096M \
silenthunter44/docker-minecraft-server:latest25565: Minecraft Server listening TCP port
/minecraft: data, configuration and logfiles
This Minecraft Server container can be configured with the following environment variables:
-
Global:
MC_XMS: initial memory allocation pool for the JVM (default to1024M)MC_XMX: maximum memory allocation pool for the JVM (default to$MC_XMS)MC_JAR: path to theminecraft-server.jarfile (default to/minecraft/minecraft_server.jar)MC_CONFIGFILE: path to theserver.propertiesfile (default to/minecraft/server.properties)MC_SAVEINTERVAL: minutes between 2/save-allinvocation (default to30)
-
Minecraft Server's
server.propertiesfile:MC_ALLOWFLIGHT: allows users to use flight on your server while in Survival mode, if they have a mod that provides flight installed (default tofalse)MC_ALLOWNETHER: allows players to travel to the Nether (default totrue)MC_ANNOUNCEPLAYERACHIEVEMENTS: allows server to announce when a player gets an achievement (default totrue)MC_DIFFICULTY: fefines the difficulty of the server (default to1)MC_ENABLECOMMANDBLOCK: enables command blocks (default tofalse)MC_ENABLEQUERY: enables GameSpy4 protocol server listener (default tofalse)MC_ENABLERCON: enables remote access to the server console (default tofalse)MC_FORCEGAMEMODE: force players to join in the default game mode (default tofalse)MC_GAMEMODE: defines the mode of gameplay (default to0)MC_GENERATESTRUCTURES: defines whether structures (such as villages) will be generated (default totrue)MC_GENERATORSETTINGS: the settings used to customize world generationMC_HARDCORE: if set to true, players will be set to spectator mode if they die (default tofalse)MC_LEVELNAME: the "level-name" value will be used as the world name and its folder name (default toworld)MC_LEVELSEED: add a seed for your worldMC_LEVELTYPE: determines the type of map that is generated (default toDEFAULT)MC_MAXBUILDHEIGHT: the maximum height in which building is allowed (default to256)MC_MAXPLAYERS: the maximum number of players that can play on the server at the same time (default to20)MC_MAXTICKTIME: the maximum number of milliseconds a single tick may take (default to60000)MC_MAXWORLDSIZE: this sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain (default to29999984)MC_MOTD: this is the message that is displayed in the server list of the client, below the name (default toA Minecraft Server)MC_NETWORKCOMPRESSIONTHRESHOLD: by default it allows packets that are n-1 bytes big to go normally, but a packet that n bytes or more will be compressed down (default to256)MC_ONLINEMODE: server checks connecting players against Minecraft's account database (default totrue)MC_OPPERMISSIONLEVEL: sets the default permission level for ops when using/op(default to4)MC_PLAYERIDLETIMEOUT: if non-zero, players are kicked from the server if they are idle for more than that many minutes (default to0)MC_PREVENTPROXYCONNECTIONS: if the ISP/AS sent from the server is different from the one from Mojang's authentication server, the player is kicked (default tofalse)MC_PVP: enable PvP on the server (default totrue)MC_RESOURCEPACKSHA1: optional SHA-1 digest of the resource pack, in lowercase hexadecimalMC_RESOURCEPACK: optional URI to a resource packMC_SNOOPERENABLED: sets whether the server sends snoop data regularly to http://snoop.minecraft.net (default totrue)MC_SPAWNANIMALS: determines if animals will be able to spawn (default totrue)MC_SPAWNMONSTERS: determines if monsters will be spawned (default totrue)MC_SPAWNNPCS: determines whether villagers will be spawned (default totrue)MC_SPAWNPROTECTION: determines the radius of the spawn protection as (x*2)+1 (default to16)MC_USENATIVETRANSPORT: Linux server performance improvements: optimized packet sending/receiving on Linux (default totrue)MC_VIEWDISTANCE: sets the amount of world data the server sends the client, measured in chunks in each direction of the player (default to10)MC_WHITELIST: enables a whitelist on the server (default tofalse)
For more information, see http://minecraft.gamepedia.com/Server.properties