This is a brief collection of information gathered from the Official Valheim Discord Server Support channel on creating and running a dedicated server.
Step 1: Installation
The Valheim Discord #valheim-server-help community recommends setting up a dedicated server on Windows, Linux, or Docker either on a VPS provider or on a spare PC at home.
Windows install guide: https://pastebin.com/DcxUtcyn
Step 2: Ports
Once you have the server installed make sure to open the default ports on the network firewall and on the server.
Default port range is 2456 to 2458. UDP seems to be the only protocol needed, but it is recommended to also open the ports for TCP too.
As of Feb. 21 2021 the Valheim Discord #valheim-server-help community is waiting for verification from the developers if both or only UDP needs to be open.
Step 3: Verify Ports
Once your server is up and running, you can test if all is working correctly by entering your server IP and port into this tool: https://geekstrom.de/valheim/check/
If you get a "Yes :)" your server is accessible from the internet. If you get a "No :(" please recheck your firewall settings on the network and in Linux (UFW) or Windows (Windows Firewall). For directions on setting up port forwarding on your router/firewall Google "Router Model set up port fowarding" replaceing Router Model with the brand and model of your router.
Step 4: Connecting with the game
As of Feb. 21 2021, the in game server browser is bugged and will not show all dedicated servers. You need to connect to the server via the in game "Join IP" tool, you need to enter IP and Port, joining by name is not supported.
You can also join via the Steam Client by going to View>Servers>Add the server IP:Port as a favorite you may need to add a higher port for this to work, for example if the port in the server start script is 2456 then enter 2457. The server will show x/64 players in the server window, this is a bug.
Because of the way that the server's netcode is programmed, players in the same area as others will cause other players to lag reduce frame rate. This is a known issue and being worked on by the Valheim Devs. There is no official work around or fix. See following image:
Valheim doesn't seem to work properly with ISP's that use CGNAT (Carrier Grade Network Address Translation). If you know or suspect you have a CGNAT ISP (4G mobile users especially) try using a VPN or contact your ISP for a regular public IP. Some will give upi a true public IP and some won't.
Some players unable to connect:
Valheim is very dependent on a stable connection to the game server. If someone is playing via a high latency Internet connection (4G/Cellular/Mobile/Satelite) it is possible that they will not be able to connect to the server at all. This may also be true for people connecting from long distances, eg. someone in Asia connecting to a server in the EU.
Server console error: 'STEAMPS3 - AsyncTCPSocket created':
This is due to a bandwidth/networking problem with players games unable to establish a stable connection to the game server. One fix is to move the dedicated server to a new region closer to the location of the player. There is no other offical fix.
Server won't start:
- Check that the password is longer than four characters and not the same as the world name. Do not rename the world.db or world.fwl files unless you use this tool: https://geekstrom.de/valheim/fwl/.
- If you transferred the world from your PC to the dedicated server make sure that the path to the world is set correctly in the server start script
- Make sure that when transferring the world files from PC to dedicated server you use binary mode is forced.
Add your SteamID (Dec) to the adminlist.txt file
- Linux: /home/steam/.config/unity3d/IronGate/Valheim/adminlist.txt
- Windows: C:\Users%username%\AppData\LocalLow\IronGate\Valheim\adminlist.txt
You can get your SteamID using this tool: https://steamidfinder.com/
You will need to reboot the game server for this to take affect. The only available admin commands are
save. Cheat mode is disabled on dedicated servers.
There are currently no tools as of Feb. 21 2021 to remove items, fix areas with multiple spawned in monsters, or such.
If this was useful, I'd appreciate a follow in Twitter: https://twitter.com/TheKuroKuma