Box art - Valheim

Valheim | How to set up a dedicated server

The world of Valheim is dangerous, especially for Vikings who hunt alone. Fortunately, the game allows for online co-op with up to ten players. However, if you’re playing on public servers, you won’t have control over who you play with or the seed used to generate the world. For a more personalized experience, you’ll want to set up a dedicated Valheim server. It takes a little bit of work, but with patience, anyone can host their very own Valheim server. Here’s what you need to do.

How to set up a dedicated Valheim server

How to set up a dedicated Valheim server

In order to set up your own Valheim server, you first need to download the Dedicated Valheim Server application. You’ll also want to modify the application’s batch file in order to customize your dedicated server. Finally, you’ll need to allow incoming connections through Windows Firewall, and/or set up port forwarding so that players outside your home network can join the server.

Aside from port forwarding, the whole process is relatively painless. Still, it can seem a little daunting, especially to players who aren’t totally familiar with PC network configuration. To keep things as simple as possible, we’ve broken down each of the steps below.

Download the Valheim Dedicated Server application

This part is easy. The Valheim Dedicated Server comes free with the game when purchased on Steam. You can find it by searching for Valheim in your Steam library — the server application will show up under Tools. It’s right around one gigabyte, so it shouldn’t take too long to download and install.

It’s possible to run both Valheim and the dedicated server application from the same machine. However, doing so could affect system performance. If you’re concerned about your server hogging local PC resources — or if you’re experiencing lag or stuttering in Valheim — you may consider running the application on a separate system. Older PCs with at least a dual-core processor should be able to handle it just fine. Alternatively, you could build a budget gaming PC using value-oriented components.

Configure the server’s batch file

Valheim setup dedicated server - Configure batch file

Once the dedicated server application has been installed, you’ll want to customize your server settings. To do so, you’ll need to modify the app’s batch file located in the installation directory. The file is called “start_headless_server.bat”, and it’s found wherever you install Steam games. The default directory is C:\Program Files (x86)\Steam\steamapps\common\Valheim dedicated server.

Open the installation directory, then make a copy of the original batch file. Store it somewhere safe in case you make any mistakes. After that, right click on start_headless_server.bat, then click Edit to open the file in Notepad. At the bottom of the file you’ll see a few values that can be adjusted:

  • -name “My Server”
    • Replace the “My Server” text with whatever you want your server to be named
  • -port 2456
    • This is the default Steam query port used for connections. It’s best to leave this setting as-is, though advanced users may want to change the value based on firewall and port forwarding settings (see below)
  • -world “Dedicated”
    • Here you can replace the word “Dedicated” with the name of your in-game world
  • -password “Secret”
    • Replace the word “Secret” with whatever password you desire. Alternatively, you can remove the entire string to run an open server

After you’ve made your modifications, it’s wise to create yet another backup of the batch file. This is just for safe keeping in case something goes wrong.

Allow incoming connections and set up port forwarding

Valheim setup dedicated server - Run server application

This is the most complicated step, and one that may prove difficult for less-experienced PC users. In a nutshell, you need to allow access to your Valheim dedicated server through the Windows firewall. This involves opening port 2456, the default Steam query port, or the port number you chose in the step above. You may also need to set up port forwarding within your router so that users outside of your home network can connect.

Here’s how to open the Steam query port for incoming connections through Windows Firewall settings:

  1. From the Start menu, type in Windows Firewall, then open the Windows Defender Firewall application
  2. Right click on Inbound Rules, then click New Rule
  3. Click on Port, then click Next
  4. In “Specific local ports,” type in “2456”
  5. Click Next, make sure “Allow the connection” is selected, then click Next again
  6. Continue clicking Next until reaching the Name option, then give the rule a name of your choosing
  7. Finally, click Finish

With this done, you will have allowed Windows Firewall to accept incoming TCP connections through port 2456. At this point, you may also consider port forwarding with your router. Unfortunately, since every router is a little different, no single guide will be able to provide all required details. Luckily, PortForward.com provides an excellent resource on how to set up port forwarding on a variety of hardware.

Run the Valheim Dedicated Server

With all of the above configurations completed, all that’s left is to open the Valheim Dedicated Server application. Running the app will open a command prompt window that will begin filling with text — don’t worry, this is normal. However, when first started, Windows Firewall will likely try to limit the connections allowed by the server. If you intend to have others join your game from outside your home, be sure to allow access from outside networks.

That’s all there is to it. Now you’re ready to explore the wilds of Valheim with up to nine other friends. If you run into any more trouble, be sure to check out our guide on what to do if your Valheim dedicated server is not showing up. We’ve also got some hints on what to do if Valheim freezes or crashes. Happy hunting, Viking.