Valheim Server not listening

  • Last Post 04 March 2021
EvoSlice posted this 16 February 2021

OS Name/Version: Ubuntu 20.04.2 LTS

Product Name/Version: Amp Instance Manager v2.1.0.8

Problem Description: Valheim Server is running but not listening on any ports. I can connect to the server from another computer on the network using the local address of the server running AMP and the port Valheim is using (5679 in this case)

Steps to reproduce:

  1. Create new Amp Instance with Valheim module
  2. Port forward the 3 bound ports (5678-5680) for TCP/UDP
  3. Attempt and fail to find server in Valheim list
  4. Attempt and fail to add server to favorites in Steam by external IP address
  5. Successfully add server to Steam favorites by internal IP address

Actions taken to resolve so far:

I've looked at ports associated with the Valheim process and I see this:

valheim_s 17204             amp    3u  IPv4 160582      0t0  TCP> (CLOSE_WAIT)
valheim_s 17204             amp    5u  IPv4 160584      0t0  TCP> (CLOSE_WAIT)
valheim_s 17204             amp    6u  IPv4 160583      0t0  TCP> (CLOSE_WAIT)
valheim_s 17204             amp   10u  IPv4 160585      0t0  TCP> (CLOSE_WAIT)
valheim_s 17204             amp   26u  IPv4 163425      0t0  UDP *:5679 
valheim_s 17204             amp   28u  IPv4 163428      0t0  TCP> (ESTABLISHED)

The same output for another instance working properly (7DaysToDie Module):

7DaysToDi 36529             amp   20u  IPv4 317899      0t0  TCP *:27016 (LISTEN)
7DaysToDi 36529             amp   25u  IPv4 308985      0t0  TCP> (ESTABLISHED)
7DaysToDi 36529             amp   26u  IPv4 324706      0t0  TCP> (ESTABLISHED)
7DaysToDi 36529             amp   27u  IPv4 321758      0t0  UDP *:26902 
7DaysToDi 36529             amp   28u  IPv6 321759      0t0  UDP *:26902 
7DaysToDi 36529             amp  138u  IPv4 325945      0t0  UDP *:26900 
7DaysToDi 36529             amp  140u  IPv4 325946      0t0  TCP> (ESTABLISHED)
7DaysToDi 36529             amp  146u  IPv4 330939      0t0  TCP *:26900 (LISTEN)

It seems odd to me that Valheim isn't listening on any ports, but I can't say for sure that it should be.

Thanks in advance for any assistance.

Order By: Standard | Newest | Votes
Mike posted this 16 February 2021

Use ampinstmgr ports as the AMP user to check the network status for those instances instead of netstat.

Also try moving Valheim to its default port range of 2456 thru 2458

EvoSlice posted this 16 February 2021

Hi Mike,

I updated the ports to 2456-2458 along with my port forwarding.

This is the output of the ports command

[Info] AMP Instance Manager v2.1.0.8 built 16/02/2021 12:05
[Info] Release spec: Release - built by CUBECODERS/buildbot on CCL-DEV
[Info] Port usage for Valheim01 (ValheimServer)
[Info] Instance is currently running.
[Info] LISTENING        8085    TCP     (Core.Webserver.Port)
[Info] LISTENING        2228    TCP     (FileManagerPlugin.SFTP.SFTPPortNumber)
[Info] CLOSED           2456    Both    (GenericModule.App.ApplicationPort1)
[Info] LISTENING        2457    Both    (GenericModule.App.ApplicationPort2)
[Info] CLOSED           2458    Both    (GenericModule.App.ApplicationPort3)

So that indicates that it's listening on 2457, but I still cannot connect with the external IP address. Using a port forwarding checker tool gives me connection refused for the 2457, but works for other instances. Is this likely a Valheim/Steam issue or are there other troubleshooting steps I can take?

Mike posted this 16 February 2021

That looks correct now. Valheim has somewhat flaky networking right now. Use the connect link on AMPs status page (it should be using port 2457) which will open the game. You may need to do so repeatedly to get the game to connect.

EvoSlice posted this 16 February 2021

I have been able to join with that method, but unfortunately that doesn't help other players, unless I'm already on the server.

Mike posted this 16 February 2021

The same method will work for them but it may take multiple attempts. This is normal right now and not an AMP issue.

  • Liked by
  • EvoSlice
EvoSlice posted this 18 February 2021

I just confirmed that my external IP address issue persists when running a Valheim server outside of AMP, so no action needed here. Every other server I run works fine, so this is extremely puzzling.

Mike posted this 18 February 2021

Valheim has just some straight up reliability issues with regards to networking.

  • Liked by
  • EvoSlice
TimeHunter posted this 04 March 2021

Evo have you opened the ports in Ubuntu's firewall?

sudo ufw allow 2456/tcp sudo ufw allow 2456/udp

As this is what I forget to do my server the first time, I had all the port forwards setup on the router but forgot to open the ports on the server.