Launch sale20% off everything — celebrating the launch of GHosting!
← All guides

How to Set Up a Valheim Dedicated Server

A Valheim dedicated server keeps your world online when the usual host logs off. Friends can build, sail, and explore on their own schedules, while the world lives on one machine instead of whichever player happened to start the session.

This guide is for setting up that machine yourself. It covers Windows and Linux, the two UDP ports Valheim actually uses, Steam versus crossplay networking, world files, backups, and the mistakes that most often leave a healthy server unreachable.

Vikings sailing toward a Valheim settlement on a persistent dedicated server Skip the home setup and configure a managed Valheim server

Valheim 1.0 and the Deep North are live

Iron Gate released Valheim 1.0 and the Deep North on September 9, 2026. The release covers PC, Linux, Mac, Xbox, PlayStation 5 and Nintendo Switch 2, with full crossplay between those platforms. That makes crossplay configuration more important for a dedicated server than it was during Early Access.

Existing worlds continue to work, but new Deep North terrain generates properly only in unexplored areas. Mods are not officially supported and may need updates for 1.0. Before updating:

  • Make an off-machine copy of the complete world and permission files.
  • Update the server and every client together so the group does not split across incompatible builds.
  • Check every BepInEx mod against its author's stated 1.0 compatibility before loading the production world.
  • Keep the last pre-1.0 backup until the group has explored, built, saved and restarted successfully on the new version.

The dedicated-server launch arguments did not change for 1.0. Read our Valheim 1.0 server update for the biggest additions, world-generation advice, mod caveats and the results of our live connection test. Iron Gate's official release notes contain the complete upstream patch summary.

What the server needs

  • A machine that stays on. An old desktop, mini PC, or Linux box works. Allow at least 4 GB of free RAM for a normal vanilla world, with more headroom for a heavily explored world or BepInEx mods.
  • A stable connection. Upload speed is rarely the hard part for a small group, but packet loss and Wi-Fi instability are. Use Ethernet if possible.
  • A reachable network. The Steam backend needs port forwarding. Crossplay uses a relay and can work without it, which is useful behind CGNAT.
  • SSD storage and backups. The install is small, but the world is valuable. Keep copies somewhere other than the server machine.

Windows setup through Steam

In Steam, open the Library filter and enable Tools. Install Valheim Dedicated Server, then use Manage and Browse local files to open its folder. Copy start_headless_server.bat before editing it, because an update can replace the original.

The launch line needs a server name, world name, password, port, and visibility. The important arguments are -name, -world, -password, -port 2456, and -public 1. The password must be at least five characters and cannot appear inside the server name. Save the file and run your copied batch file. Allow the server through Windows Firewall when prompted.

Linux setup with SteamCMD

Valheim's dedicated-server app ID is 896660 and supports anonymous SteamCMD login. Install SteamCMD from your distribution, create a separate unprivileged user for the game, choose an install directory, and download app 896660. The server binary is valheim_server.x86_64.

Launch it with -nographics -batchmode followed by the same name, world, password, port, and public arguments used on Windows. The official Linux build also needs libatomic and PulseAudio libraries. Run the process under systemd or another service manager so it restarts after a crash or machine reboot.

Ports: use 2456 and 2457, not just one rule

With the Steam backend, Valheim uses the selected UDP port and the next UDP port. At the default setting that is UDP 2456–2457. Forward both ports from your router to the server machine, allow both through the machine's firewall, and make sure the launch script still says -port 2456.

If the server works from inside your home but friends cannot reach it, check the router rule, the server machine's private IP, Windows or Linux firewall rules, and whether your ISP uses CGNAT. A changing private address can silently point an old router rule at the wrong device, so reserve that address in DHCP.

Steam backend or crossplay?

The default Steam backend is for Steam clients. Add -crossplay to use Valheim's PlayFab backend when Xbox, Microsoft Store, or other supported platforms need to join. Crossplay servers provide a join code and use a relay, so they do not need home-router port forwarding.

There is one surprising limitation: a crossplay server cannot be reached through a local or loopback address. Use its public address, join code, or server-list entry even when the client is on the same network.

Move an existing world

Since Valheim 1.0 a world is a folder named after it. Inside are four _main files for the latest save (.fwl2, .db2, .chunks and a small .ok marker written last) and one .chunk file per region of the map. A world last saved before 1.0 is still a matching .db and .fwl pair, and a 1.0 server converts it to a folder on its first save, keeping the original pair as a _backup_ copy.

Quit the world to the main menu, stop the dedicated server, then copy the whole folder (or both files of an older world) into the server's worlds_local directory and set -world to the folder name. Three things make the server quietly create a fresh world instead: a save whose .ok marker is missing, which Valheim deletes as unfinished; a folder nested one level too deep; and a name the server already has, because Valheim keeps only one of two worlds with the same name. A missing .chunk file stops the server from loading at all.

With Steam Cloud saving on, which is always the case on macOS, the live world is in your Steam folder under userdata/<id>/892970/remote/worlds. The folder with the same name in worlds_local then only holds the drawn map, which is easy to copy by mistake.

Our free world migration checker confirms all of that before you upload: point it at the world folder and it reads it in your browser, applies the same save-selection rules the game uses, checks that every region file is there, and tells you if you picked a backup or the map cache. Nothing is uploaded to us.

If you use -savedir, the worlds and permission files live below that path instead of the platform default. This is a clean way to keep the entire server state in one directory for backups.

Backups and updates

Valheim keeps automatic rolling backups. The official defaults retain four, with a short backup after two hours and longer backups twelve hours apart. Those copies are helpful, but they are still on the same disk. Regularly copy the save directory to another machine or storage service while the server is stopped.

When Valheim updates, clients usually update before a manually managed server does. If players see an incompatible-version message, stop the process, run the Steam or SteamCMD update, and start it again. Keep your edited launch script outside the path that the update replaces.

Common connection failures

  • Server starts but nobody outside can join: forward both UDP ports, check the machine firewall, and rule out CGNAT.
  • Server disappeared after an update: update the server binary and confirm your copied launch script still exists.
  • A fresh world appears: check that -world matches the folder name, that the folder sits directly in worlds_local under the directory selected by -savedir, and that its latest save has its .ok marker.
  • Xbox cannot join: enable -crossplay and share the join code.
  • Password is rejected: use at least five characters and do not include the password inside the server name.

When renting is the simpler option

Self-hosting is a good fit when you already have a machine, a reliable connection, and you enjoy maintaining it. The hidden costs are electricity, router work, updates, backups, and the person in the group who becomes permanent on-call support.

A managed host runs the same dedicated-server software in a datacenter and handles the machine around it. If you would rather skip SteamCMD and port forwarding, compare our Valheim server hosting plans. They include a fixed address, DDoS protection, file access, and a control panel, with no automatic renewal.

The command names, default port pair, crossplay behavior, and backup defaults above are documented in the official Valheim dedicated-server guide.