How To set up a local Valheim dedicated server
I got mad at the garbage tutorials online. Enjoy.
I got sick of my friends asking me to boot up our shared Valheim world while I was working.
So I decided to take an extra PC I had to set up a dedicated server.
When looking for a simple, straightforward guide, I found copy-pasted info spread across a bunch of sites with a grip of terrible trash popping up in my face, or my other option, 20 minute YouTube videos (probably worse). They were also incomplete and I needed to go look through reddit comments to help bridge the gap.
Fuck that.
So here’s how I got a dedicated server running. This guide is geared towards running the server on a second Windows computer (I haven’t tried Linux yet) and transferring an existing save from a local world to the dedicated server. It should still be helpful if you’re trying to do it all on one PC.
I’ve also tried to make it simple for the people who have never done something like this before. However, if you don’t understand port forwarding, you should be prepared to learn how to do this on your home network.
Install the dedicated server software.
When you purchased Valheim on Steam, it also came with dedicated server software.
Install it. (Make sure you have “Tools” selected in the dropdown above the search box)
In my case, I am installing the software on my second PC I plan to use as the Server PC. I will be joining the server from my Game PC.
We aren’t going to launch the server from Steam, because we want to be able to log in with our Steam account on our Game PC. We will launch the server from the server startup script in the install folder.
Transferring an existing world
If you want to take a world you were using locally, it’s pretty simple. We are going to move the world files from our Worlds
folder on our Game PC to the same location on the Server PC
The world data is in what we will call the data folder: This will be unique for your username in Windows.
C:\Users\%userprofile%\AppData\LocalLow\IronGate\Valheim\worlds
Transfer the files in there to the same folder on the Server PC. Note the name of your world - we will need that when we edit the server startup script.
Edit the server start script
Lets call the install location we installed the server software the install folder. (this might be different if you installed somewhere other than the default Steam location)
C:\Program Files (x86)\Steam\steamapps\common\Valheim Dedicated Server
Navigate to the folder above.
In here, you will find a batch file called start_headless_server
When you Right Click>Edit the file, you should see a line in there that looks like this:
start valheim_server -nographics -batchmode -name "My server" -port 2456 -world "Dedicated" -password "secret" -public 1
We are gonna update that crap and make it your crap.
Change what is in there to something that looks like this:
start valheim_server -nographics -batchmode -name "DankServerName" -port 2456 -world "WorldSaveName" -password "memePassword" -public 1
Some notes here:
name:
is what you want the server name to show up asYour server name should not be the same as your world name.
world:
is the world name (must match the world files we copied over earlier)password:
Must be 5+ characters. Also can’t include parts of world nameYou can leave empty (““) it if you want an open server. (NOTE - not sure about this - some conflicting reports. I will update when I have time to test )
public:
1 if you want the server to show in the community list. 0 if not.
BACKUP THIS FILE. Not a huge deal, but when the devs push an update it wipes the script, and you might as well just have a copy instead of coming back to this dumb guide because you forgot that server name can’t be the same as world name.
Save and quit that thang.
Note on updates: Just make sure you have updated Valheim Dedicated Server on Steam to the latest release, and replace the server startup script with your backup. (you backed it up, right?)
Open up those ports
Note: If you don’t know how to do this - search port forwarding and learn you some crap!
Your server won’t be joinable from your external IP until you open the necessary ports.
Open ports 2456-2458 TCP/UDP and add that service to the IP address of your Server PC
Do the same for your firewall on your Server PC.
Launching and finding server
Start the server by double-clicking the server startup script you edited. (start_headless_server)
Two windows should come up, one with the logs of the server starting, and one that says “Press ANY KEY to stop server” that’s how you stop the server. Don’t try to close the terminal windows, it wont work.
You should see that the server has started in the other window.
Adding to Steam server browser
So if everything is set up right you should be able to find the server in the steam server browser with your external or internal IP + port 2457 (XXX.XXX.X:2457) Your friends should be able to join with your external IP.
Note: the port to join is 2457 (our server is running on 2456).
You can test this from the Steam client in View>Servers>Favorites>Add A Server
Finding in-game
If you’ve included public = 1
in your server startup script, your server name should show up in the Community server browser in-game. (Give it a min or two sometimes)
If it does not, it is most likely that you used the same name for the world and the server. Don’t do that! You cant!
WE GOOD?
Sick. Send me pics of your squad filling up boats on your server. I live for that shit. @GarboZone
Thank you to u/Stulander_best (good guide) & u/cquinn5 (good single PC info) for their informative Steam community guide and reddit posts. True heroes. Check out their posts for good info.
Fuck off to all those garbo websites.
If there’s anything unclear, or if this could be better, please let me know. @GarboZone
This game is fantastic, and I hope someone finds this useful!
If you are so inclined, you can buy me a coffee.
awesome guide, got it all running in less than an hour after the headache i had yesterday.