Minecraft - Vanilla Server
About this image
This Docker image allows you to run a Vanilla Minecraft server quickly. It
also serves as the base image for some of my Modded Minecraft server images.
Base Docker image
How to use this image
Starting an instance
docker run \ --name minecraft-instance \ -p 0.0.0.0:25565:25565 \ -d \ -e DEFAULT_OP=dinnerbone \ -e MINECRAFT_EULA=true \ dlord/minecraft
By default, this starts up a Minecraft 1.10.1 server instance. If you wish to
start a different Minecraft server version, you need to set the
MINECRAFT_VERSION variable to the appropriate version.
You must set the
DEFAULT_OP variable on startup. This should be your
Minecraft username. The container will fail to run if this is not set.
When starting a Minecraft server, you must agree to the terms stated in
Minecraft's EULA. This can be done by setting the
true. Without this, the server will not run.
This image exposes the standard minecraft port (25565).
When starting a container for the first time, it will check for the existence of
the Minecraft Server jar file, and will download from Mojang when necessary. As
much as I want to package the Minecraft server jar in this image (to also save
on time and the hassle of an extra step), I cannot due to the Minecraft EULA.
Data volumes ( DEPRECATED )
This functionality was converted in favor of using host mounting. My use case involves
mounting an EBS volume in AWS which was better for my phoenix architecure. If you
prefer the data volume approach you should check out the original repo https://github.com/dlord/minecraft-docker
For best results mount a host directory to WORLD_DATA directory, if not world retrieval may be difficult.
Mountpoints will be added in the future for configuration settings.
The image uses environment variables to configure the JVM settings and the
MINECRAFT_EULA is required when starting creating a new container. You need to
agree to Minecraft's EULA before you can start the Minecraft server.
DEFAULT_OP is required when starting creating a new container.
You may adjust the JVM settings via the
Each entry in the
server.properties file can be changed by passing the
appropriate variable. To make it easier to remember and configure, the variable
representation of each entry is in uppercase, and uses underscore instead
The server port cannot be changed. This has to be remapped when starting an
For reference, here is the list of environment variables for
that you can set:
Extending this image
This image is meant to be extended for packaging custom maps and modpacks as
If you wish to do so, here are some things you will need to know:
This is where all server related artifacts go, and its default location is
/opt/minecraft. If you are building a Docker image for a modpack, you will
want to copy the modpack distribution here.
This Docker image supports the use of world templates, which is useful for
custom maps. You will want to copy your world template to
During startup, it will check if
/var/lib/minecraft is empty. If so, it will
create a copy of the world template on this folder.
Modpacks will require a specific Minecraft version in order to work. This can
be done setting the
MINECRAFT_VERSION in your Dockerfile.
When packaging a modpack, you will need to start the server using a different
jar file. To specify the startup jar, set the
in your Dockerfile.
Some modpacks have their own recommended JVM settings. You can include them
MINECRAFT_OPTS variable in your Dockerfile.
It is good practice to declare the
MINECRAFT_HOME folder as a data volume on
your Dockerfile. This makes it easier for server admins to customize the
Supported Docker versions
This image has been tested on Docker version 1.1.1.
Feel free to open a Github issue.
If you wish to contribute, you may open a pull request.