Datafex LogoDatafex
All guides

How to set up a Valheim server: the world file and backup discipline

By Published Updated 5 min read

This guide builds a working Valheim dedicated server from scratch: choosing the operating system, installing through SteamCMD, the launch parameters, opening ports, and the thing that matters most in this game — backing up the world file. Valheim's resource profile is modest; the real risk is not hardware but losing a world played for months that lives in a single file.

Before you start: what you need

  • A modest server. A vanilla server runs comfortably on 4 GB of RAM and 2 vCPUs with 10 players. If you raise the player cap and lift build limits with BepInEx mods, the requirement climbs to 8 GB. If you plan to run several worlds on one machine, budget each instance separately. To pick resources and work out the monthly price: server configurator
  • A world name and password. The password must be at least five characters and must not appear inside the server name; break either rule and the server will not start.
  • A backup target somewhere other than the server itself. The reason is below.

1. Operating system

Choose Ubuntu 22.04 LTS. The Valheim dedicated server ships officially for Linux and this distribution brings the fewest library surprises; on a ready Ubuntu VDS the install comes down to a few commands.

SteamCMD requires the distribution's 32-bit compatibility packages; without them no download starts at all.

Do not run the server as root — create a separate user that exists only for the game: connecting to a server over SSH

2. Installing with SteamCMD

Server files are downloaded with an anonymous Steam session:

./steamcmd.sh +force_install_dir /home/valheim/server +login anonymous \
  +app_update APPID validate +quit

Replace APPID with the Steam application ID of the Valheim dedicated server; the correct value is in the game's official server documentation. A wrong ID does not throw an error, it silently downloads a different package.

The install directory ships an example start script. Copy it rather than editing it in place; every update overwrites the original and your edits are gone. Change only the parameters in your copy and leave the environment variables at the top of the script alone — without them the server cannot find its own libraries.

3. Launch parameters and the world

In Valheim the configuration does not live in a separate ini file but in the launch parameters: server name, port, world name, password, and whether the server appears in the public list.

Two things deserve attention here. First, the world name is a file name. Starting the server with a different world name does not delete the old world, but it drops you into an empty new one; players say "our progress is gone" while the file sits untouched on disk. Second, the password in the parameters is the one players type, and it is not allowed to appear inside the server name — a rule enforced not silently but with a start-up error.

Define the server as a systemd service with Restart=always. A server left attached to your SSH session shuts down the moment that session closes.

4. Ports

PortProtocolPurpose
2456UDPGame traffic
2457UDPServer query / listing
2458UDPAdditional channel used by the server

Open all three. The common Valheim mistake is opening only the game port: the server runs, players can join by direct IP, but it never appears in the public list. All of these are UDP; opening TCP achieves nothing.

RAM is set by the explored world, not the player count

This is the most misunderstood part of Valheim. The server keeps world state in memory, and as players open up the map both the save file and the in-memory world grow. The practical consequence: the same 10 people use noticeably more memory six months in than they did on day one.

So the "there are 10 of us, the small plan is enough" calculation is right in month one and wrong in month six. If the server is meant to last, leave a step of headroom from the start.

On the CPU side the server runs largely on a single thread. Adding cores brings no measurable gain; if you are seeing stutter, the answer is a better processor family rather than more cores.

The world file: a single point of failure

A Valheim world consists of two files: the save file holding world data and a metadata file that pairs with it. They are a pair, and backing up only one of them is useless.

The correct backup flow is: pin the save directory with a launch parameter (the default sits under the user's home directory — verify the exact path once before writing a backup script), stop the server briefly, copy the pair together to a remote target, and actually test a restore once. A widely explored world cannot be regenerated; when it is corrupted, that backup is the only thing you can return to: server backup strategy

The most common first-boot mistakes

  1. Opening only 2456. The server runs but never appears in the public list.
  2. A password under five characters, or one contained in the server name. The server will not start.
  3. Mistyping the world name. You land in an empty world and assume the progress is gone.
  4. Editing the example start script in place. The first update wipes your settings.
  5. Buying a many-core plan without checking clock speed. The server runs largely on one thread.
  6. Backing up only the save file. Without its paired metadata file the world will not open.

On DDoS

Valheim carries all of its traffic over UDP, and because a UDP source address can be forged, floods cannot be blocked at the application layer; filtering has to happen at the network layer. Which layer the filtering happens at: what is DDoS protection?

At Datafex, layered Fexwall DDoS protection is included free regardless of which plan you are on.

Next step

We have put the recommended plans by player count and mod list, the processor options and the Valheim-specific questions on one page: Valheim server plans.

If you want to act on what is in this guide:

See recommended server plans for Valheim

Related guides