Do you have a VPS or Dedicated Server and want to install a game server on it? For example, a Valheim Dedicated Server? You’re in the right place! Below, we’ll explain step by step how to set up a service like this on your server.
SteamCMD is required to set up a Valheim server. SteamCMD is the command-line version of the Steam client. With this tool, you can quickly and easily download Dedicated Server applications for popular Steam games. You can find SteamCMD on the official Valve developer website: https://developer.valvesoftware.com/wiki/SteamCMD.
Next, download the files. The download includes the steamcmd.zip file, which you first need to extract. We recommend creating a dedicated folder to extract the file into. You should then see steamcmd.exe. Run it and wait for the installation process to finish.Once the message Loading Steam API.... OK appears, the process has completed successfully, and you can start installing the Valheim server.
After installation, you should be able to run commands in the Steam command line (steamcmd.exe). You need to log in there using the anonymous user. Run the following command: login anonymous
The next step is to install the server. Run the command app_update 896660. The App ID 896660 corresponds to the Valheim Dedicated Server application.
To avoid errors, don’t interrupt the process before it finishes. It may take a moment, but patience pays off! :)
Go to the directory where you installed the server, then open the following subfolder: ../steamapps/common/Valheim dedicated Server/
There, you need to create the startup file required to run the server software. Create a file named: start_headless_server.bat
Make sure the “Show file name extensions” option is enabled so that the correct file extension is used.
Open the file, add the following contents, and save your changes:
@echo off
set SteamAppId=892970
echo "Starting server PRESS CIRL-C to exit"
REM Tipp: Erstelle eine lokale Kopie dieses Skripts, damit es nicht von Steam überschrieben wird.
REM HINWEIS: Mindestpasswortlänge ist 5 Zeichen & Passwort darf nicht im Servernamen vorkommen.
REM HINWEIS: Du musst sicherstellen, dass die Ports 2456-2458 über deinen lokalen Router & Firewall an deinen Server weitergeleitet werden.
valheim_server.exe -nographics -batchmode -name "My Server" -port 2456 -world "Dedicated" -password "secret" -crossplay
To make the server visible and accessible from outside your network, you need to allow or forward the server ports in your firewall. To do this, open the Windows Firewall settings.
In the settings, you need to add additional rules. Click the inbound and outbound rules as described below, then add rules for ports 2456–2458 using the TCP/UDP protocols.
The setup is now complete. You can make further configuration changes in the start_headless_server.bat file. There, you can customize the server name, server password, admin password, and many other options. To do this, go to the following directory:
../steamapps/common/Valheim dedicated Server/
Once setup is complete, you can start the server by running the start_headless_server.bat file you created earlier. This opens the server console and starts the server. If everything is working as expected, the server should appear in the server list once it has started successfully.