Playing Valheim with friends is fun until the world depends on one person being online. In a normal peer-hosted game, the world only runs while the host has it open. When they log off, everyone else loses access, which can make building, farming, exploring, and planning boss fights harder than it needs to be.

A Valheim dedicated server solves this by running the world separately from a player’s game session. You can either self-host it on your own PC, spare machine, or VPS, or use dedicated Valheim hosting to avoid the manual setup. This guide explains both options, starting with the self-hosting method and then showing why managed hosting is often easier for beginners.

What a Valheim Dedicated Server Actually Does

Before jumping into commands, it helps to understand what you are setting up. A Valheim dedicated server is a separate server application that runs your world in the background. Instead of one player opening Valheim and hosting the world from inside the game, the server software keeps the world available for players to join.

That does not automatically mean the server is always online. If you self-host from your personal PC, the server only stays online while that PC is turned on, connected to the internet, and running the server program. If your computer shuts down, restarts, loses internet, or closes the server window, your Valheim world goes offline too.

This is why there are two main ways to host a Valheim server. The first is self-hosting, where you handle the setup yourself. This gives you control, but it also means dealing with server files, commands, passwords, ports, firewall rules, updates, and backups. The second is dedicated Valheim hosting, where a hosting provider runs the server for you. That option is usually better if you want a world that is easier to keep online without managing everything manually.

Self-Hosting A Valheim Server

Before you start, remember that self-hosting is the hands-on option.The steps below are written for complete beginners, so you can follow them even if you have never hosted a game server before.

To start, you need a PC or VPS that can stay online, a stable internet connection, and access to your router if you use normal Steam networking. Choose three names now: your server name, your world file name, and your password. Keep the world name simple, like PineWorld, because Valheim creates files with that name.

On Windows, the easiest install is through Steam. Open Steam, go to Library, change the dropdown to show Tools, install Valheim Dedicated Server, then right-click it and choose Manage > Browse local files. The official server guide says the Windows launch file is start_headless_server.bat; make a copy first, because Steam updates can reset the original file.

Open your copied .bat file in Notepad and look for the line that starts the server. Replace the values with your own:

@echo offset SteamAppId=892970valheim_server.exe -nographics -batchmode -name "Pineheim" -port 2456 -world "PineWorld" -password "ChangeThis123" -public 1

-name is what players see in the server list. -world is the saved world file. -password is what friends type to join. -public 1 lists it publicly; use -public 0 for a private Join IP server.

You can also install with SteamCMD. Create folders like this:

mkdir C:\steamcmdmkdir C:\valheim-server

Put steamcmd.exe inside C:\steamcmd, then run:

C:\steamcmd\steamcmd.exe +login anonymous +force_install_dir C:\valheim-server +app_update 896660 validate +quit

Steam app 896660 is the Valheim Dedicated Server tool. After it downloads, start the server from C:\valheim-server using your edited batch file.

On Ubuntu Linux, create folders and install the server like this:

sudo apt updatesudo apt install -y curl tar lib32gcc-s1 lib32stdc++6 libatomic1 libpulse-dev libc6mkdir -p ~/steamcmd ~/valheim-servercd ~/steamcmdcurl -L "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" -o steamcmd_linux.tar.gztar -xzf steamcmd_linux.tar.gz./steamcmd.sh +login anonymous +force_install_dir "$HOME/valheim-server" +app_update 896660 validate +quit

Then create a launch file:

cd ~/valheim-servernano start_pineheim.sh

Paste:

#!/bin/bashexport templdpath=$LD_LIBRARY_PATHexport LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATHexport SteamAppID=892970./valheim_server.x86_64 -nographics -batchmode -name "Pineheim" -port 2456 -world "PineWorld" -password "ChangeThis123" -public 1export LD_LIBRARY_PATH=$templdpath

Save it, then run:

chmod +x start_pineheim.sh./start_pineheim.sh

When the console says Game server connected, your server is live. Stop it safely with CTRL+C, not by closing the window.

For internet access, open UDP ports 2456 and 2457 in your Windows Firewall or Linux firewall and forward those same UDP ports in your router to the server machine’s local IP address. The official guide notes that Valheim uses the selected port and the next port, so the default is 2456-2457. If you add -crossplay, Valheim uses the Crossplay backend and does not require router port forwarding, but players connect through the public IP, server list, or join code rather than a local loopback address.

Your save files matter most. On Windows, the base folder is %USERPROFILE%\AppData\LocalLow\IronGate\Valheim; on Linux it is ~/.config/unity3d/IronGate/Valheim. World files are usually inside worlds_local. Back up both files together: PineWorld.db and PineWorld.fwl. The .db file is the actual progress, buildings, terrain changes, and explored world. The .fwl file identifies the world and seed. Copy both before updates or mod changes.

To make Linux start automatically after reboot, create a systemd service:

sudo nano /etc/systemd/system/valheim.service

Paste:

[Service]User=YOURUSERWorkingDirectory=/home/YOURUSER/valheim-serverExecStart=/home/YOURUSER/valheim-server/start_pineheim.shRestart=on-failure

Then run:

sudo systemctl daemon-reloadsudo systemctl enable --now valheimsudo journalctl -u valheim -f

Friends can join from Valheim by choosing Join Game > Join IP and entering YOUR_PUBLIC_IP:2456. If you play on the same PC, use 127.0.0.1:2456; on the same home network, use the server’s local IP, like 192.168.1.50:2456.

Why Dedicated Valheim Hosting Is Easier

Self-hosting works, but it is manual. You manage SteamCMD, firewall rules, router forwarding, world backups, updates, restarts, logs, and uptime. Your home PC must stay powered on, your internet upload speed matters, and some home connections use CGNAT, which can break port forwarding completely.

Dedicated Valheim hosting removes most of that work. Instead of editing scripts and troubleshooting router pages, you get a control panel, quick startup, easier restarts, file access, backups, and hosting hardware that is meant to stay online. It is the better choice for a persistent Viking world because the server is not tied to one friend’s computer, schedule, or internet connection.

Start Your Valheim Server With Pine Hosting

Want the persistent world without the manual setup? Pine Hosting makes Valheim server hosting simple: choose your plan, set your server name and password, upload an existing world if you have one, and invite your clan.

Skip SteamCMD, port forwarding, firewall errors, and late-night troubleshooting. Start your Valheim server hosting with Pine Hosting and keep your Viking world online for every raid, build, and boss fight.