lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.89k stars 269 forks source link

Server not listed in game #661

Closed MrDonkey07 closed 5 months ago

MrDonkey07 commented 5 months ago

Just getting started with this, but I can't seem to access the server from in-game. I configured the container through Portainer with the only other setup step being the directory creation/permissions for /mnt/data/valheim/. Router is configured to forward 2456-2458 udp.


    image: ghcr.io/lloesche/valheim-server
    container_name: valheim
    cap_add:
      - sys_nice
    environment:
      - TZ=America/Chicago
      - SERVER_NAME=donkeysserver
      - SERVER_PORT=2456
      - WORLD_NAME=donkeysworld
      - SERVER_PASS=donkeypassword
      - SERVER_PUBLIC=true
      - SUPERVISOR_HTTP=true
      - SUPERVISOR_HTTP_PASS=mypassword
    volumes: 
      - /mnt/data/valheim/config:/config
      - /mnt/data/valheim/data:/opt/valheim
    ports: 
      - "2456:2456/udp"
      - "2457:2457/udp"
      - "2458:2458/udp"
      - "9001:9001/tcp"
    logging:
      driver: "json-file"
      options:
        max-size: "5M"
    restart: always
    stop_grace_period: 2m

I can access the supervisor page just fine and can see in the logs that the server is supposedly connected.

`Feb 16 15:07:45 supervisord: valheim-server 02/16/2024 15:07:45: Game server connected`

Is there anything I should look for in the logs to determine the issue? I assume it is network related, but other than the udp ports I don't see any other required steps.
MrDonkey07 commented 5 months ago

I should add that my intention is to add the crossplay flag, but first I just want to make sure I can get this working.

MrDonkey07 commented 5 months ago

For anyone that runs into this in the future, this issue #629 led me to the solution.

Reiterating what was said there: Changing the environment variables from - SERVER_NAME=donkeysserver to SERVER_NAME: donkeysserver solved it. No idea why, but this worked.