If you already have a Dedicated server and uMod installed. You can skip this step. If not, please see below;
Hosting your own local server
Follow these steps exactly to quickly and easily set up your very own custom Valheim dedicated server:
Outside of Valheim, open up your Steam Library and search for “Valheim Dedicated Server.” If you own Valheim, you also own this little tool that comes with it.
Download and install the Valheim Dedicated Server tool, just like you would with any Steam game. But don’t run it yet! First, right-click the tool in your Steam library and go to “Manage -> Browse Local Files.”
In the window that appears, find the file named “start_headless_server,” make a copy of it, and save the copy elsewhere, so you have a backup if anything goes wrong.
Then return to the first version of the file, right-click it, and click “Edit.” In the file, find the line that starts with “valheim_server” and change the following parts:
name “My server” – Give your server a name inside the quotes.
port 2456 – Change the port number to the number you’re using. Check Port Forwarding.
world “Dedicated” – Give your world a name. It can’t contain any words used in the server name.
password “Secret” – Give your server a password to make it private, or leave it blank to make it public.
savedir “/worlds/” – Overrides the default save path where stored Worlds and permission files.
Now save the file, close it, and run the Valheim Dedicated Server tool in Steam. Wait for the window to finish loading and printing lines. Once you see the line “Game Server Connected,” you can go back into Valheim, and you should see the world appear in your list of worlds for you to join and start playing!
If you want to stop your Valheim dedicated server, then check if there’s a server window that tells you to hit any key to stop the server. If there is one, focus on that window and hit any key to shut down the server. If there is no such window, then either click the “X” on the main server window or head to the Valheim Dedicated Server tool page on Steam and click “Stop.”
And yes, you can run the dedicated server tool in the background and play Valheim on the same PC. You don’t have to run them on separate machines.