Skip to content
Sign inStart a server

Setup · 9 min read

How to host a Valheim dedicated server

Set up a Valheim dedicated server: Steam app 896660, the start script, UDP ports 2456 and 2457, world modifiers, moving your world, and how friends join.

Last checked

Short answer

Install Valheim Dedicated Server (Steam app 896660) from the Tools filter in your Steam library, or with steamcmd +login anonymous +app_update 896660 validate +quit. Make a copy of its start script, set a server name, world and password of at least five characters, forward UDP ports 2456 and 2457 to that PC, and run the copy. Friends join with Join Game, then Add server, and your public address and port.

Three ways to host

Valheim is a game for 1 to 10 players, whichever way you host it.

Valheim hosted from the game, on a dedicated server on your PC, and on a rented server
From the gameDedicated server on your PCRented server
What runs the worldFrom the gameYour gameDedicated server on your PCThe Valheim Dedicated Server tool on a PC you keep switched onRented serverThe same tool on the host's machine
Who has to be thereFrom the gameYou, in the gameDedicated server on your PCNobody, while that PC stays onRented serverNobody
Router setupFrom the gameNone: friends use a join codeDedicated server on your PCForward two ports, or use crossplay modeRented serverNone
How friends joinFrom the gameJoin codeDedicated server on your PCAddress and port, the server list, or a join code with crossplayRented serverAddress and port

Iron Gate, the developer, describes a dedicated server as the way to get “a persistent world in which you and your friends can play anytime”. That's the reason to bother with the second or third column.

Hosting from the game

Start your world as a server from the game's own menus. The pause menu then shows a join code. Your friend picks Join Game, then Add server, and pastes the code in. There's nothing to install and nothing to forward.

The limit is that your game is the server: the world runs on your PC, inside the game you're playing, so it's only there while you are. If your group always plays together and the same person always hosts, that is enough. If people want to log in on different nights, read on.

What your own PC needs

Iron Gate publishes no memory or processor figure for the server, so the numbers in this table are ours, from a test on 3 October 2026.

What a PC needs to run the Valheim dedicated server, from our tests
NeedDetail
SystemDetailWindows or Linux
MemoryDetailNo developer figure. In our tests the server started with 3 GB available and held about 1.3 GB with nobody online
DiskDetailAbout 2.4 GB for the install in our tests, plus your world
Linux packagesDetaillibatomic1, libpulse-dev, libpulse0
Linux librariesDetailGLIBC_2.29 and GLIBCXX_3.4.26. On an older system, run the shipped docker_start_server.sh
Steam accountDetailNot needed for the download: SteamCMD's anonymous login fetched it in our tests

A world that ten players have explored widely needs more memory than an empty one. The RAM calculator gives our estimate for your group size.

Ports to open on your router

The two ports Valheim uses on a home server
PortProtocolWhat it's for
2456ProtocolUDPWhat it's forThe game port, set with -port. Friends type this one
2457ProtocolUDPWhat it's forThe port after it, which Valheim also uses

Iron Gate's guide gives the numbers: the default range is 2456 to 2457, and Valheim uses the port you set and the one after it. It doesn't say which protocol. In our tests the server listened on UDP on both, so TCP rules aren't needed.

Forward both ports to the PC that runs the server. If you change -port, forward the new number and the one after it, because the number in the script has to match the router. Give that PC a fixed address on your home network first, so the rule keeps pointing at it. That last point is general networking advice; Iron Gate say they can't give instructions for individual routers.

When the server first starts on Windows, the Windows Firewall asks about it. Tick every box and allow it.

Set it up, step by step

  1. Install the server. In your Steam library, tick the Tools filter and install Valheim Dedicated Server. Or, with SteamCMD:
    steamcmd +login anonymous +app_update 896660 validate +quit
  2. In the server's folder, make a copy of start_headless_server.bat (Windows) or start_server.sh (Linux), and edit the copy. Steam resets the original every time the server updates.
  3. Find the line that starts the server. In the Windows file it begins start valheim_server. Change the values after it: the name, world and password.
  4. Forward UDP ports 2456 and 2457 to this PC.
  5. Run your copy by double-clicking it or from a terminal. A copy can't be launched from Steam.
  6. Wait for the line Game server connected. The first start generates the world, which took over a minute in our tests.
  7. To stop it, press CTRL+C in its window. Closing the window with the X can leave the server running.

The settings part of the line, ready to edit:

-name "My server" -port 2456 -world "Dedicated" -password "Secret123" -public 1

On Linux, a whole start line in the form our own servers use, run from the server's folder. The first two options turn off the graphics a server doesn't need:

LD_LIBRARY_PATH=./linux64 ./valheim_server.x86_64 -nographics -batchmode -name "My server" -port 2456 -world "Dedicated" -password "Secret123" -public 1

The settings to change first

Valheim has no settings file: everything goes on that one line of your start script. The Valheim launch command builder writes the whole line for you.

The Valheim start-script settings to change first
SettingWhat it does
-name "My server"What it doesThe name shown in the server list
-world "Dedicated"What it doesThe world to load. If no world has that name, the server creates one
-password "Secret123"What it doesThe password players type to join. Five characters or more and, while the server is listed, not inside the world name or seed
-port 2456What it doesThe game port. The server also uses the next one up
-public 1What it does1 lists the server, which is the default. 0 hides it, so friends join by address
-crossplayWhat it doesLets players on any platform join. See How friends join
-saveinterval 1800What it doesSeconds between saves. 1,800 (30 minutes) is the default
-backups 4What it doesHow many older copies of the world the game itself keeps on the server's disk. -backupshort 7200 and -backuplong 43200 set the gaps between them, in seconds

The server checks the password itself. Under five characters, it logs Error bad password and doesn't come up. While the server is listed (-public 1), the password also mustn't appear inside the world name or the world's seed: a world called Secret123Isle needs a password other than Secret123. The server name can be anything.

Worlds are saved under %USERPROFILE%/AppData/LocalLow/IronGate/Valheim on Windows and ~/.config/unity3d/IronGate/Valheim on Linux. -savedir moves them.

World modifiers: easier, harder or no map

The difficulty choices you see when you create a world in the game have start-script versions too. Put the preset first and any single modifiers after it, as Iron Gate's guide says:

-preset hard -modifier raids none -setkey nomap
Valheim world modifier arguments and their values, from Iron Gate's guide
ArgumentValues
-presetValuesnormal, casual, easy, hard, hardcore, immersive, hammer
-modifier combatValuesveryeasy, easy, hard, veryhard
-modifier deathPenaltyValuescasual, veryeasy, easy, hard, hardcore
-modifier resourcesValuesmuchless, less, more, muchmore, most
-modifier raidsValuesnone, muchless, less, more, muchmore
-modifier portalsValuescasual, hard, veryhard
-setkeyValuesnobuildcost, playerevents, passivemobs, nomap

A preset replaces every modifier the world had before. In our tests the server applied it to an existing world on every start, so if your world already has the settings you want, leave -preset off the line.

The launch command builder puts the preset first and the modifiers after it.

Moving your world onto the server

A world is two files with the same name: <name>.fwl and <name>.db. On Windows, worlds you played in the game are in %USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worlds_local (older Steam Cloud worlds are in worlds next to it).

  1. Stop the server.
  2. Copy both files into the worlds_local folder in the server's save folder. Leave out any .old files.
  3. Set -world to the world's name, without the extension, and start the server.

Characters aren't part of the world. They live on each player's own PC, so everyone brings theirs with them.

How friends join

Friends choose Join Game, then Add server, and type your public address and the port, for example 203.0.113.10:2456. That's the address your router has on the internet, not the one your PC has at home. With -public 1 they can also find the server by name in the server list.

Without -crossplay, only Steam players can see and join the server. With it, the server runs on Valheim's crossplay service (PlayFab) and players on any platform can join: Xbox, PlayStation 5, Switch 2, Game Pass or the Mac App Store. Iron Gate say a crossplay server needs no port forwarding, and that players reach it by public address and port, by join code or from the server list, though not by a local address. An Xbox can join a dedicated server when both have crossplay on. It can't run one.

After a Valheim update, restart the server so it updates too. Players' games update automatically, and they can't join until the versions match.

Make yourself admin, or lock the server down

Three text files in the save folder control who's who: adminlist.txt, bannedlist.txt and permittedlist.txt. Each takes one player ID on a line, written as platform, underscore, ID, and Iron Gate say the IDs are case sensitive.

Be careful with permittedlist.txt: adding anyone to it locks out everyone who isn't on it. That's what you want for a private group, as long as you add the whole group.

Traps

  • Editing the original script. Steam overwrites it at the next update and your settings go with it. Edit a copy.
  • Forwarding one port. Valheim uses the port you set and the one after it.
  • A password the server refuses. Under five characters, or inside the world name or seed of a listed server, the server doesn't start, and to your friends it simply never shows up.
  • A preset on a finished world. -preset replaces the world's own modifiers.
  • Mods. Valheim has no official mod support and no Workshop. Some mods have to run on the server as well as in every player's game.
  • Closing the window. Use CTRL+C, or the server may carry on in the background.

If friends still can't get in, work through Can't connect to your Valheim server?

Renting a server instead

This section is about our Valheim servers only. Some details differ from the home setup above.

  • You choose the server name, world name and password when you create the server. The panel checks the password's length and, while the server is listed, that it isn't inside the world name. It then shows the address and port your friends type.
  • Our servers open three UDP ports in a row, 2456 to 2458 by default, where Iron Gate's guide lists two. You don't forward any of them.
  • The world preset, modifiers and keys from the table above are settings in the panel. The preset is applied at every start. To keep the settings a world already has, such as one you bring with you, turn on Keep this world's own settings.
  • To bring a world, zip its .fwl and .db together and use the guided import on the panel's Files page. The world is renamed to match the server's, and the old one stays on the server for 7 days so you can undo.
  • Each server checks for a Valheim update every time it starts.
  • Keep your own copy: download your files from the panel's Files page, as one .zip or over SFTP.
  • Crossplay is off by default, so friends join with the address and port the panel shows.
  • A pass lasts a day, a week or a month. At checkout you choose whether it renews until you cancel or runs once. When a pass ends the server stops and its files are kept for 30 days.

Sizes are on the pricing page.

Game facts checked against Valheim 1.0.21 on 11 November 2026.

Related guides