docker-minecraft-bedrock-server icon indicating copy to clipboard operation
docker-minecraft-bedrock-server copied to clipboard

port changes back to 19132 regardless of set values

Open TekoXVI opened this issue 1 year ago • 12 comments

If I change the port in the docker compose file and in server.properties, it gets changed back to 19132 when the server starts. Is this by design? My ISP has 19132 locked so I need to use a different one.

TekoXVI avatar Dec 11 '24 03:12 TekoXVI

Please provide compose file that you tried. Also, keep in mind that the port mapping is what matters more where the left hand value of the mapping, "host_port", can be whatever value you want

host_port:19132/udp

itzg avatar Dec 11 '24 04:12 itzg

This probably is because of enable-lan-visibility=true in the settings, which causes the server to also register on the default ports. It will still be available on the defined ports though.

normen avatar Jan 02 '25 22:01 normen

After setting server-port=19123 in server.properties and starting up the container it overwrites the setting in the server.properties file

server-port=19132
# Which IPv4 port the server should listen to.
# Allowed values: Integers in the range [1, 65535]

server-portv6=19124
# Which IPv6 port the server should listen to.
# Allowed values: Integers in the range [1, 65535]

enable-lan-visibility=false
bds-1  | [2025-05-24 12:22:13:702 INFO] IPv4 supported, port: 19132: Used for gameplay and LAN discovery
bds-1  | [2025-05-24 12:22:13:702 INFO] IPv6 supported, port: 19124: Used for gameplay

However if I set environment: SERVER_PORT: "19123" in the compose.yaml it keeps/changes the server.properties to that setting. And since this is running only one instance per container maybe note in the documentation that changing the ports in server.properties is not recommended and to just change the host_port to the value wanted (as you mentioned here)

CoolJoe72 avatar May 24 '25 19:05 CoolJoe72

If I change the port in the docker compose file and in server.properties, it gets changed back to 19132 when the server starts. Is this by design? My ISP has 19132 locked so I need to use a different one.

Not sure how you're opening your computer up to the internet (hopefully not DMZ) but if you're using port forwarding on your router just change the external port to what you want to use.

CoolJoe72 avatar May 24 '25 19:05 CoolJoe72

I have the same issue, I changed the port and when I log in to Minecraft Client, i get all kind of warnings like. It seems like the server is full (which its not) or world can not be found etc. When changing the port back to default it works. I need to be able to change the port as I want to run multiple Minecraft Servers and are depended on the port change.

In the log it says: [2025-07-04 11:22:37:122 INFO] IPv4 supported, port: 19121: Used for gameplay

[2025-07-04 11:22:37:122 INFO] IPv6 not supported

Port is set in Portainer UI, in Environment and in the server.properties itself

Xentros avatar Jul 04 '25 12:07 Xentros

First, big thanks to @itzg for developing amazing docker products and for all the support you provide to users. I appreciate you.

I also have the same issue. I have multiple maps I’d like to be available simultaneously to my kids and their friends. Currently I have loaded the .mcworld maps into the one working instance. To switch worlds, I bring be container down, edit the yml, and back up again in the new world. Any help would be greatly appreciated!

DermotMonaghan avatar Jul 24 '25 03:07 DermotMonaghan

I run multiple containers with different ports no problem, I can also connect to all of them with the iPad version of Minecraft - the only problem is that the PS5 version of Minecraft doesn't recognize the servers on non-default ports anymore. So I resorted to have them all on non-default ports and running a bridge (phantom) that connects to the server we want to play on, serving that one on the default ports. That of course means that I can only play on one server at a time with any PS5.

normen avatar Jul 24 '25 14:07 normen

Thank you @normen! My kids also use iPad clients. Are you running image itzg/minecraft-bedrock-server:latest or an older version?

Would appreciate you sharing contents of one of your yml files to try this workaround. 🙏

DermotMonaghan avatar Jul 24 '25 14:07 DermotMonaghan

services:
  server:                                                                                                                                 
    image: itzg/minecraft-bedrock-server                     
    logging:                                                 
      options:                                               
        tag: "{{.Name}}"                                     
    container_name: "${SERVER_NAME}"                         
    env_file:                                                
      - .env                                                 
    restart: always                                          
    network_mode: host
    stdin_open: true                                         
    tty: true
    volumes:                                                 
      - "/home/normen/minecraft/data/${SERVER_NAME}:/data"   
      - /etc/timezone:/etc/timezone:ro                       
      - /etc/localtime:/etc/localtime:ro                     
    deploy:                                                  
      resources:                                             
        limits:                                              
          memory: 4G                                         

normen avatar Jul 24 '25 18:07 normen

Many thanks @normen! 🙏

I tried your approach with no luck, port 19133 still gets activated in the docker instance as outlined by @CoolJoe72. Perhaps you’re connecting via the local network? Or there’s something in your env file that I’m missing.

DermotMonaghan avatar Jul 25 '25 16:07 DermotMonaghan

Many thanks @normen! 🙏

I tried your approach with no luck, port 19133 still gets activated in the docker instance as outlined by @CoolJoe72. Perhaps you’re connecting via the local network? Or there’s something in your env file that I’m missing.

You shouldn't need to change the ports in your env file just set up your PORTS with docker

docker run -d -it -e EULA=TRUE -p 19155:19132/udp  …
services:
  bds:
    image: itzg/minecraft-bedrock-server
    environment:
      EULA: "TRUE"
    ports:
      - "19155:19132/udp"  # <- change the first port number here
    volumes:
      - ./data:/data
    stdin_open: true
    tty: true

CoolJoe72 avatar Jul 25 '25 16:07 CoolJoe72

Many thanks @normen! 🙏

I tried your approach with no luck, port 19133 still gets activated in the docker instance as outlined by @CoolJoe72. Perhaps you’re connecting via the local network? Or there’s something in your env file that I’m missing.

Only relevant .env lines would be these:

SERVER_NAME="MyWorld"
SERVER_PORT=19136
SERVER_PORT_V6=19137
ENABLE_LAN_VISIBILITY=true

normen avatar Jul 25 '25 16:07 normen