This image is a self-contained Minecraft Java Edition Server. It is intended for use in the upcoming CubeWork ecosystem but is also being provided for use in the Minecraft community.
docker run -d -it -p 25565:25565 -e EULA=true cubeworx/mcje-server
The image runs with default or recommended configurations but can be customized through environment variables. Changing any of the environment variables from their defaults will update the server.properties file as described here: https://minecraft.fandom.com/wiki/Server.properties#Java_Edition_3
JVM_MAX_MEMORY="1024M" |
the maximum memory allocation pool the Java executable may use |
JVM_MIN_MEMORY="1024M" |
the initial memory allocation pool the Java executable will use |
LEVEL_NAME="Java-Level" |
Default level name of world. Customized to remove space in default name |
OPERATORS_LOOKUP="true" |
Specify if player xuids get verified from online api or written as is |
OPERATORS_MODE="static" |
Specify if permissions file gets overwritten every time container starts |
SERVER_NAME="CubeWorx-MCJE" |
Default MOTD that shows up when added to multiplayer server list |
WHITELIST_ENABLE="false" |
Specify if connected players must be listed in WHITELIST_USERS variable |
WHITELIST_LOOKUP="true" |
Specify if player usernames get verified from online api or written as is |
WHITELIST_MODE="static" |
Specify if whitelist file gets overwritten every time container starts |
The following environment variables are basic ones that you might want to change to customize the game play to your liking.
ALLOW_NETHERDIFFICULTYGAME_MODEHARDCORELEVEL_NAMELEVEL_SEEDLEVEL_TYPEONLINE_MODEPVPSERVER_NAMESERVER_PORTSPAWN_MONSTERS
The following environment variables are more advanced ones that you might want to change to optimize the management or performance of your server.
ACCEPT_TRANSFERSALLOW_FLIGHTBROADCAST_CONSOLE_TO_OPSBROADCAST_RCON_TO_OPSENABLE_COMMAND_BLOCKENABLE_JMX_MONITORINGENABLE_QUERYENABLE_RCONENABLE_STATUSENFORCE_SECURE_PROFILEENFORCE_WHITELISTENTITY_BROADCAST_RANGE_PERCENTAGEFORCE_GAMEMODEFUNCTION_PERMISSION_LEVELGENERATE_STRUCTURESHIDE_ONLINE_PLAYERSLOG_IPSMAX_CHAINED_NEIGHBOR_UPDATESMAX_PLAYERSMAX_TICK_TIMEMAX_WORLD_SIZENETWORK_COMPRESSION_THRESHOLDOP_PERMISSION_LEVELPAUSE_WHEN_EMPTY_SECONDSPLAYER_IDLE_TIMEOUTPREVENT_PROXY_CONNECTIONSQUERY_PORTRATE_LIMITRCON_PASSWORDRCON_PORTREGION_FILE_COMPRESSIONREQUIRE_RESOURCE_PACKRESOURCE_PACKRESOURCE_PACK_IDRESOURCE_PACK_PROMPTRESOURCE_PACK_SHA1SIMULATION_DISTANCESPAWN_PROTECTIONSYNC_CHUNK_WRITESTEXT_FILTERING_CONFIGTEXT_FILTERING_VERSIONUSE_NATIVE_TRANSPORTVIEW_DISTANCE
The image utilizes a volume at the /mcje/data path for persistent storage. This path contains artifacts, backups, worlds and other custom configuration files.
You can mount this volume on the host via docker-compose:
version: '3.8'
volumes:
mcje-data:
driver: local
services:
mcje-server:
volumes:
- mcje-data:/mcje/data
or via the command line:
docker run -d -it -p 25565:25565 -v $(pwd):/mcje/data -e EULA=true cubeworx/mcje-server
docker volume create mcje-data
docker run -d -it -p 25565:25565 -v mcje-data:/mcje/data -e EULA=true cubeworx/mcje-server
The whitelist is the list of player usernames that are allowed to connect to your server when WHITELIST_ENABLE="true" which should be set if your server is going to be publicly accessible. By default the whitelist file gets overwritten whenever the container starts/restarts to ensure that the usernames match what is in the config.
Setting WHITELIST_MODE="dynamic" will allow whitelist changes made in the game to be retained upon start/restart of the container. Since usernames are case-sensitive, they are verified against an API to make sure there aren't any mistakes. This lookup can be disabled by setting WHITELIST_LOOKUP="false".
The whitelist file is generated from the names included in the WHITELIST_USERS or OPERATORS. It is not necessary to enter a username in more than one environment variable. The following example will result in four names being added to the whitelist.
-e WHITELIST_USERS=player1,player2,player3 -e OPERATORS=operator1
The Operators variable can be a comma-sepearated list of usernames or UUIDs since the values are verified against a Mojang API when the container first starts. This lookup can be disabled by setting OPERATORS_LOOKUP="false" but then will require exact usernames to be entered for each user.
By default the operators file gets overwritten whenever the container starts/restarts to ensure that the operator permissions match what is in the config. Setting OPERATORS_MODE="dynamic" will allow operator changes made in the game to be retained upon start/restart of the container.
If WHITELIST_ENABLE="true" then players in the OPERATORS variable will automatically be added to the server whitelist.
To give operators a different permission level than what is set in OP_PERMISSION_LEVEL (default 4) put a pipe | after the name/uuid and the number of permission level (1-4) the operator should have.
-e OPERATORS=operator1,4566e69fc90748ee8d71d7ba5aa00d20,operator2|3,operator3|3
Seeds are special codes that can generate worlds in Minecraft when the server is launched. They cover a variety of places and provide new opportunites to build and explore. A seed can only be specified when first launching the server and once a world has been created then adding, changing, or removing the seed has no impact.
To specify a seed then use the LEVEL_SEED environment variable. You can search online to find seeds to play or you can set LEVEL_SEED=random and one will be pulled from the seeds.txt file included in the image.
This image was initially inspired by itzg/docker-minecraft-server! If you are looking to run Java servers other than the "Vanilla" version provided by Mojang or add lots of mods then we recommend you giving his image a try.