In short
To set up a Valheim server, download Valheim Dedicated Server (App ID 896660) with SteamCMD and start it with the -name, -world, -password and -port parameters. The password must be at least 5 characters and must not contain the server name. By default, UDP ports 2456-2457 are used; your friends connect through the in-game Join IP screen or Steam favorites.
In this guide
- What is a Valheim dedicated server?
- Setup options
- Step-by-step setup on Linux
- Launch parameters
- Ports and firewall
- Connecting to the server and adding it to Steam favorites
- Admin rights and permission lists
- Persistent world: save files and backups
- Running the server as a systemd service (Linux)
- Keeping the server up to date
- Common problems after setup
- How much RAM do you need?
- Next step: keep your world online 24/7
In Valheim, a world you host from your own PC shuts down when you close the game. For a persistent world your friends can join any time, you need to set up a Valheim Dedicated Server. It's free server software that runs separately from the game, needs no graphics card and can stay online 24/7. This guide walks you step by step through installation, launch parameters, ports, adding the server to Steam favorites and keeping your world safe.
What is a Valheim dedicated server?
Valheim Dedicated Server is the server application Iron Gate distributes for free on Steam. Its Steam App ID is 896660, and you can download it anonymously with SteamCMD without buying the game. It's available for Linux and Windows. In vanilla (unmodded) Valheim, a world can hold up to 10 players at once.
Setup options
| Option | Pros | Cons |
|---|---|---|
| Host from in game | No setup needed | The world shuts down when you leave, and it strains your PC |
| Dedicated server on your own PC | Free | The PC must stay on all the time, and port forwarding is required |
| Game panel (rented server) | Online 24/7, automatic setup, managed from a panel | Monthly cost |
| Install it yourself on a VDS | Full control | Requires Linux/Windows admin skills |
If you want to get started without the setup hassle, our Valheim server plans with automatic setup get your world up and running in minutes. If you'd rather do it yourself, follow the steps below.
Step-by-step setup on Linux
- Create a separate user. Don't run the server as root.
sudo adduser --disabled-password --gecos "" valheim
sudo su - valheim- Download the server with SteamCMD. Install SteamCMD with your distro's package manager or from Valve's official archive, then run:
steamcmd +force_install_dir /home/valheim/server +login anonymous +app_update 896660 validate +quit- Prepare the start script. Copy and edit the
start_server.shfile in the install folder:
#!/bin/bash
export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970
./valheim_server.x86_64 -name "Vikingler TR" -port 2456 -world "Midgard" -password "guclusifre" -public 1 -savedir "/home/valheim/kayitlar"
export LD_LIBRARY_PATH=$templdpath- Run the script. Make it executable with
chmod +x start_server.shand start it with./start_server.sh. Usescreen,tmuxor a systemd service so the server doesn't stop when your SSH session closes. - Watch the console. Once the world is generated and loaded, players can connect.
The same logic applies on Windows: after downloading with SteamCMD, edit the start_headless_server.bat file in the folder and put your parameters on the valheim_server.exe line.
Launch parameters
| Parameter | What it does |
|---|---|
-name | The name shown in the server list |
-world | World (save) name. If no world with this name exists, a new one is created |
-password | Join password. Must be at least 5 characters and must not contain the server name |
-port | Game port, 2456 by default |
-public | 1: shown in the community list, 0: join by IP only |
-savedir | The folder where world and config files are saved |
-saveinterval | Autosave interval (seconds) |
-crossplay | Enables playing with Xbox and Game Pass players |
The most common mistake is the password rule: using -name "Vikingler" together with -password "Vikingler123" stops the server from starting. Pick a password completely different from the server name. With -crossplay enabled, connections go through PlayFab instead of Steam, and the console shows a join code players can use to connect.
Ports and firewall
Valheim uses the port you set with -port and the one above it, over UDP. With default values, 2456 is the game port and 2457 is the query port. Some sources recommend opening 2458 as well for safety.
# Ubuntu (ufw)
sudo ufw allow 2456:2458/udp
# Windows (admin PowerShell)
New-NetFirewallRule -DisplayName "Valheim" -Direction Inbound -Protocol UDP -LocalPort 2456-2458 -Action AllowIf the server is on your home PC, you need to forward the same UDP ports to the server's local IP address in your router's admin page. On rented servers, the ports come ready. If you changed the port number, remember to update the firewall rule, the Join IP address and the query port in your Steam favorite to match; most connection problems come from one of these three being left outdated.
Connecting to the server and adding it to Steam favorites
Players can connect to the server in three ways:
- Join IP: In game, go to Start Game, pick your character, open the Join Game tab and click Join IP; type
sunucu-ip:2456and enter the password. - Community list: If
-public 1is set, search for the server name on the Community tab of the Join Game screen. It can take a few minutes to appear in the list. - Steam favorites: In Steam, go to View, Game Servers, the Favorites tab, then Add a Server, and enter
sunucu-ip:2457. Because Steam uses the query port, you enter the game port plus one here. Then connect with one click from the Favorites list on the in-game Join Game screen.
If you have trouble connecting, our guide to fixing "can't connect to Valheim server" covers the most common errors one by one.
Admin rights and permission lists
When the server first runs, three text files are created in the save folder:
- adminlist.txt: The IDs of players who will be admins. They can use commands like kick, ban and save in the in-game F5 console.
- bannedlist.txt: Banned players.
- permittedlist.txt: If it has entries, only listed players can join (whitelist).
Put one player ID per line. Steam players use their 17-digit SteamID64; on crossplay servers, the ID may have a platform prefix (e.g. Steam_7656119...). Restart the server after making changes.
Persistent world: save files and backups
A Valheim world consists of two files: .db (structures and objects in the world) and .fwl (world name and seed). Default locations:
- Linux:
~/.config/unity3d/IronGate/Valheim/worlds_local/ - Windows:
%USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worlds_local\
If you used -savedir, the files are in the folder you specified. The server autosaves at set intervals and keeps older saves as backups; still, copy both files separately before game updates. If you want to move a world you've played on your own PC to the server, follow our guide to uploading a Valheim world to your server; all you need to do is upload the .db and .fwl files and set -world to the same name as the files.
Running the server as a systemd service (Linux)
To have the server start automatically when the machine reboots and restart when it crashes, define a systemd service. Create the file /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/server
ExecStart=/home/valheim/server/start_server.sh
KillSignal=SIGINT
TimeoutStopSec=60
Restart=on-failure
RestartSec=15
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl enable --now valheim
journalctl -u valheim -fThe KillSignal=SIGINT line matters: when the Valheim server receives this signal, it saves the world before shutting down. Killing the server outright can lose any progress made since the last save.
Keeping the server up to date
When Valheim updates, players arrive on the new version and can't connect to a server still on the old one. That's why you need to update the server after every game update. The safe order is: shut the server down cleanly, make a copy of the .db and .fwl files, rerun the SteamCMD command you used for installation with validate, and restart the server. If you use mods, don't update the server until compatible mod updates for the new version are out; otherwise the server may not start.
Common problems after setup
- Server doesn't show in the list: Even with
-public 1set, it can take a few minutes to appear. Try connecting with Join IP instead of waiting. - "Incompatible version" warning: The game was updated but the server wasn't. Rerun the SteamCMD command and restart the server.
- Password not accepted: Check the quotes and any Turkish or other non-English characters in the start script; using only English letters and numbers in the password avoids most problems.
- World was reset: If the
-worldvalue doesn't exactly match the name of your existing world file, the server creates a new world. Check the name and the-savedirpath.
How much RAM do you need?
As a general guide, 4 GB RAM is enough for an unmodded world with a few players. Memory use grows as the world is explored and more structures are built; for an active 10-player world or a server running BepInEx mods, 8 GB leaves more comfortable headroom. For a detailed table, see our Valheim RAM and player limit guide.
Next step: keep your world online 24/7
The easiest way to run a persistent world with friends is to host the server on a machine separate from your own PC. OyunBulut's OB-VAL-3 Valheim server with 8 GB RAM provides enough resources for a full 10-player world and light mods; with automatic setup and a web panel, you set the server name, world and password from your browser. Our Istanbul data center and DDoS protection give you a solid foundation for players in Türkiye. For smaller or larger needs, you can compare all Valheim server plans.
Frequently asked questions
Does it cost money to set up a Valheim server?
The Valheim Dedicated Server software is free and can be downloaded with SteamCMD without buying the game. The only cost is the computer or rented server it runs on.
What ports does a Valheim server use?
By default it uses UDP ports 2456 and 2457; some setups also open 2458. If you change the port, the server uses the port you set and the one above it.
Why won't my Valheim server start with a password error?
The password must be at least 5 characters and must not contain the server name. If either rule is broken, the server won't start.
How many players can a Valheim server hold?
In unmodded Valheim, a world can hold up to 10 players at once. You can only raise this limit with mods.
How do I add a Valheim server to Steam favorites?
In Steam, go to View, Game Servers, the Favorites tab, click Add a Server and enter the server IP with the query port, for example ip:2457. The server then shows up in the in-game Favorites list.
Can I move my own world to the server?
Yes, just upload your world's .db and .fwl files to the server's worlds_local folder and set the -world parameter to the same name as the files.