What you need first
- A machine that stays on. The world only exists while the server runs, so a PC that sleeps or goes off at night takes the world with it.
- Memory. Our servers sit at about 1.4 GB with nobody on. A small group on a fresh world is comfortable in 4 GB; big, well-explored worlds and mods want more.
- Players. The dedicated server takes 10 players without mods, whatever the hardware.
1. Install the server with SteamCMD
The dedicated server is its own Steam app, 896660, separate from the game, and it downloads with an anonymous login: you don't need to own Valheim on the server machine. With SteamCMD installed:
steamcmd +force_install_dir ~/valheim +login anonymous +app_update 896660 validate +quit
+force_install_dir has to come before +login. Run the same line again whenever Valheim updates: players can only join a server on the same build as their game.
2. Crossplay needs three libraries on Linux
Crossplay runs on a separate backend that needs a few system libraries a minimal Linux install often lacks. On Debian or Ubuntu:
sudo apt install libatomic1 libpulse0 libpulse-mainloop-glib0
A Steam-only server works without them.
3. The launch line
The download includes an example start_server.sh you can edit. This is the same thing written out, the way we run it:
cd ~/valheim export SteamAppId=892970 export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH ./valheim_server.x86_64 -nographics -batchmode \ -name "My Server" -port 2456 -world "Dedicated" \ -password "longsecret" -public 0 -savedir ~/valheim-saves
SteamAppId=892970is the game's own app id (the server is 896660), andLD_LIBRARY_PATHputs the server's bundled libraries first.-nameis what the community server list shows.-portis the first of the three ports the server uses (see below). 2456 is the default.-worldis the save's name. A new name starts a new world; an existing one loads it.-public 1lists the server under Join game → Community;0keeps it unlisted, so only people you give the address (or join code) can find it.-savediris where the worlds (inworlds_local) and the admin, ban and permitted lists live. Without it they go under~/.config/unity3d/IronGate/Valheim.
World presets and modifiers (-preset, -modifier, -setkey) go on the same line; the world modifiers guide lists them.
The password rules
The server refuses to start unless the password is at least 5 characters and doesn't appear inside the server name or the world name. A server called “Viking Hall” with the password “Viking” won't start. Everyone joining has to type it, so make it long rather than clever.
4. Open the ports
A world uses three UDP ports, counting up from -port: the game port, the Steam query port one above it, and the crossplay port one above that. With the default, that's UDP 2456–2458. Allow them through the machine's firewall and, at home, forward them on your router to the server's local address. For example, with ufw:
sudo ufw allow 2456:2458/udp
Running a second world on the same machine? Start it three ports higher (-port 2459) so the ranges don't overlap.
Turning on crossplay
Add -crossplay to the launch line and the server writes a 6-digit join code to its log when it starts. Friends on Xbox, PC Game Pass, PlayStation 5 and Switch 2 join with that code instead of an address, and Steam players can use it too. The code changes every time the server restarts, and a modded server can't use crossplay. More in the crossplay guide.
5. Stop it without losing progress
Valheim saves the world when it gets Ctrl+C (SIGINT). A plain kill (SIGTERM) or kill -9 loses everything since the last autosave, which runs every 30 minutes. If you run it as a systemd service, set the stop signal and give a big world time to finish writing:
KillSignal=SIGINT TimeoutStopSec=90
After it's running
- Make yourself an admin with
adminlist.txtin the save folder: admin commands. - Bring an existing world from your single-player game: moving a world to a server.
- Tell your friends how to join: joining by IP.
Or skip the setup
Wyrm Host runs this exact setup for you: the install, the ports, updates when the world is empty, and crossplay as a switch on the dashboard instead of a launch option. Every tier takes 10 players, from $8.99/mo billed yearly. See Valheim server hosting.
Wyrm Host is an independent hosting service and is not affiliated with, endorsed by, or sponsored by Iron Gate AB or Coffee Stain Publishing. Valheim is a registered trademark of Iron Gate AB. You need your own copy of the game to play. Facts on this page about Valheim's own dedicated server are from Iron Gate's dedicated-server documentation and the game's launch options; check them again if a game update has landed since 2026-11-02.