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.

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
- Choose a suitable PC, VPS or dedicated server (Valheim is light).
- Install SteamCMD.
- Download the server files with App ID
896660. - Create a launch script with
-name,-worldand-password. - Start the server (creates the world).
- Open
2456/2457 UDP– or use-crossplayand connect by join code. - Connect via Steam server favourites using
IP:2456.
Contents
- Requirements and hardware
- Installation
- World, password & crossplay
- Ports & firewall
- Connecting to the server
- Admin, whitelist & ban
- Installing mods (BepInEx)
- Backups & transferring your world
- Updates
- Troubleshooting
- FAQ
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 case | Players | RAM guideline |
|---|---|---|
| Small to medium world | up to 5 | 2–4 GB |
| Larger world / more players | up to 10 | 4–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).
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).-passwordis 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 1lists the server publicly;-public 0makes it private (reachable only by direct connection/code).
-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
| Port | Protocol | Purpose |
|---|---|---|
| 2456 | UDP | game port (set with -port) |
| 2457 | UDP | Steam 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):
| File | Purpose |
|---|---|
adminlist.txt | admins (can moderate in-game) |
permittedlist.txt | whitelist – only these players may join |
bannedlist.txt | banned 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.
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.
-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
| Problem | Cause & fix |
|---|---|
| Server won't start | password breaks the rule: at least 5 characters and not part of -name |
| Server not in the list | 2456/2457 UDP blocked, or -public 0 set |
| Connection fails | wrong 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 mods | server and client mods don't match |
| World missing after a move | only 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.
Related guides
- Colorful creature survival as an alternative: How to create a Palworld server
- Zombie survival: How to create a Project Zomboid server
- More dedicated-server guides: How to create a Rust server and How to create an ARK: Survival Ascended server
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.