How to Set Up a Valheim Dedicated Server on Windows

Playing Valheim with friends is best when the world doesn’t disappear the moment the host logs off. A dedicated server runs on its own, independent of any player’s game, so your group can jump in whenever they like. This guide walks through setting one up on a Windows machine — a spare PC, a home server, or a Windows VPS all work the same way.

What you’ll need

  • A Windows 10/11 machine (or Windows Server) you can leave running.
  • About 2 GB of free disk space and at least 4 GB of RAM free for the server process.
  • Administrator access, so you can open ports and (optionally) create a firewall rule.
  • The ability to forward UDP ports on your router if friends connect over the internet.

You do not need to own a second copy of the game. The dedicated server is a separate, free download from Valve.

Step 1: Install SteamCMD

SteamCMD is Valve’s command-line tool for downloading server software. Create a folder such as C:\steamcmd, download steamcmd.zip from Valve’s official SteamCMD page, and extract steamcmd.exe into that folder. Open PowerShell or Command Prompt, move into the folder, and run it once so it can self-update:

cd C:\steamcmd
steamcmd.exe

The first launch downloads a few files and drops you at a Steam> prompt. Type quit to exit for now.

Step 2: Download the dedicated server

The Valheim dedicated server has its own Steam App ID: 896660 (the game itself is 892970 — don’t confuse them). Download it into a dedicated folder like C:\valheim-server:

steamcmd.exe +force_install_dir C:\valheim-server +login anonymous +app_update 896660 validate +quit

login anonymous works because the server package is free. When it finishes you’ll have valheim_server.exe and a sample start_headless_server.bat in C:\valheim-server.

Step 3: Create your start script

Rather than editing the bundled .bat, make your own so updates never overwrite it. Create C:\valheim-server\start-server.bat with this content:

@echo off
set SteamAppId=892970
echo "Starting Valheim server..."
valheim_server.exe -nographics -batchmode ^
  -name "My Viking World" ^
  -port 2456 ^
  -world "Midgard" ^
  -password "longboat" ^
  -crossplay ^
  -public 1

A few things matter here:

  • -name is the display name shown in the server browser.
  • -world is the save-file name. If the world doesn’t exist yet, the server creates it on first launch.
  • -password must be at least five characters and must not be a substring of the server name, or the server refuses to start. Pick something your friends can remember.
  • -public 1 lists the server in the community browser; set it to 0 to keep it join-by-IP only.
  • -crossplay enables the PlayFab crossplay network so Xbox/Game Pass players can join. Drop it if you only play on Steam.

Double-click the script to launch. The first boot generates the world and prints Game server connected once it’s ready — that can take a minute.

Step 4: Open the ports

Valheim uses UDP ports 2456 and 2457. (It historically reserved 2456–2458, so opening that whole range is fine.) You need to allow them in two places:

  1. Windows Firewall — create an inbound rule allowing UDP 2456–2458, or approve the prompt Windows shows the first time the server runs.
  2. Your router — if friends connect over the internet, forward UDP 2456–2458 to the local IP of the machine running the server. Give that machine a static/reserved IP so the forward doesn’t break on reboot.

Note that the query port a client uses to find your server is 2457, one above the game port you set. If you change -port, the query port shifts with it.

Step 5: Connect and test

In the game, open Join Game → Join IP and enter your machine’s local IP (for LAN) or your public IP (for internet), followed by :2456. Enter the password when prompted. Once one person is in, invite the rest and confirm progress saves after everyone logs off.

Where your saves live

The server writes worlds and admin files to:

%USERPROFILE%\AppData\LocalLow\IronGate\Valheim\

Inside worlds_local you’ll find Midgard.db (the world) and Midgard.fwl (its metadata), plus .old rollback copies the server keeps automatically. That same Valheim folder holds adminlist.txt, permittedlist.txt, and bannedlist.txt for managing players. Back up the worlds_local folder regularly — it’s the only irreplaceable part.

Keeping it running

For casual use, leaving the .bat running in a window is fine. For something more permanent, wrap it in a tool like NSSM so it runs as a Windows service and restarts automatically after a reboot or crash. Either way, restart the server after every game update: rerun the Step 2 app_update command to patch valheim_server.exe, since a server running an older build won’t accept updated clients.

That’s the whole loop — install, script, ports, connect. From here you can add admins, mods, and automated backups, all of which build on the folder layout above.