8.8 C
Saturday, May 25, 2024

How to set up a dedicated or local server for Valheim multiplayer co-op

Must read

Conquer Viking purgatory with these Valheim guides

Valheim Mistlands: What we know
Valheim boss: Summon and defeat them all
Valheim workbench: How to build and upgrade it
Valheim food: Recipes and combos
Valheim commands: Handy cheat codes
Valheim mods: The best player-made additions

Setting up a Valheim dedicated server is a great way to play with your friends if you’re keen to jump in now that the Valheim Mistlands update has arrived. Iron Gate’s Viking survival game has enjoyed huge success since it hit early access in 2021. In a market that feels more than a little saturated with the survival genre, Valheim has proved to be one of the most exciting new survival game in years. One of the many factors that has no doubt contributed to its success—aside from the need to build the perfect base—is the ability to play solo or with up to 10 players.

A dedicated server is only one way to go, though—if you don’t want the added hassle of setting up your own private server, hosting a game locally on your PC is also an option. There are pros and cons to each choice. While hosting a game locally only requires a couple of extra clicks to set up, a dedicated server will mean the world is always online, so the host won’t need to be present for friends to play together.

If you’re unsure which option is best for you, this guide details everything you need to know about multiplayer, as well as a breakdown of how to set up a Valheim dedicated server for you and your clan of Vikings.

How Valheim multiplayer works 

To lay down some basics, this is how multiplayer in Valheim works: You can take any character and their inventory from one game to another. That carries over their skill progress from place to place, but know that any equipment you lose in one world will still be lost in another if you log out before retrieving it. Developers Iron Gate Studio suggest having a separate character for single and multiplayer, and those who are abundantly cautious should probably do that.

For each new player that enters the game, the enemies get harder. When a player leaves, they get easier. This is worth remembering if you’re playing with a few friends and get separated when out exploring.

Local hosting

Image 1 of 2

How to start a Valheim server locally

If you’re just playing multiplayer Valheim with one or two other players, and you’ll never play apart, a dedicated server is probably overkill. Just have the person with the best internet connection and beefiest gaming rig host a local server. Just remember that you’ll only be able to play together when the host is online.

To host a game locally, either create a new world or choose an existing one, then select the ‘Start server’ option. Next, you’ll be prompted to enter a password and once that’s done, click ‘Start’ to load in. Others can now search for your server under Join Game and enter the password to connect.

How to join a Valheim server

The second tab on the menu after character selection is Join Game. That’ll let you see either servers hosted by your Steam friends, or search for Community Servers and join that way. Either way, you’ll need a password. 

Dedicated server

Where to host a Valheim dedicated server

You can put up a dedicated server on any PC. Some will put it on a secondary computer, others on the same machine on which they’re going to play. Whether that’s a good idea is up to you. Things to consider are the speed of your internet connection and how powerful your gaming PC is. Valheim isn’t too demanding a game, and neither is running a server, but combined, they’ll put a strain on most machines—and on the connection quality for other players.

In my experience, a machine with a 15-year-old processor stuttered a lot with three players connected and became pretty unplayable with more. A machine with an Intel i7 from 2013 did okay on 100mbps down, 10mbps up internet with five players connected, with occasional lag or stuttering—so an old spare PC or your media build might just be ideal for the job. 

To get this set up, you’ll need to know how to do port forwarding and how to find the server machine’s IP, which means you’ll likely need administrator access to your router. 

How to set up a Valheim dedicated server on Steam

1. Pick the PC it’s going to be on and install or open Steam.

2. Toggle on “tools” in the Steam library search and look for “Valheim,” you should see Valheim Dedicated Server. Install Valheim and install Valheim Dedicated Server. You won’t run it from Steam, though—you need Steam to play Valheim itself either on another PC or on this one.

3. Go to the folder in which you installed the Valheim Dedicated Server.

4. Now you need to either create a world to use, or transfer the world you were using prior to this to the server if it’s on another PC. If you’re hosting from the same PC you’ve been playing on, skip this step. Navigate to your Windows Users folder: C:\Users\YOURNAME\AppData\LocalLow\IronGate\Valheim\worlds. Transfer the files from this folder to the same folder on your server PC. 

5. Now you need to edit the server startup script file, which is in the server folder. The default is C:\Program Files (x86)\Steam\steamapps\common\Valheim Dedicated Server. In there you’ll go to a batch file called “start_headless_server.” Right click on that file and edit it.

6. The line in there now says something like “start valheim_server -nographics -batchmode -name X -port 2456 -world X -password X -public 1”, except the X is your information you’ve already put in. 

7. You’ll need to change it so that the X after name is the server name you want—which can’t be the name of your world. The X after world is the name of your world save—which can’t be the same as your server. The password is… well, whatever you want the password to be, but it can’t include the world or server names. (Again, you must have a password.)

8. If you want the server to show up in the community servers list, leave the numeral after public as 1. If not, change it to 0. 

9. Save that. Now make a backup of the start_headless_server file, because when the game updates it’ll wipe that file clean and you’ll need to replace it. Now you can quit that editor.

10. You now have to open the ports on your server PC to allow connection. Go to your router software, opening ports 2456-2458 TCP/UDP on the PC that’s running the server. The Host Port should be 2456. If there’s a firewall on the server PC, you’ll have to open those ports on the firewall as well.

11. Now start the server by double-clicking “start_headless_server.” That should open two windows, one with the server logs and one that you select and press any key to stop the server if you want to stop it. (Why would you stop the server? Updates. Otherwise, don’t do that! The whole reason to run a dedicated server is that it’s always around.)

12. Voila! Players can now join your server. It can sometimes take 10 to 15 minutes for the Community Server list to update once a server goes live. If it never shows up, that’s probably because you included the name of the game world in the server name or password… or because of a bug. Try the next steps if that happens.

13. If you change the public numeral to 0, people will have to join using the Steam server browser, found under View > Servers on the Steam client in the Favorites tab, then using the “Add A Server” button in the bottom right.

14. The IP address for your server is your server PC’s external IP with the affix :2457 on the end for the correct port—like XXX.XXX.X:2457.

Congratulations! You’re all set up for Valheim multiplayer. Now, go forth and build. While the friend you sent this article to sets up the server, can I suggest reading something like our guide to getting started in Valheim? Perhaps a tasteful tour of Viking homes?

- Advertisement -

More articles

- Advertisement -

Latest article