GithubHelp home page GithubHelp logo

itzg / docker-minecraft-bedrock-server Goto Github PK

View Code? Open in Web Editor NEW
1.1K 1.1K 205.0 243 KB

Containerized Minecraft Bedrock Dedicated Server with selectable version

License: MIT License

Dockerfile 25.98% Shell 74.02%
docker-image hacktoberfest minecraft

docker-minecraft-bedrock-server's Introduction

Docker Pulls GitHub Issues Build Discord

Quickstart

The following starts a Bedrock Dedicated Server running a default version and exposing the default UDP port:

docker run -d -it -e EULA=TRUE -p 19132:19132/udp -v mc-bedrock-data:/data itzg/minecraft-bedrock-server

NOTE: if you plan on running a server for a longer amount of time it is highly recommended using a management layer such as Docker Compose or Kubernetes to allow for incremental reconfiguration and image upgrades.

Upgrading to the latest Bedrock server version

With the VERSION variable set to "LATEST", which is the default, then the Bedrock server can be upgraded by restarting the container. At every startup, the container checks for the latest version and upgrades, if needed.

The latest preview version can be requested by setting VERSION to "PREVIEW".

Looking for a Java Edition Server

For Minecraft Java Edition you'll need to use this image instead:

itzg/minecraft-server

Environment Variables

Container Specific

  • EULA (no default) : must be set to TRUE to accept the Minecraft End User License Agreement
  • VERSION (default is LATEST) : can be set to a specific server version or the following special values can be used:
    • LATEST : determines the latest (non-preview) version and can be used to auto-upgrade on container start
    • PREVIEW : determines the latest preview version and will auto-upgrade
    • otherwise any specific server version can be provided. If it is a preview version, also set PREVIEW to "true"
  • UID (default derived from /data owner) : can be set to a specific user ID to run the bedrock server process
  • GID (default derived from /data owner) : can be set to a specific group ID to run the bedrock server process
  • TZ (no default): can be set to a specific timezone like America/New_York. This will set the timezone for the Docker container and therefore their logs. Addtionally, if you want to sync the time with the host, you can mount the /etc/localtime file from the host to the container like /etc/localtime:/etc/localtime:ro.
  • PACKAGE_BACKUP_KEEP (2) : how many package backups to keep

Server Properties

The following environment variables will set the equivalent property in server.properties, where each is described here. Typically, each property is configured instead by the UPPER_SNAKE_CASE equivalent.

  • SERVER_NAME
  • GAMEMODE
  • FORCE_GAMEMODE
  • DIFFICULTY
  • LEVEL_TYPE
  • ALLOW_CHEATS
  • MAX_PLAYERS
  • ONLINE_MODE
  • WHITE_LIST
  • VIEW_DISTANCE
  • TICK_DISTANCE
  • PLAYER_IDLE_TIMEOUT
  • MAX_THREADS
  • LEVEL_NAME
  • LEVEL_SEED
  • DEFAULT_PLAYER_PERMISSION_LEVEL
  • TEXTUREPACK_REQUIRED
  • SERVER_AUTHORITATIVE_MOVEMENT
  • PLAYER_MOVEMENT_SCORE_THRESHOLD
  • PLAYER_MOVEMENT_DISTANCE_THRESHOLD
  • PLAYER_MOVEMENT_DURATION_THRESHOLD_IN_MS
  • CORRECT_PLAYER_MOVEMENT
  • MSA_GAMERTAGS_ONLY
  • ITEM_TRANSACTION_LOGGING_ENABLED
  • DISABLE_CUSTOM_SKINS
  • DISABLE_PERSONA
  • CHAT_RESTRICTION
  • OP_PERMISSION_LEVEL
  • COMPRESSION_ALGORITHM
  • BLOCK_NETWORK_IDS_ARE_HASHES

For example, to configure a flat, creative server instead of the default use:

docker run -d -it --name bds-flat-creative \
  -e EULA=TRUE -e LEVEL_TYPE=flat -e GAMEMODE=creative \
  -p 19132:19132/udp itzg/minecraft-bedrock-server

Exposed Ports

  • UDP 19132 : the Bedrock server port. NOTE that you must append /udp when exposing the port, such as -p 19132:19132/udp

Volumes

  • /data : the location where the downloaded server is expanded and ran. Also contains the configuration properties file server.properties

You can create a named volume and use it as:

docker volume create mc-volume
docker run -d -it --name mc-server -e EULA=TRUE -p 19132:19132/udp -v mc-volume:/data itzg/minecraft-bedrock-server

If you're using a named volume and want the bedrock process to run as a non-root user then you will need to pre-create the volume and chown it to the desired user.

For example, if you want the bedrock server to run with user ID 1000 and group ID 1000, then create and chown the volume named "bedrock" using:

docker run --rm -v bedrock:/data alpine chown 1000:1000 /data

If using docker run then simply reference that volume "bedrock" in the -v argument. If using a compose file, declare the volume as an external using this type of declaration:

volumes:
  bedrock:
    external:
      name: bedrock

Connecting

When running the container on your LAN, you can find and connect to the dedicated server in the "LAN Games" part of the "Friends" tab, such as:

Permissions

The Bedrock Dedicated Server requires permissions be defined with XUIDs. There are various tools to look these up online and they are also printed to the log when a player joins. There are 3 levels of permissions and 3 options to configure each group:

  • OPS is used to define operators on the server.
-e OPS="1234567890,0987654321"
  • MEMBERS is used to define the members on the server.
-e MEMBERS="1234567890,0987654321"
  • VISITORS is used to define visitors on the server.
-e VISITORS="1234567890,0987654321"

Allowlist

There are two ways to handle a whitelist:

The first is to set the ALLOW_LIST environment variable to true and map in an allowlist.json file (previously known as "whitelist.json") that is custom-crafted to the container.

The other is to set the ALLOW_LIST_USERS environment variable to a comma-separated list of gamer tag usernames and their corresponding XUIDs. Each username should be followed by its XUID, separated by a colon. The server will use these details to match the player.

There are various tools to look XUIDs up online and they are also printed to the log when a player joins the server.

-e ALLOW_LIST_USERS="player1:1234567890,player2:0987654321"

Mods Addons

Also known as behavior or resource packs, in order to add mods into your server you can follow these steps, tested with OPS (One Player Sleep) and bedrocktweaks

  1. Install the mcpack or mcaddon on the client side first, just to make it easier to copy the files to the server, for Windows 10 files should be located on C:\Users\USER\AppData\Local\Packages\Microsoft.MinecraftUWP_*\LocalState\games\com.mojang.
  2. Copy over the folders of the mods from either behavior_packs or resource_packs into the server's volume.

If you want to install them without using a client you should be able to unzip the mods directly into the server's volume, .mcaddon should go into behavior_packs and .mcpack into resource_packs. Both .mcaddon and .mcpack are actually renamed .zip files.

  1. Lastly create on the server's volume worlds/$level-name/world_behavior_packs.json, you'll need to add an entry for each mod like on the previous manifest.json, we only need the uuid now called pack_id and the version replacing dots with commas and double quotes with [ ].

You can also create a worlds/$level-name/world_resource_packs.json but I have seen that putting both resource and behavior packs inside the same json works just fine

[
	{
		"pack_id" : "5f51f7b7-85dc-44da-a3ef-a48d8414e4d5",
		"version" : [ 3, 0, 0 ]
	}
]
  1. Restart the server and the mods should be enabled now! when connecting you will get a prompt asking if you want to "Download & Join" or just "Join", You need to Download & Join if you want to actually see the new resource pack added to the server. This prompt is exclusive to resource packs as these alter how minecraft looks while behavior packs alter how minecraft functions and don't need to be downloaded or installed on the client side.

If you want to force the resource pack on all clients, there's an option texturepack-required=false in server.properties that should be changed to true. Resource packs can be deleted by going into Settings > Storage > Cached Data, then selecting the pack and clicking on the trash can.

For more information FoxyNoTail did a video explaining the same on a server running on Windows.

More information

For more information about managing Bedrock Dedicated Servers in general, check out this Reddit post.

Executing server commands

This image comes bundled with a script called send-command that will send a Bedrock command and argument to the Bedrock server console. The output of the command only be visible in the container logs.

For example:

docker exec CONTAINER_NAME_OR_ID send-command gamerule dofiretick false

Alternatively, with stdin and tty enabled (such as using -it), attach to the container's console by its name or ID using:

docker attach CONTAINER_NAME_OR_ID

While attached, you can execute any server-side commands, such as op'ing your player to be admin:

gamerule dofiretick false

When finished, detach from the server console using Ctrl-p, Ctrl-q

Deploying with Docker Compose

The examples directory contains an example Docker compose file that declares:

  • a service running the bedrock server container and exposing UDP port 19132. In the example is named "bds", short for "Bedrock Dedicated Server", but you can name the service whatever you want
  • a volume attached to the service at the container path /data
services:
  bds:
    image: itzg/minecraft-bedrock-server
    environment:
      EULA: "TRUE"
    ports:
      - "19132:19132/udp"
    volumes:
      - ./data:/data
    stdin_open: true
    tty: true

Start the server and run in the background using:

docker compose up -d

You can follow the logs at any time using:

docker compose logs -f

Deploying with Kubernetes

The examples directory contains an example Kubernetes manifest file that declares:

  • a peristent volume claim (using default storage class)
  • a pod deployment that uses the declared PVC
  • a service of type LoadBalancer

The pod deployment includes some examples of configuring the server properties via environment variables:

env:
- name: EULA
  value: "TRUE"
- name: GAMEMODE
  value: survival
- name: DIFFICULTY
  value: normal

The file is deploy-able as-is on most clusters, but has been confirmed on Docker for Desktop and Google Kubernetes Engine:

kubectl apply -f examples/kubernetes.yml

You can follow the logs of the deployment using:

kubectl logs -f deployment/bds

Community Solutions

Tutorials

@TheTinkerDad provides an excellent tutorial on how to host multiple instances on a single port (19132) so that it's discoverable: https://www.youtube.com/watch?v=ds0_ESzjbfs

docker-minecraft-bedrock-server's People

Contributors

aivins avatar bb-ricardo avatar breakersun avatar chrisw-dev avatar dependabot[bot] avatar drardin avatar flickerfly avatar foleymic avatar gregtcltk avatar hansenms avatar hyperbolic2346 avatar itzg avatar jacoknapp avatar jasonw4331 avatar jgmoss avatar joeskeen avatar kaiede avatar luisenmarroquin avatar mcjon3z avatar michaelpetik avatar michbeck100 avatar patchoulino avatar pepepaco avatar reallyfatyoshi avatar ronnierap avatar sandym avatar spongecade avatar stuckj avatar vcaboara avatar yuanying avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-minecraft-bedrock-server's Issues

How to enter the command console?

https://bugs.mojang.com/browse/BDS-1264like this,
[2020-01-17 06:54:21 INFO] Starting Server
[2020-01-17 06:54:21 INFO] Version 1.14.1.4
[2020-01-17 06:54:21 INFO] Session ID 70e26961-c28c-4695-9329-ba55d4768f7c
[2020-01-17 06:54:21 INFO] Level Name: 主世界
[2020-01-17 06:54:21 INFO] Game mode: 0 Survival
[2020-01-17 06:54:21 INFO] Difficulty: 3 HARD
[2020-01-17 06:54:23 INFO] IPv4 supported, port: 0
[2020-01-17 06:54:23 INFO] IPv6 supported, port: 0
[2020-01-17 06:54:23 ERROR] Network port occupied, can't start server.
,I have tried disabling ipv6 but it didn't work still.
Despite all this,the server is still running normally(I Can play on the server normally),so how to enter the command console?(My English is poor,sorry(/ω\))

Sending a command without attaching the container

Hello,

I've successfully attached the container and sent commands this way - but I want to write a script that would send a message say "The server will be going down in 5 minutes!" before stopping the container, backing off the data, and restarting it.
Any way to do that (the "send the command from a script" part)?

Thanks!

The requested URL returned error: 404 when using VERSION 1.14

Hi,

I tried editing my docker "VERSION" env var from 1.12 to 1.14, but now when starting the container I get a curl error. It seems that it can't create a nice url for this version.

Downloading Bedrock server 1.14 ...
curl: (22) The requested URL returned error: 404

The first time I started this container, I had a succesful Downloading Bedrock server 1.12.0.28 ... in the logs. I just pulled the latest image from the repo.

Thanks for your help :)

Change the world that the server loads, and reload the server?

Hello, I have been following a long a bit recently while trying to use this project to resurect an old server I had, I have figured out how to us docker runs' -it flag to use the console, and the old ctrl-p + ctrl-q trick to detach without stopping the container, however I would like to boot up an old world I had for my server is it possible at all? when I do run "stop" to stop the server the game the whole container stops, (maybe due to me using the -rm flag as well will try without it and let you guys know)

But otherwise this is an awesome, awesome project will gladly contribute to it what I can if I can.

Game Settings are disabled.

I'm new to this. I'm not sure if this is something that happens with a server but I can't change game settings. Also, are achievements disabled on the Bedrock Server?

Screenshot (2)

stdin not available

I've been successfully running your image on my synology diskstation using this docker-compose.yml:

version: '3.7'

services:
  bedrock:
    image: itzg/minecraft-bedrock-server
    ports:
      - "19132:19132/udp"
    volumes:                                       
      - /volume1/docker/minecraft/data:/data
    environment:
      - EULA=TRUE
      - VERSION=1.12
    restart: always

Everything had been working until I restarted the container, which pulled the latest image. Now I get this on startup and it repeatedly restarts:

time="2019-09-20T16:42:57Z" level=debug msg="Using /data to match uid and gid"
time="2019-09-20T16:42:57Z" level=debug msg="Resolved UID=1026 from match path"
time="2019-09-20T16:42:57Z" level=debug msg="Resolved GID=100 from match path"
time="2019-09-20T16:42:57Z" level=debug msg="failed to read stdin" error=EOF

EULA must be set to TRUE to indicate agreement with the Minecraft End User License
See https://minecraft.net/terms

I don't know what version of the image I was on previously, but I've tried all of the tags you have published and none of them work. I do know I originally got my server working on July 23rd, using whatever was the latest image at that time.

The two possible sources of problems I see are that stdin is end-of-file, so sending "stop" to it doesn't work. And that the environment variables I am configuring are not taking hold (neither EULA, VERSION, nor any arbitrary ones I try to set).

Any clue what might be causing the issues?

Add health check

Please add a health check. A basic TCP port check using netcat nc would be good. Even better would be a admin command to verify status.

Port forwarding in docker? Can’t see server

Hello

Do you why I can’t get my second visible to a client (i.e iOS)?

iPhone and iPad has different view, but both don‘t the server MSCREA :/

———
SURVIVAL

locpath=/Users/marc/docker/minecraft-surv

docker run -d -it -e EULA=TRUE -p 19132:19132/udp -e SERVER_NAME=MSSURVIVAL -e ONLINE_MODE=false -e MAX_PLAYERS=50 -v $locpath:/data -e LEVEL_TYPE=DEFAULT -e GAMEMODE=survival -e DIFFICULT=peaceful --restart unless-stopped --name minecraft-surv itzg/minecraft-bedrock-server

CREATIVE

locpath=/Users/marc/docker/minecraft-crea

docker run -d -it -e EULA=TRUE -p 19135:19132/udp -e SERVER_NAME=MSCREA -e ONLINE_MODE=false -e MAX_PLAYERS=50 -v $locpath:/data -e LEVEL_TYPE=DEFAULT -e GAMEMODE=creative -e DIFFICULT=peaceful --restart unless-stopped --name minecraft-crea itzg/minecraft-bedrock-server

———

FF9414A4-5407-488B-850A-7FC0827EF86C
041515D9-9792-42E9-B3A2-816866B9502F
B0959BB5-3480-4FD2-ADFB-F554371A9E7D

Version 1.14.60.5

Looks like there was a hotfix yesterday and now android clients are getting a warning that the server version is outdated.

The version it shows in the client is 1.14.60.5 so can you provide an update for a pinned ENV version?

I changed the VERSION to LATEST for now but prefer to use pinned versions whenever possible.

Thanks.

Failed to extract download URL

Container today stopped working when trying to restart. Error log is below. Looks like it can't extract the URL from MSFT's download page. I have not debugged it any further yet.

And thanks for maintaining this docker file, it has been working great for me to run a small, private server on GKE for the past months.

--- snip ---

DEBU[0000] Using /data to match uid and gid
DEBU[0000] Resolved UID=0 from match path
DEBU[0000] Resolved GID=0 from match path
Failed to extract download URL 'null' from https://www.minecraft.net/en-us/download/server/bedrock/

Network port occupied, can't start server

Hi there

I tryed your bedrock, and it worked just fine. Until i rebooted the debian box. Now i got this everytime i try to start the bedrock server again "Network port occupied...."
You know why this happens? and maby a way to fix this?

Auki

Random map request

Hello,

I've set up a few docker instances for my kids. One survival, one creative server and I'd like to set another one up with downloaded worlds but want to know if there's anyway I can cycle the worlds randomly when there's no player online. I.e they go on and there's an adventure map for them to play, or they log out and back in again and it's a minigame or puzzle game etc. It'd be a pretty cool festure, is there already a way to do this?

¿How attach to server console?

Hi

Is it possible to enter commands to the minecraft server by attaching to the container? How do we do it? If I attach to the container I don't see that I can enter commands.

I speak of commands for the minecraft server executable, not of commands to the container.
a greeting

Multiple LAN Game instances on a single Docker host with multiple IPs.

I'm trying to figure out how to run multiple instances on a single docker server with multiple IPs. I don't want my kids to have to login so I would like them to show up under LAN Games.

Issue 1 is that if I launch a container and specify an IP address for the server port it doesn't show up under LAN games.
SHOWS UP: -p 19132:19132/udp
DOESN'T SHOW UP: -p 192.168.200.212:19132:19132/udp

When I do "tcpdump" like you've referenced in other replies I do see traffic being received on that IP from my phone even when the server doesn't show up under LAN Games.

Issue 2 is that if I change the server port to say 19135 it doesn't show up under LAN Games either.

I'm also experimenting with "phantom" to see if I can get it to act as a proxy as well but not having much luck with it yet either. https://github.com/jhead/phantom

Thanks

How to run Beta version?

I would like to set the version to the beta 1.15 but when I do it still runs 1.14, what am I doing wrong?

Port Forwarding no longer working

I have tried both of your servers, java and bedrock. The java one works brilliantly I can connect to it remotely and everything like that. I decided to install your bedrock one as my friends all have that version. Initially the server was working and it could be connected to remotely but then I changed my router and now I just cannot get it to be accessed remotely. I have no idea what this could be as the java version still works and I have other things that are being forwarded that also can be accessed remotely without any issues.
Do you have any idea what could be causing it?

Here are the logs for the server

time="2020-05-09T16:13:38+01:00" level=debug msg="Using /data to match uid and gid"
time="2020-05-09T16:13:38+01:00" level=debug msg="Resolved 1000 from environment variable UID"
time="2020-05-09T16:13:38+01:00" level=debug msg="Resolved 100 from environment variable GID"
time="2020-05-09T16:13:38+01:00" level=debug msg="stdin is detached, so forwarding is disabled"
Starting Bedrock server...
NO LOG FILE! - setting up server logging...
[2020-05-09 16:13:39 INFO] Starting Server
[2020-05-09 16:13:39 INFO] Version 1.14.60.5
[2020-05-09 16:13:39 INFO] Session ID 2a7aec4e-ac1e-486f-a432-a9c5740ea122
[2020-05-09 16:13:39 INFO] Level Name: Bedrock level
[2020-05-09 16:13:39 INFO] Game mode: 0 Survival
[2020-05-09 16:13:39 INFO] Difficulty: 2 NORMAL
[2020-05-09 16:13:39 INFO] opening worlds/Bedrock level/db
[2020-05-09 16:13:41 INFO] IPv4 supported, port: 19132
[2020-05-09 16:13:41 INFO] IPv6 not supported
[2020-05-09 16:13:41 INFO] IPv4 supported, port: 59749
[2020-05-09 16:13:41 INFO] IPv6 not supported
[2020-05-09 16:13:43 INFO] Server started.

Issue connecting from iMac

Hi there, i have the server setup and running on my LAN. I am able to connect my Android device on the wifi. My friend can connect from his house on a PC, so i know my forwarding rules are correct.

Unfortunately the two machines that my kids need to use are some old Mac's. :(

I have tried adding the arguments:

-Djava.net.preferIPv4Stack=true

in the JMV arguments, but no joy.

Tried adding the port number to the end of the ip address when connecting, no joy.

Can you let me know if i am barking up the wrong tree? Should i be able to cnnect a Mac java edition to the Bedrock server?

Can't change default port?

Hello,
how can I change the default port?
"-e server-port" doesn't work.


root@ubuntu# docker run -d -it -e EULA=TRUE -p 19135:19135/udp -e server-port=19135 -e online-mode=false -e max-players=50 -v $locpath:/data -e LEVEL_TYPE=DEFAULT -e GAMEMODE=creative -e DIFFICULT=peaceful --restart unless-stopped --name minecraft-crea itzg/minecraft-bedrock-server
e4b26d87c3476c6d98f2cb45bccf3a988e5453cae5ed78ad0e11baa0974b3ae0

root@ubuntu# docker logs minecraft-crea
DEBU[0000] Using /data to match uid and gid
DEBU[0000] Resolved UID=0 from match path
DEBU[0000] Resolved GID=0 from match path
Starting Bedrock server...
NO LOG FILE! - setting up server logging...
[2019-09-02 20:43:52 INFO] Starting Server
[2019-09-02 20:43:52 INFO] Version 1.12.0.28
[2019-09-02 20:43:52 INFO] Session ID 895eafb5-2fd5-4adc-b975-151282c3dcd7
[2019-09-02 20:43:52 INFO] Level Name: Bedrock level
[2019-09-02 20:43:52 INFO] Game mode: 1 Creative
[2019-09-02 20:43:52 INFO] Difficulty: 1 EASY
[2019-09-02 20:43:54 INFO] IPv4 supported, port: 19132
[2019-09-02 20:43:54 INFO] IPv6 not supported
[2019-09-02 20:43:54 INFO] IPv4 supported, port: 58977
[2019-09-02 20:43:54 INFO] IPv6 not supported
[2019-09-02 20:43:55 INFO] Server started.

worlds folder missing / world won't save

Hi,

I'm using your Docker on OMV4 and its running pretty fine. Thanks for your work!
My problem is, that every time my server reboots/the docker image stops/restarts the world and everything my kid has built is gone and a new world is created. I have no worlds folder in my /data folder. I have tried setting up, everything fresh, but it didn't work.

Do you have any idea why that is?

Thanks in advance!

Network port occupied when using local windows volume share

I'm using docker desktop 2.1.0.4 for Windows
Docker version is 19.03.2
Version of Minecraft container is Docker 18.03.1-ee-3 on linux, amd64

I haven't an issue when trying to map a volume back to the local Windows computer where the container always says port is already in use.
E.g this command works fine
docker run -it -e EULA=TRUE -p 19139:19132/udp -v vol1:/data itzg/minecraft-bedrock-server

This command returns the error
docker run -it -e EULA=TRUE -p 19139:19132/udp -v c:/temp:/data itzg/minecraft-bedrock-server

DEBU[0000] Using /data to match uid and gid
DEBU[0000] Resolved UID=0 from match path
DEBU[0000] Resolved GID=0 from match path
DEBU[0000] Forwarding signal signal="window changed"
Starting Bedrock server...
NO LOG FILE! - setting up server logging...
[2019-10-23 14:31:05 INFO] Starting Server
[2019-10-23 14:31:05 INFO] Version 1.12.1.1
[2019-10-23 14:31:05 INFO] Session ID 5f68462a-8c40-4e67-91fd-e5d379eaf8fc
[2019-10-23 14:31:05 INFO] Level Name: Bedrock level
[2019-10-23 14:31:05 INFO] Game mode: 0 Survival
[2019-10-23 14:31:05 INFO] Difficulty: 1 EASY
[2019-10-23 14:31:05 ERROR] Network port occupied, can't start server.
Quit correctly

any idea of the issue, doesn't matter what internal port I try to map to always the same issue, I've also tried a prewritten server.prop file using different ports, this also produced the same error.

QUESTION: How can I access the console once the container is up?

I saw instructions for the non-bedrock version where it says that rcon-cli is active by default. When I tried running the same command with bedrock edition, it says:

OCI runtime exec failed: exec failed: container_linux.go:345: starting container process caused "exec: \"rcon-cli\": executable file not found in $PATH": unknown

Ask for an Configuration Tutorial

Hey, glad to found this docker image to make dedicated server and I'm interesting to try this out. But, is there any step-by-step for server configuration for generating the world?

Thanks!

Docker desktop for Mac, had to forward both TCP and UDP 19132 to container

I am running Docker desktop on macOS. In order to connect (on my LAN) to the bedrock server from my iPhone on port 19132 I had to forward both UDP and TCP. Is this normal?

docker run -d --name=mc -e GAMEMODE=creative -e DIFFICULTY=peaceful -e EULA=TRUE -p 19132:19132/udp -p 19132:19132 -v /Users/davidmcgough/mc:/data itzg/minecraft-bedrock-server

if I exclude either -p argument I cannot connect. I am raising this issue because I don't see any mention of forwarding the TCP port in the directions.

Thanks.

Minecraft noob here; wanting to learn

Hey, first of all: bear with me. I'm a Minecraft noob :).

I'm trying to setup a simple minecraft server for my son (playing on his iOS device). So I think I need to run a bedrock instance, right?

So I tried to start a container using this: docker run -it -v /srv/local/services/minecraft/data:/data -e EULA=TRUE -p 19132:19132/udp itzg/minecraft-bedrock-server. All fine, container running and healthy.

But then what? When I try to connect to the instance from the iOS minecraft game, then I can't connect (by ip address:port). So first thing is trying to find out if the container is actually working fine. So -on the server- I'm trying to do a telnet:

rlommers@server [~]$ telnet localhost 19132
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

Which is a bit strange, right? docker ps outputs this:

8b7721640b4c        itzg/minecraft-bedrock-server   "/usr/local/bin/entr…"   3 minutes ago       Up 3 minutes (healthy)   0.0.0.0:19132->19132/udp                                                     friendly_nobel

So basically my question is: how do I connect to a running instance of a bedrock server on an iOS device?

Can't LAN connect

I was able to succesfully connect with minecraft java edition but I'm unable to get minecraft bedrock edition to work.

# Dockerfile
From itzg/minecraft-bedrock-server

ENV EULA=TRUE
ENV VERSION=LATEST
ENV SERVER_NAME=mannytest
ENV SERVER_PORT=19132
ENV GAMEMODE=0
ENV DIFFICULTY=3

EXPOSE 19132

After I build it, I run:
docker run -p 19132:19132/udp -d minecraft-bedrock

UDP is port forwarded on 19132 from the host machine.

Exact same steps work with the minecraft-java edition except I change the image and I don't include the /udp.

Not sure what additional information would be useful, but appreciate any help.

Failed to process download URL

Getting this error when trying to run image. Could it be related to b136de9, Upgraded easy-add and used templated URLs?

manny@ubuntu:~/docker/minecraft-bedrock$ docker run -p 19132:19132/udp minecraft-bedrock
time="2020-03-02T19:41:36Z" level=debug msg="Using /data to match uid and gid"
time="2020-03-02T19:41:36Z" level=debug msg="Resolved UID=0 from match path"
time="2020-03-02T19:41:36Z" level=debug msg="Resolved GID=0 from match path"
time="2020-03-02T19:41:36Z" level=debug msg="stdin is detached, so forwarding is disabled"
2020/03/02 19:41:37 Unable to find an element with attribute matcher data-platform=serverBedrockLinux
Failed to process download URL
manny@ubuntu:~/docker/minecraft-bedrock$

Operators not loaded from permissions.json

Hi
I have currently a problem with the bedrock server:
The operator permission is not granted when the user listed is in the permissions.json file.
The permissions file looks like this:
[{"permission": "operator", "xuid": "1234123412341234"}, {"permission": "operator", "xuid": "1234123412341234"}]
(The whitelist works, so i think the XUID is correct)

Do you have an idea what could be the problem?

Server not showing up under LAN when specific IP address selected for port

So I am trying to run more than one version of the server in docker. One that is set to creative mode and one that is set to survival mode.

To allow port 19132 to be the default I added a couple of IP addresses to my host. Then I bind a specific IP address to each docker container. When I do this the server does not show up under LAN games. If I do not specify the IP address it shows up fine.

For example...

This command will work fine:

docker run  --name mc-survival --restart=unless-stopped  -e EULA=TRUE -v /opt/docker-minecraft/survival:/data -p 19132:19132/udp itzg/minecraft-bedrock-server

This command will run the container fine and I can use it if I define it as a server but it does not show up as a LAN game:

docker run  --name mc-survival --restart=unless-stopped  -e EULA=TRUE -v /opt/docker-minecraft/survival:/data -p 192.168.94.13:19132:19132/udp itzg/minecraft-bedrock-server

I've specified the port in server.properties. I also use a whitelist.json but that shouldnt matter.

Are there other ports I need to expose on that IP address?

As mentioned the server runs fine. Can connect and use it if I manually specify it. I just want it to show up under LAN games so that my kids can find it easily (and any others I create).

Upgrade to 1.13

Hi!
Is there a way to upgrade an existing server (1.12) to the next version (1.13)?

Network Port Occupied

Just pulled the docker image however when I launch the container I am having an issue with the "network port occupied".

minecraft | time="2019-09-05T09:27:15-04:00" level=debug msg="Using /data to match uid and gid"
minecraft | time="2019-09-05T09:27:15-04:00" level=debug msg="Resolved UID=1000 from match path"
minecraft | time="2019-09-05T09:27:15-04:00" level=debug msg="Resolved GID=1001 from match path"
minecraft | time="2019-09-05T09:27:15-04:00" level=debug msg="failed to read stdin" error=EOF
minecraft | Starting Bedrock server...
minecraft | NO LOG FILE! - setting up server logging...
minecraft | [2019-09-05 09:27:16 INFO] Starting Server
minecraft | [2019-09-05 09:27:16 INFO] Version 1.12.1.1
minecraft | [2019-09-05 09:27:16 INFO] Session ID 38380653-3312-4b55-b975-08139ed45610
minecraft | [2019-09-05 09:27:16 INFO] Level Name: Bedrock level
minecraft | [2019-09-05 09:27:16 INFO] Game mode: 1 Creative
minecraft | [2019-09-05 09:27:16 INFO] Difficulty: 1 EASY
minecraft | [2019-09-05 09:27:18 INFO] IPv4 supported, port: 0
minecraft | [2019-09-05 09:27:18 INFO] IPv6 supported, port: 0
minecraft | [2019-09-05 09:27:18 ERROR] Network port occupied, can't start server.
minecraft | Quit correctly

Kubernetes example not working

When I updated the k8s example, I must not have tested the final version, because it does not work. The indentation is off and the flag format for the probs is not properly broken up.

I have it corrected and will file a PR.

server.properties not being set

image

Environment variables,
unable to set to creative mode
unable to set default player to operator
unable to set chests on
Server name does work
Online mode does work

Port wont open

Describtion: Minecraft server with 150+ mods / Host can join but others can´t / Server properties are correct, already tried to set server ip to his local ip but didnt change anything

I have no clue if this is the right section for this to be posted, however, i got a problem with my port forwarding.

I know how to set up a port forwarding, have done it many times and always worked, but now on a different pc in a different network, it just wont work, i checked if the port was open with https://canyouseeme.org/ and it told me that its not open.

So i opened the same port in the firewall, didnt change anything tho and now i have no clue what to do??

Please correct me if this is in the false category

How to make someone OP using docker attach

Hello! Excellent work on this project. I have read that rcon-cli is not supported and your workaround was to use docker attach. I added the two lines to my compose file and I'm able to attach to the container but I can't figure out how to issue commands. In rcon-cli I would issue /op to set the operator. How can I do that using docker attach?

/opt/bedrock-entry.sh: line 65: /data/bedrock_server-1.14.1.4: Permission denied

Hello!

Trying to run the this docker image with the command below and I get the below error constantly regardless of what permissions (even 777) I give the local folder, I've also tried it with 'root' as the owner. I've tried with different versions but this doesn't have any effect.

docker run -d -e EULA=TRUE -v /home/ginge/docker/minecraft:/data -p 19132:19132/udp itzg/minecraft-bedrock-server

time="2019-12-30T08:54:47Z" level=debug msg="Using /data to match uid and gid"
time="2019-12-30T08:54:47Z" level=debug msg="Resolved UID=1000 from match path"
time="2019-12-30T08:54:47Z" level=debug msg="Resolved GID=100 from match path"
time="2019-12-30T08:54:47Z" level=debug msg="stdin is detached, so forwarding is disabled"
Starting Bedrock server...
/opt/bedrock-entry.sh: line 65: /data/bedrock_server-1.14.1.4: Permission denied

The image runs fine if I don't set a volume...

Any ideas?

Port for Armv7/RPi

Is there any build for the Raspberry Pi/ARMv7 like there is for the Java Edition? I'd like to run this off of my RPi4b if possible but the regular build fails with standard_init_linux.go:211: exec user process caused "exec format error"

Docker container quitting immediately after starting

Hello! First off, thanks for this! My kids have been enjoying this very much. However, recently my container quits. Here are the docker logs:

time="2020-03-25T15:27:54Z" level=debug msg="Using /data to match uid and gid"
time="2020-03-25T15:27:55Z" level=debug msg="Resolved UID=1000 from match path"
time="2020-03-25T15:27:55Z" level=debug msg="Resolved GID=1000 from match path"
time="2020-03-25T15:27:55Z" level=debug msg="stdin is detached, so forwarding is disabled"
2020/03/25 15:27:55 Unable to find an element with attribute matcher data-bi-prtid=serverBedrockLinux
Failed to process download URL

Any ideas? I'm not the most docker proficient but I'm learning!

Docs: Backups

I just upgraded DockerDesktop and it blew away my kubernetes config including the PV/PVC. Doing a backup of this is not something I'm clear on how to accomplish. Is there any guidance that could be provided in documentation about how to effectively backup a Minecraft world deployed in this manner would be most welcome.

Issues with connecting to server.

I keep getting this error from all clients when trying to connect to this server:
you need to authenticate to microsoft servers

I am not sure how to fix this? Any Ideas?

port issue

hello,
just to clarify im not a huge tech guy but I can do enough to get by. Im pretty sure im doing something wrong here but when I try and run 2 minecraft servers simultaneously (1 x creative and 1 x survival) I can't get the 2nd instance to run.
it's basically the same as the first which is running but configured to -p 19120:19132/udp.
When I run this the log gives me the following:
time="2019-12-17T16:33:32Z" level=debug msg="Using /data to match uid and gid"
time="2019-12-17T16:33:32Z" level=debug msg="Resolved UID=0 from match path"
time="2019-12-17T16:33:32Z" level=debug msg="Resolved GID=0 from match path"
time="2019-12-17T16:33:32Z" level=debug msg="stdin is detached, so forwarding is disabled"
Starting Bedrock server...
NO LOG FILE! - setting up server logging...
[2019-12-17 16:33:33 INFO] Starting Server
[2019-12-17 16:33:33 INFO] Version 1.14.0.9
[2019-12-17 16:33:33 INFO] Session ID a88f5299-54e7-42ab-b41c-45349f4914c8
[2019-12-17 16:33:33 INFO] Level Name: My World
[2019-12-17 16:33:33 INFO] Game mode: 0 Survival
[2019-12-17 16:33:33 INFO] Difficulty: 1 EASY
[2019-12-17 16:33:35 INFO] IPv4 supported, port: 0
[2019-12-17 16:33:35 INFO] IPv6 supported, port: 0
[2019-12-17 16:33:35 ERROR] Network port occupied, can't start server.

What am I doing wrong?

Support for ARM

Hey!

awesome work with both java and bedrock, great fun and great success. I was wondering if it is in your plans to add arm support (as in java version) for the bedrock edition :)

Best regards,
Pedro

Bedrock version is constantly disconnected

I have the same setup for my Java version excep that I changed everything to UDP. I get these logs

Downloading Bedrock server version 1.14.60.5 ...
2020/05/14 16:27:38 Setting difficulty to normal in server.properties
2020/05/14 16:27:38 Setting max-players to 16 in server.properties
2020/05/14 16:27:38 Setting default-player-permission-level to operator in server.properties
Starting Bedrock server...
NO LOG FILE! - setting up server logging...
[2020-05-14 16:27:38 INFO] Starting Server
[2020-05-14 16:27:38 INFO] Version 1.14.60.5
[2020-05-14 16:27:38 INFO] Session ID 66254136-498c-407e-979a-f5f55155efe3
[2020-05-14 16:27:38 INFO] Level Name: Bedrock level
[2020-05-14 16:27:38 INFO] Game mode: 0 Survival
[2020-05-14 16:27:38 INFO] Difficulty: 2 NORMAL
[2020-05-14 16:27:38 INFO] opening worlds/Bedrock level/db
[2020-05-14 16:27:53 INFO] IPv4 supported, port: 19132
[2020-05-14 16:27:53 INFO] IPv6 not supported
[2020-05-14 16:27:53 INFO] IPv4 supported, port: 44642
[2020-05-14 16:27:53 INFO] IPv6 not supported
[2020-05-14 16:27:54 INFO] Server started.
[2020-05-14 16:29:52 INFO] Player connected: mjwrazor, xuid: 2535409695687979
[2020-05-14 16:30:03 INFO] Player disconnected: mjwrazor, xuid: 2535409695687979
[2020-05-14 16:30:12 INFO] Player connected: mjwrazor, xuid: 2535409695687979
[2020-05-14 16:30:23 INFO] Player disconnected: mjwrazor, xuid: 2535409695687979
[2020-05-14 16:32:48 INFO] Player connected: mjwrazor, xuid: 2535409695687979
[2020-05-14 16:32:59 INFO] Player disconnected: mjwrazor, xuid: 2535409695687979
[2020-05-14 16:33:06 INFO] Player connected: mjwrazor, xuid: 2535409695687979
[2020-05-14 16:33:17 INFO] Player disconnected: mjwrazor, xuid: 2535409695687979

Where my character is instantly kicked out.
my kubernetes file is

apiVersion: apps/v1
kind: StatefulSet
metadata:
  labels:
    instance: game-1
  name: game-statefulset-1
spec:
  serviceName: game-svc-1
  selector:
    matchLabels:
      instance: game-1 # has to match .spec.template.metadata.labels
  template:
    metadata:
      labels:
        instance: game-1 # has to match .spec.selector.matchLabels
    spec:
      terminationGracePeriodSeconds: 30
      containers:
      - image: itzg/minecraft-bedrock-server:latest
        name: game-server-1
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 19132
        resources:
          limits:
            memory: 2Gi
            cpu: 1800m
          requests:
            memory: 2Gi
            cpu: 1600m
        env:
        - name: EULA
          value: 'TRUE'
        - name: VERSION
          value: '1.14'
        - name: DIFFICULTY
          value: normal
        - name: MAX_PLAYERS
          value: '16'
        - name: DEFAULT_PLAYER_PERMISSION_LEVEL
          value: 'operator'

        # SERVER CONFIG
        - name: MEMORY
          value: 2G
        readinessProbe:
          exec:
            command: 
              - /usr/local/bin/mc-monitor
              - status-bedrock 
              - --host 
              - 127.0.0.1
              - --port 
              - "19132"
          initialDelaySeconds: 120
          periodSeconds: 60
          failureThreshold: 10
        livenessProbe:
          exec:
            command: 
              - /usr/local/bin/mc-monitor
              - status-bedrock 
              - --host 
              - 127.0.0.1
              - --port
              - "19132"
          initialDelaySeconds: 120
          periodSeconds: 60
          failureThreshold: 10
        volumeMounts:
        - name: game-server-storage-1
          mountPath: /data
      # Make sure and set Volumes in patch, dif requirements per provider
      volumes:
      - name: game-server-storage-1
        persistentVolumeClaim:
          claimName: game-server-pvc-1

The server has 2cpu and 4gb of ram. only 2.2gb are able to allocate on that node

Build on an arm64 Odroid C2

Hello,

I tried to build the MC-Server image with your dockerfile and it stopps at step 15 with this error:

Step 15/17 : COPY *.sh /opt/
COPY failed: no source files were specified

Here is my dockerfile:

FROM debian

ARG ARCH=arm64

RUN apt-get update &&
DEBIAN_FRONTEND=noninteractive apt-get install -y
curl
unzip
jq
&& apt-get clean

EXPOSE 19132/udp

VOLUME ["/data"]

WORKDIR /data

ENTRYPOINT ["/usr/local/bin/entrypoint-demoter", "--match", "/data", "--debug", "--stdin-on-term", "stop", "/opt/bedroc$
ARG EASY_ADD_VERSION=0.5.0
ADD https://github.com/itzg/easy-add/releases/download/${EASY_ADD_VERSION}/easy-add_${EASY_ADD_VERSION}linux${ARCH} /$RUN chmod +x /usr/local/bin/easy-add

RUN easy-add --var version=0.2.1 --var app=entrypoint-demoter --file entrypoint-demoter --from https://github.com/itzg/$
RUN easy-add --var version=0.1.1 --var app=set-property --file set-property --from https://github.com/itzg/{{.app}}/rel$
ARG RESTIFY_VERSION=1.2.0
RUN easy-add --var version=1.2.0 --var app=restify --file restify --from https://github.com/itzg/{{.app}}/releases/down$
COPY *.sh /opt/

COPY property-definitions.json /etc/bds-property-definitions.json

'#' Available versions listed at
'#' https://minecraft.gamepedia.com/Bedrock_Edition_1.11.0
'#' https://minecraft.gamepedia.com/Bedrock_Edition_1.12.0
'#' https://minecraft.gamepedia.com/Bedrock_Edition_1.13.0
'#' https://minecraft.gamepedia.com/Bedrock_Edition_1.14.0
ENV VERSION=LATEST

And my build command:

sudo docker build -t 'minecraft' .

What did I wrong?

LAN connection issues

I am running this docker container from a local home server, and for the most part it works wonderfully. My problem is connecting as a LAN game (which is necessary to play on the xbox). I can enter the IP address form my Windows 10 machine and connect just fine, but it does not show up on LAN. I thought it might be a firewall, but the issue persists even after disabling my firewall, any ideas how I can debug this? Thanks!

EDIT: Actually, I'm not sure I was actually able to disable the Firewall, as that messes with Docker (I'm using iptables). I did follow in a similar discussion and while docker ps and lsof both seem fine, the tcpdump command is empty

tcpdump -v udp port 19132
dropped privs to tcpdump
tcpdump: listening on docker_gwbridge, link-type EN10MB (Ethernet), capture size 262144 bytes

Resource_Packs and Behavior_Packs

Hi,

the container with the Bedrock server works great and stable. For a few players and not too large worlds, it even fits into a Google g1-small instance. Which means you can run it a full year with the free Google cloud quota totally at zero cost.
Here comes the problem:

I am trying to add Add-Ons (Resource&Behavior) to a server. Loading them via the clients fails, or I don't get it right.
So I tried loading them directly into the filesystem of the running container and then restarted the container.

docker exec -i -t container_name bash
root@***:/data# ls -l resource_packs/CYBERTRUCK/
total 264
drwxr-xr-x 2 root root 4096 Dec 18 15:18 animations
drwxr-xr-x 2 root root 4096 Dec 18 15:18 entity
-rw-r--r-- 1 root root 484 Nov 26 12:48 manifest.json
drwxr-xr-x 2 root root 4096 Dec 18 15:18 materials
drwxr-xr-x 3 root root 4096 Dec 18 15:18 models
-rw-r--r-- 1 root root 225439 Nov 26 12:48 pack_icon.png
drwxr-xr-x 2 root root 4096 Dec 18 15:18 render_controllers
drwxr-xr-x 3 root root 4096 Dec 18 15:18 sounds
-rw-r--r-- 1 root root 397 Nov 26 13:16 sounds.json
drwxr-xr-x 2 root root 4096 Dec 18 15:18 texts
drwxr-xr-x 4 root root 4096 Dec 18 15:18 textures

root@****:/data# ls -l behavior_packs/CYBERTRUCK/
total 232
drwxr-xr-x 2 root root 4096 Dec 18 15:16 entities
-rw-r--r-- 1 root root 444 Nov 26 12:47 manifest.json
-rw-r--r-- 1 root root 225439 Nov 26 12:48 pack_icon.png

docker stop/start container_name

NO SUCCESS

If I understand the documentation right, the server is browsing these directories and lists the found resources in the /data/valid_known_packs.json file. However, the manually installed resources and behavior packs are simply not loaded. Also nothing that I found in the log files.

I am not sure if this is actually a bug or if I misunderstood the Bedrock Add-On concept. In case of the latter, please excuse my question here.

Thanks a million for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.