A Docker container to run Minecraft Bedrock Server.
This docker can be executed easily
Pull the docker image:
docker pull firzenyogesh/minecraft-bedrock
Start the container:
docker run -d -it --network=host firzenyogesh/minecraft-bedrock
The above method is to start the server quick. There is a chance that you will lose your world's progress, if this container is updated (eg. new server version). To overcome that we use volume. We mount on a path that is outside the container
docker run -d -it -v "/minecraft:/srv/minecraft" --network=host firzenyogesh/minecraft-bedrock
/minecraft is the path to mount in your machine. Change the path to your preference
This will create the folders
properties_for_worldsin the path
This will create the files
valid_known_packs.jsonin the path
If you have custom properties for the existing world like different
permissions.json, these files go inside the path
worldnameis your existing world name. The container will use these files if you provide them in this path, otherwise it will use the default properties.
These files and folders are generated to easliy import your existing mods and worlds to the container.
It is recommended to run the above mentioned command once, before importing your existing worlds and mods.
You can however do that without running the command, provided you have copied the
worlds folders from your existing server to the path
/minecraft. If this is not done the server won't start. So make sure that atleast
behavior_packs are there in the
By doing this you can safely retain your worlds and mods, even if this container is destroyed or upgraded or redeployed when needed.
If you want your world to have different name, start the container like this:
docker run -d -it -e WORLD=worldname --network=host firzenyogesh/minecraft-bedrock
If you want run on different port, start the container like this:
docker run -d -it -e PORT=19132 -e PORTv6=19133 --network=host firzenyogesh/minecraft-bedrock
A full docker command with all the variables put in:
docker run -d -it -e WORLD=worldname -e PORT=19132 -e PORTv6=19133 -v "/minecraft:/srv/minecraft" --network=host firzenyogesh/minecraft-bedrock
worldname with what you prefer.
/minecraft to the path you prefer.
To stop the
docker attach <container id>
Once the container is attached run the command
Stop, you should be seeing Quit correctly message
To get out of the attached container use
Ctrl + p + q, if you use other combination it may not work.
To stop the container
docker container stop <container id>
You can get the container id by running the following command
docker ps | grep firzenyogesh/minecraft-bedrock
This will list only the server container, use the container id you get in the result of that command.
Hope this helps out everyone, and Happy Minecrafting ⛏️