Valheim | How To Set Up A Dedicated Server

This brief guide will help you to set up a dedicated server successfully for the game Valheim. A little bit of prior knowledge of how servers and SteamCMD work is necessary. With these few short steps, you will be able to download and run a server successfully. Just follow these instructions carefully.


How To Set Up And Successfully Run A Dedicated Server For Valheim

How To Download And Install SteamCMD

You can download SteamCMD from here. Extract it to any location, preferably your desktop so that you might have easy access to it. Create a .bat file named “update.bat” and paste the following code:

C:\Users\USERNAME\Desktop\SteamCMD\steamcmd +login anonymous +force_install_dir C:\Valheim +app_update 896660 validate +exit
  • Change C:\Users\USERNAME\Desktop\SteamCMD\steamcmd to where you extracted SteamCMD.
  • Change the +force_install_dir C:\Valheim to where you want to install the server.
  • Save the .bat file and run it. It should finally look like this:
Image Credits: Steam

After you have done all this, move your “update.bat” file to the installation folder to keep it organized and run it when you want to update the server.


How To Configure The Server

Make a copy of the “start_headless_server.bat” in your server folder and rename it to “start.bat”. Open “start.bat” with any text editor. Change the areas marked with User to anything you want. After doing this just save and exit.

@echo off
set SteamAppId=892970

REM Tip: Make a local copy of this script to avoid it being overwritten by steam.
REM NOTE: Minimum password length is 5 characters & Password cant be in the server name.
REM NOTE: You need to make sure the ports 2456-2458 is being forwarded to your server through your local router & firewall.
start valheim_server -nographics -batchmode -name "CHANGEME" -port 2456 -world "CHANGEME" -password "CHANGEME" -public 1


echo Server started
echo.
echo Press ANY KEY to stop server
pause > nul
echo 1 > server_exit.drp

echo Server exit signal set
echo You can now close this terminal
  • Make sure ports 2456-2458 are open in the firewall on your router and PC.
  • You can now start the server with the “start.bat” file.
  • The server is ready when it shows “Game server connected”.
  • To close down the server properly, open the CMD prompt i.e. open (see picture below) and input any key.
Image Credits: Steam

Save Location for Valheim

You can find your world in AppData\LocalLow\IronGate\Valheim. You can move your Single-player saves over to the dedicated server if it’s on another PC. Just make sure you name it the same in your “start.bat”. If you want a custom seed, generate the world in SINGLEPLAYER first. Once you connect to the generated world, you can exit the game. Put the NAME you set (not the seed) in the server config setting for -world. Once the server starts again you now have a custom seed generated on a dedicated server.


Direct Connections

Go to Steam > View > Servers > Favorites > Add a server. Put your machine’s IP and then port 2457 (default port +1 if you changed it), for example, 192.168.1.20:2457. You can now directly connect through the Steam server browser. If you’re connecting from the outside, put your exterior IP. It might show for a second and then disappear, make sure to double-click it instantly after refreshing. This is something that users may or may not experience.


Additional Instructions

  • The password that we mentioned above is mandatory for now. Make sure not to leave it blank and add at least 5 characters to it.
  • Make sure the port range is open (2456-2458) in your router and in your windows advanced firewall. It may not show up until you have added the range manually in the adv firewall, both TCP and UDP.
  • As of now only 10 people can join the server.
  • To Make sure ports 2456-2458 are open in your firewall , open your text editor (we recommend notepad++) and paste the code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\FirewallRules]
"{E935EE39-A619-401F-A37F-ED9195E7B12D}"="v2.10|Action=Allow|Active=TRUE|Dir=In|Protocol=6|LPort2_10=2456-2458|Name=Valheim TCP IN|"
"{63F3B483-4FE0-4AEC-809D-FF2FF5A6BF34}"="v2.10|Action=Allow|Active=TRUE|Dir=In|Protocol=17|LPort2_10=2456-2458|Name=Valheim UDP IN|"
"{2309BBAA-7066-48E1-94CC-8EECFA4B7827}"="v2.10|Action=Allow|Active=TRUE|Dir=Out|Protocol=6|RPort2_10=2456-2458|Name=Valheim TCP OUT|"
"{8E885DDE-D9FD-4B9A-AED4-AA35F1DF0779}"="v2.10|Action=Allow|Active=TRUE|Dir=Out|Protocol=17|RPort2_10=2456-2458|Name=Valheim UDP OUT|"

Save as Velheim-Firewall .reg and open it. NOTE: You must save as .reg format, not .txt. It definitely works if your server is Windows.


That’s it! That’s all you need to do to run a dedicated server for this game. If you found this guide useful, let us know down in the comments below. If you do manage to do everything as per this guide’s instructions then we are sure your problem will be solved. Thank you for reading!

2 thoughts on “Valheim | How To Set Up A Dedicated Server”

  1. How would I do this if I used a third party hoster?

    I’ve managed every step but cant get to the bat file to change the name of the world (therefore the seed). I’ve got the save file moved across but not the seed itself.
    so buildings are in the right place, the hills and valleys are not…

    please help,
    Toby

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top