Watch the video:
0:00 - Intro/Explanation
1:20 - Download Valheim Dedicated Server
1:47 - Customize server
3:25 - Start & Join your dedicated server
5:17 - Allow Velheim through Windows Firewall
6:32 - Port forwarding Valheim Dedicated Server
8:50 - Find your server in the list
9:17 - Alternative server browserIs this really free?
Yes.
As long as your computer is on, running the server and connected to the internet: People should be able to join you over the internet if you’ve set everything up properly. It’s great.
Downloading Valheim Dedicated Server
Open Steam, and search for Valheim. If you own the game you will see Valheim Dedicated Server returned under “Tools”. Otherwise click the dropdown and make sure Tools is ticked, as well as Ready to play is off (This shows everything in your Steam library, not just what’s downloaded).
If you would like you can download the server through SteamCMD (No need to have Steam installed, great for VPS servers).
Preparing to launch server
In the server’s install folder you will find Valheim Dedicated Server Manual.pdf, which should update with the server.
There is also a start_headless_server.bat file, or start_server.sh for Linux installs. Open this file with Notepad and customize it.
| |
Set or remove the password field, remove -crossplay to disable crossplay if you wish, choose a -port, or leave it default and finally set a -name for your server like: -name "TroubleChute's Server".
Should you wish, you can add:
-savedir [PATH] - Set a custom world save folder.
-public 0 - Hide your server from the server browser (it is 1 by default when not included, meaning it should appear in the server browser).
-logFile "D:\log.txt" - A custom log file paath
-saveinterval 1800 - How often your server saves in seconds.
-backups 4 - How many automatic backups are kept.
-backupshort 7200 - How often ‘short’ backups are made, by default 2 hours.
-backuplong 43200 - How often ’long’ backups are made, by default 12 hours
Both of the backups combine so you have ~4 backups 2 hours apart, and longer backups at 12 hour intervals allowing more fine control over rollbacks.
-instanceid "1" - Should you host multiple servers on the same port
-preset hard - Difficulty (Normal, Casual, Easy, Hard, Hardcore, Immersive, Hammer).
-modifier raids none - World modifiers (Combat: veryeasy, easy, hard, veryhard. DeathPenalty: casual, veryeasy, easy, hard, hardcore. Resources: muchless, less, more, muchmore, most. Raids: none, muchless, less, more, muchmore. Portals: casual, hard, veryhard).
-setkey nomap - World modifier checkbox key. nobuildcost, playerevents, passivemobs, nomap.
Save the file after customizing and use this to start your server.
Use Ctrl+C to stop your server, should you wish.
Finally, if you’re using Docker the pdf document does have info on spinning up a server in there!
Server Admin
Open the save path and you can edit or create adminlist.txt, bannedlist.txt and permittedlist.txt.
All of these work in the same way. One player per line, in the format [platform]_[userid]. This info can be grabbed from the F2 panel in-game.
Admins can use commands in the F5 console like:
Kick <playername>, Ban <playername>, Unban <playername>, Banned (to list banned players).
Joining your new Valheim server
There are 2 ways:
1. Join using the in-game browser
To get to this click Start Game, then choose a character or create a new one. Hit Start.
Head to the Join Game tab at the top. Here you will find 4 tabs: Recent, Favourites, Friends and Community. Community is the public server list, and you can type a name into [Filter] at the bottom to search for one.
To join your own server click Add server and enter 127.0.0.1:2456 - 2456 is the default port, and 127.0.0.1 is the same as localhost - Your own PC.
Should that fail, try adding 1 to the port number, so 127.0.0.1:2457 might work.
2. Steam server browser
You can’t connect with an IP directly here anymore. You can search for and join servers also using categories: Internet, Favourites, History, LAN and Friends – All without having to launch Valheim first.
In Steam click View in the top-left, then Game Servers.
Here you can choose the game with the dropdown on the right. Choose Valheim, then click the search.
You should see your server appear on the list after a short while of it running. You can expand Change Filters at the bottom to search for server names.
To join with an IP: Steam no longer has an Add a server button. use the in-game server browser.
Letting others join your new Valheim server
This is simpler said than done. There are 2 sections and both need to be done to let friends over the internet play.
Open the server to LAN (Others on your local network)
To let someone on the same local network (router) as you play: You need to allow the Valheim server through your firewall.
We need to open ports 2456-2458. If you set a custom port above, then forward that.
If you’re using a third-party antivirus with a firewall; you’ll need to look into how to open the ports.
If you’re using Windows Firewall (by default) then run the following commands in an Administrator Powershell window.
| |
If you ever wish to remove your Firewall rules for this, run the command: Remove-NetFirewallRule -DisplayName "Valheim Server"
This will open all of the ports and allow people on the same local network as you to connect to your server while it’s running.
All you need is your local IP address.
To get your local IP:
- Run the following in a terminal/CMD/powershell window:
ipconfig - Find the way you’re connected to the internet, for example
Ethernet adapter Ethernet - Find the
IPv4address and copy it - For example, your local IP is
192.168.1.10
Other devices can use this local IP address to connect to your server. Note: This is a LOCAL IP, and your server is not yet accessible over the internet or even routers outside of your own… That’s where we need to
Port Forward
Using your Local IP address we found above (and allowed ports through to) - We need to send traffic from these two ports to our computer.
If you’re using multiple routers in a chain before your computer reaches your fiber box/access box: You’ll need to port forward each router to the next until you finally port forward to your computer.
Port forwarding varies wildly from router to router, and you can look up guides specifically for your router. Essentially you’ll need to forward ports 2456-2458 for UDP and TCP. If you have an option to choose both TCP/UDP it may be a good idea.
On some routers you can enter ports comma-seperated such as 2456,2457,2458, and even select TCP/UDP instead of needing to create a rule for each type.
Let’s say you have just ONE router between you and the internet (Example: You’re connected directly to the fiber box), you’ll port forward as follows:
- Ports:
2456-2458 - Type:
TCP/UDP - Destination:
192.168.1.10
Now you’re done port forwarding.
Letting others join
At this point you’ve allowed local traffic and over the internet to reach your Valheim server. All you need to do is let others join by checking the Server Browser in-game or in Steam, or by getting your external IP address by Google searching “What is my IP”.
Others can then use the console to connect using open xxx.xxx.xxx.xxx:2457.
Have fun!
