Valheim

Valheim

114 ratings
Setting up a dedicated server (0.143.5)
By Gaston LeGume
This guide will help you setting up a dedicated server.
5
4
12
   
Award
Favorite
Favorited
Unfavorite
Info
I've managed to download and run a server successfully with the steps below. I assume you have some basic knowledge of how servers and SteamCMD work, so the guide is very brief.
SteamCMD and installing content
Download SteamCMD from here. Extract it to any location. I keep my SteamCMD on my desktop.

Create a .bat file (easiest way is to create a .txt file and save it as a .bat) named "update.bat" and paste the following in it:

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. When it has finished it should look like this in the folder you specified:



Move your "update.bat" to the installation folder to keep it organized and run it when you want to update the server.
Configure 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.

I've marked the text you need to change with "CHANGEME" below, change them to what you want. When you're done, save and exit.

  • -name | change this to the display name you want
  • -world | change this to the name of your world. Needs to match if you're moving over local save files
  • -password | change this to the password you want for the server (minimum 5 characters)

@echo off set SteamAppId=892970 echo "Starting server PRESS CTRL-C to exit" 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. valheim_server -nographics -batchmode -name "CHANGEME" -port 2456 -world "CHANGEME" -password "CHANGEME"

Make sure ports 2456-2458 are open in your firewall on your router and PC. You can now start the server with the "start.bat" file. The server is ready when it says "Game server connected". To close down the server properly, open the server CMD prompt and press CTRL+C.
Save location
You can find your world in AppData\LocalLow\IronGate\Valheim. They can be moved to the dedicated server if it's on another PC, just make sure you name it the same in your "start.bat". You need to run the server once for the folder to generate.

The server autosaves every 30 minutes.

Direct Connect
Go to Steam > View > Servers > Favorites > Add a server

Put your machines IP and then port 2457 (default port +1 if you changed it), example: 192.168.1.20:2457

You can now direct 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. Not sure why this happens for me.
244 Comments
Jul 12, 2025 @ 11:41am 
I just setup a second PC to use as a game server box. I used this guide to setup SteamCMD and transferred my server files and world over from my primary PC. The batch file launched the server/world just fine I had completed the port forwarding but would always get "failed to connect."

If anyone runs into this issue, my solution was that I had to search for the world again and not use the one I had set as a favourite.
Mar 29, 2023 @ 6:04am 
How do you downgrade your server?
Mar 15, 2023 @ 2:19pm 
For anybody searching for an answer:
Look up in The C:\Program Files (x86)\Steam\userdata\"your steam ID"\" your game file nomber of valheim"\remote\worlds

There you will finally find it
Gaston LeGume  [author]
Feb 11, 2022 @ 12:37am 
@BilboBeBagginU
Do you not see it if you add it as a favorite as well?
Feb 10, 2022 @ 3:45pm 
I have tried every guide I have found and nothing works. I've forwarded ports, allowed exceptions on my firewall and even had the CMD read game server connected. Nothing works. I'm at a loss for words as to why this does not work for me.
May 19, 2021 @ 6:22am 
I think it needs to be made clear --- that the connection port is 2456 --- or the # you set it to. Not the "+1".
Apr 21, 2021 @ 10:24am 
This does not work today:
steamcmd +login anonymous +force_install_dir C:\Valheim +app_update 896660 validate +exit
Steamcmd say it's up to date, but I'm getting incompatible version when starting the game...
Apr 14, 2021 @ 5:43pm 
I so very passionately hate steamcmd and wish they could just make the f***ing tool freely available.
Apr 3, 2021 @ 3:16pm 
dammit windows OS only, wont install on mac osx 14.
Apr 3, 2021 @ 7:05am 
how do I declare someone admin on a server?