7 Days to Die - Not listening on Game Port when running in Docker

  • Last Post 06 July 2021
  • Topic Is Solved
AbhorrentJoel posted this 18 June 2021

OS Name/Version: Ubuntu 20.04.2 LTS

Product Name/Version: AMP v2.1.1.8

Problem Description: Starting the server while in Docker does not listen on the game port, at least according to netstat. What this means is that it is impossible to connect - any connection will timeout.

While in Docker, netstat shows this:

root@[removed]:~# netstat -ultp | grep 7Days
tcp        0      0 *               LISTEN      24539/7DaysToDieSer
udp        0      0 *                           24539/7DaysToDieSer
udp6       0      0 [::]:27019              [::]:*                              24539/7DaysToDieSer

As can be seen above, 27017 UDP and TCP (game port) is absent.

I created a new instance without Docker and the problem appears to no longer persist - netstat shows:

root@[removed]:~# netstat -ultp | grep 7Days
tcp        0      0 *               LISTEN      21044/7DaysToDieSer
tcp        0      0 *               LISTEN      21044/7DaysToDieSer
udp     3072      0 *                           21044/7DaysToDieSer
udp        0      0 *                           21044/7DaysToDieSer
udp        0      0 [removed]:53748*                           21044/7DaysToDieSer
udp6       0      0 [::]:27019              [::]:*                              21044/7DaysToDieSer

It is possible to connect without Docker.

Steps to reproduce:

  • Install AMP (enable Docker for instances)
  • Create a new instance for 7 Days to Die
  • Start the server
  • Check netstat to see if it is listening

Actions taken to resolve so far:

  • Made a new instance without Docker (workaround) and it works fine (as above).
  • Added custom ports for [UDP] Game+1 and Game+2 - no longer times out, but states server is not initialised because game port is not showing as listening.
  • Attempted to use a specific IP address (as opposed to without success.
  • Attempted to pull latest Docker image (already latest).

I may have missed something obvious, but I can't remember if I ever got 7 Days to Die working in Docker before. Last time I used it was probably without Docker.

Hopefully this is not a duplicate post.

Order By: Standard | Newest | Votes
AbhorrentJoel posted this 22 June 2021

If I docker exec -it AMP_SevenDays02 bash to enter the 7 Days container and run the server as amp user in the /AMP/7d2d/294420 directory with ./startserver.sh -configfile=serverconfig.xml (which uses the config generated by AMP), it appears to run normally and listens on the game port - it is possible to connect.

I am not entirely sure of the implications yet, but running within the container itself does not immediately appear to be a problem.

Mike posted this 22 June 2021

AMP doesn't use the .sh file to start the server, it starts the executable directly.

AbhorrentJoel posted this 22 June 2021

Yes, I know that. It was just a test to show that executing using the .sh file in Docker works while executing from AMP does not.

Mike posted this 22 June 2021

What about executing it inside the container but starting it the way AMP does?

Also you can configure AMP to produce startup scripts that more closely mimic what it's doing - running one of those would be more useful in case it's an environment issue.

AbhorrentJoel posted this 22 June 2021

I was just in the process of doing that. Looks like using the same parameters as AMP does not get it to listen on the game port.

At least when in Docker, there is something specific in the startserver.sh that allows it to work unlike the given parameters which would normally work outside of Docker.

AbhorrentJoel posted this 22 June 2021

I took a bit of a break and returned to it. As suspected, it looks like the following must be set when running else it won't work properly:


This seems to be important when running in Docker. I am not very confident with Docker, but my guess is that the library it needs does not exist outside the directory with the server executable in the container while it does on the host.

Perhaps you could advise on a solution?

AbhorrentJoel posted this 25 June 2021

Mike, I've come back to it and the temporary solution I have is to create .bash_profile under the .virtualhome directory and populate it with:

export LD_LIBRARY_PATH=/AMP/7d2d/294420

As far as I am aware, the docker image already contains the necessary libstdc++. Regardless, it seems necessary to populate the .bash_profile in order for the server to launch properly in Docker.

Mike posted this 27 June 2021

Odd, normally LD_LIBRARY_PATH should be set anyway. I'll take a look at what's going on there.

AbhorrentJoel posted this 02 July 2021

Any update on this one? I did do a fresh install of AMP on a VM (running Ubuntu 20.04 LTS 64 Bit) and using Docker had the same result.

Mike posted this 03 July 2021

Yes, check out tomorrows Nightly build - should have a fix for this.

direwulf posted this 03 July 2021

Same situation here with Minecraft. I decided to clean things up today so a fresh load of Ubuntu, with new Amp load. I couldn't figure out why I couldn't connect until I did some troubleshooting only to discover my docker instances were showing closed on the instance ports.

AbhorrentJoel posted this 03 July 2021

I do not think this specific issue applies to Minecraft. Last time I checked for my own instances, Minecraft worked fine in Docker unlike 7 Days to Die. You will be better off making a new topic and detailing your issue since I really feel these issues are not connected at all.

direwulf posted this 05 July 2021

Mike, the nightly build did the trick, the ports are listening now, and no issues with the docker instances ports now.

Mike posted this 05 July 2021

Cool, all that was needed was the change to LDLIBRARYPATH.

AbhorrentJoel posted this 06 July 2021

Thanks for looking at this, Mike. I have tried to Nightly and now it listens.

Just out of curiosity, where did you decide to define/change the variable?