On your own Valheim server your world keeps running around the clock – reachable any time, with your own rules, whether or not the host is online. There are two ways to get one: a manual install with SteamCMD, or a ready-made game server. This guide covers the manual setup on Windows and Linux, plus world, password, crossplay, admin, mods, backups and troubleshooting.

Valheim server – low-poly Viking village with a longhouse, dragon longship and snowy mountains in evening light

Info
Last reviewed on 1 August 2026 against Valheim's official dedicated-server guide. App ID, ports and launch parameters reflect the current state.

What you'll learn in this article

  • Install the Valheim dedicated server with SteamCMD on Windows and Linux
  • Set world, password and crossplay correctly (and avoid the most common password trap)
  • Open ports 2456/2457 UDP – or play with no port forwarding at all using crossplay
  • Connect, set up admins and a whitelist, and use mods via BepInEx
  • Create backups, move your world and update the server

Quick version: a Valheim server in 7 steps

  1. Choose a suitable PC, VPS or dedicated server (Valheim is light).
  2. Install SteamCMD.
  3. Download the server files with App ID 896660.
  4. Create a launch script with -name, -world and -password.
  5. Start the server (creates the world).
  6. Open 2456/2457 UDP – or use -crossplay and connect by join code.
  7. Connect via Steam server favourites using IP:2456.

Contents

Requirements and hardware

A Valheim server is comparatively light. Demand rises with world size and player count; at the same time, about 10 players max is the design target.

Use casePlayersRAM guideline
Small to medium worldup to 52–4 GB
Larger world / more playersup to 104–8 GB

A solid CPU, an SSD and – without crossplay – a public IPv4 address for a home server also matter. With DS-Lite/CGNAT, normal port forwarding is often impossible; crossplay works around that (see below).

Tip
Don't want to deal with SteamCMD, firewall and updates? A ready-made Valheim server at DeinServerHost comes pre-installed and is managed through a web panel.

Installation

On Windows

Download SteamCMD from Valve, extract it to C:\steamcmd and run steamcmd.exe once. Then download the server files:

steamcmd.exe +login anonymous +app_update 896660 validate +quit

App ID 896660 is the Valheim dedicated server (the client app ID is different; 896666 doesn't exist). Create a start.bat:

valheim_server.exe -nographics -batchmode -name "My Server" -port 2456 -world "MyWorld" -password "secret123" -public 1

The first start creates the world MyWorld.

On Linux

For Debian/Ubuntu: create a dedicated user and install SteamCMD.

sudo adduser --disabled-password --gecos "" valheim
sudo dpkg --add-architecture i386
sudo apt update && sudo apt install -y steamcmd

Install the server:

sudo -iu valheim
steamcmd +login anonymous +force_install_dir /home/valheim/vhserver +app_update 896660 validate +quit

Set the name, world and password in the bundled start_server.sh. For 24/7 operation, set up a systemd service – create /etc/systemd/system/valheim.service:

[Unit]
Description=Valheim Dedicated Server
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=valheim
WorkingDirectory=/home/valheim/vhserver
ExecStart=/home/valheim/vhserver/valheim_server.x86_64 -nographics -batchmode -name "My Server" -port 2456 -world "MyWorld" -password "secret123" -public 1
Environment=LD_LIBRARY_PATH=/home/valheim/vhserver/linux64
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Enable it and check the logs:

sudo systemctl daemon-reload
sudo systemctl enable --now valheim
sudo journalctl -u valheim -f

World, password & crossplay

  • -world "Name" sets which world is loaded (or created on first start).
  • -password is required and has two rules: at least 5 characters and it must not appear as a substring of -name. Break either rule and the server won't start.
  • -public 1 lists the server publicly; -public 0 makes it private (reachable only by direct connection/code).
Important
Enable crossplay with the -crossplay flag. The connection then runs over the PlayFab backend, players join by join code – and you need no port forwarding in the router. That's the easiest route if your connection uses DS-Lite/CGNAT.

Ports & firewall

PortProtocolPurpose
2456UDPgame port (set with -port)
2457UDPSteam server query (automatically -port + 1)

Valheim uses two consecutive UDP ports. A TCP-only rule does nothing.

Windows (PowerShell as administrator):

New-NetFirewallRule -DisplayName "Valheim 2456-2457 UDP" -Direction Inbound -Protocol UDP -LocalPort 2456-2457 -Action Allow

Linux (ufw):

sudo ufw allow 2456:2457/udp

On a home network, add router port forwarding. With -crossplay, port forwarding is unnecessary – players then connect only via the join code.

Connecting to the server

Without crossplay, add the server in Steam via View → Servers → Favorites using IP:2456, then join it in-game under Join → Favorites. With crossplay, choose Join → Crossplay in-game and enter the join code. Either way you need the server password.

Admin, whitelist & ban

You control access and rights through three text files in the save directory (one SteamID64 per line):

FilePurpose
adminlist.txtadmins (can moderate in-game)
permittedlist.txtwhitelist – only these players may join
bannedlist.txtbanned players

Restart the server after changes. Admins can also moderate from the server console or the in-game F5 console.

Installing mods (BepInEx)

Valheim mods run on the BepInEx framework (usually from Thunderstore). Install BepInEx in the server directory and drop the mods into the plugins folder.

Caution
The server and client must run the same server-relevant mods at the same version. A version mismatch causes errors or disconnects on join. After a Valheim update, update BepInEx first, then the mods.

Backups & transferring your world

A world consists of two files with the same name: WorldName.db (the world itself) and WorldName.fwl (metadata). Always back up both together. They live here:

  • Windows: %USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worlds_local\
  • Linux: ~/.config/unity3d/IronGate/Valheim/worlds_local/

Stop the server before a clean backup. To move a world, copy .db and .fwl into the new server's worlds_local directory and start it with the same -world name.

Tip
With -savedir "PATH" you can freely set the save directory – handy for separate worlds or a dedicated backup target.

Updates

After a Valheim update, pull the server files:

steamcmd +login anonymous +app_update 896660 validate +quit

Then restart the server (sudo systemctl restart valheim on Linux). Back up .db and .fwl before every update.

Troubleshooting

ProblemCause & fix
Server won't startpassword breaks the rule: at least 5 characters and not part of -name
Server not in the list2456/2457 UDP blocked, or -public 0 set
Connection failswrong IP/port, no router forwarding, or DS-Lite/CGNAT – use crossplay instead
Crossplay code doesn't work-crossplay not set, or the server hasn't fully started
Join errors with modsserver and client mods don't match
World missing after a moveonly one of the two files copied – you need .db and .fwl

Frequently asked questions about the Valheim server

How much RAM does a Valheim server need? 2–4 GB is enough for small to medium worlds; 4–8 GB for larger worlds or up to 10 players.

Which ports does a Valheim server need? 2456/UDP and 2457/UDP (consecutive). TCP does nothing. With -crossplay, no port forwarding is needed.

How does crossplay work in Valheim? With the -crossplay flag the server runs over the PlayFab backend; players join by join code, without port forwarding.

Why won't my Valheim server start? Usually the password rule: it must be at least 5 characters and must not appear as part of the server name.

Where are the world and save files? Under worlds_local in %USERPROFILE%\AppData\LocalLow\IronGate\Valheim\ (Windows) or ~/.config/unity3d/IronGate/Valheim/ (Linux), as .db and .fwl.

How do I install mods on a Valheim server? Via BepInEx: install the framework, put mods in the plugins folder. Server and client need the same mods/versions.

Summary

A Valheim server is quick to set up with SteamCMD and App ID 896660. Watch the two UDP ports 2456/2457, the password rule (at least 5 characters and not part of the name), and always back up .db and .fwl together. With -crossplay you can even play with no port forwarding at all. If you'd rather not manage the OS and firewall, you can also rent a Valheim server.