Valheim Wiki
Advertisement
Valheim Wiki

Server Requirements

  • Operating System: Windows 7, 8, 8.1, Server 2016, Server 2019, Linux
  • CPU: Quad-core processor
  • RAM: ~2GB
  • Storage: ~2GB

Automated Setup

Docker

If your server is running Docker, you can find community images on Docker Hub. At the time there is no offical docker image for Valheim dedicated server available.

List of popular images

Image Features Pulls
lloesche/valheim-server
  • Auto update
  • Auto backup
  • ValheimPlus support
  • Event hooks
  • Extensive logging
over 5 million
mbround18/valheim
  • Auto update
  • Auto backup
  • Event hooks
  • Mod support
over 1 million


Manual Setup

Step 1: Download the Server files

Windows

  1. Create a folder where you wish to install your Valheim dedicated server
  2. Download SteamCMD into that folder
  3. Create a batch file named InstallUpdate.bat
  4. Place the following code in this batch file:
    @echo off
    
    steamcmd.exe +login anonymous +force_install_dir "C:\Your\Valheim\Folder" +app_update 896660 validate +quit
    
  1. Right-click InstallUpdate.bat and Run as Administrator
  2. Your game server files will be downloaded into the folder path used in the batch file

Linux

  1. Create a folder where you wish to install your Valheim dedicated server
  2. Install SteamCMD
  3. Create a Valheim install and validate script named InstallUpdate.sh
  4. Place the following code in this script
#!/bin/sh
steamcmd +@sSteamCmdForcePlatformType linux +login anonymous +force_install_dir /path/to/server +app_update 896660 validate +quit
  1. Make this script executable
sudo chmod +x /path/to/script
  1. Run the script to install. Whenever Valheim is updated, run this script again.

Step 2: Setting up a Valheim Dedicated Server

Windows

  1. Create a batch file named StartServer.bat in your Valheim server folder from Step 1
  2. Place the following code in this batch file:
@echo off
set SteamAppId=892970
echo "Starting server PRESS CTRL-C to exit"
valheim_server.exe -nographics -batchmode -name "YourWorldName" -port 2456 -world "YourWorldFilename" -password "YourPassword" -public 1
  1. Right-click StartServer.bat and Run as Administrator to start your server

Linux

  1. Create a script named valheim.sh in your Valheim install directory
  2. Place the following code in this script
#!/bin/sh 
export templdpath=$LD_LIBRARY_PATH  
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH  
export SteamAppID=892970

echo "Starting server PRESS CTRL-C to exit"  
./valheim_server.x86_64 -name "<servername>" -port 2456 <-nographics> <-batchmode> -world "<worldname>" -password "<serverpassword" -public 1  
export LD_LIBRARY_PATH=$templdpath
  1. Save and run this script to start the server

Step 3: Port Forwarding / Remote Access

Add an incoming rule to your Windows Firewall to allow TCP/UDP port (game port) 2456, (Steam query port) 2457

You may additionally need to add a forwarding rule to your network router. You can use PortForward.com to read how to do this.

Location of World Save Data

To locate your save folder, navigate to this folder:

%userprofile%/AppData/LocalLow/IronGate/Valheim/Worlds

For linux, navigate to this directory:

$HOME/.config/unity3d/IronGate/Valheim/worlds

There will be two files:

  • Dedicated.db (your map data)
  • Dedicated.fwl (your identifier which includes your worldname and seed)


Location of Server Log Files

Linux

Connection logs are located under /home/username/.steam/logs

  • Connection logs for the valheim server are named connection_log_2456.txt
    • Where 2456 is the port number your server is listening on (2456 is the default value)

Server logs require you to edit the valheim.sh (or whatever name you called your script to start the server) in order to be saved.

  • Open your valheim.sh in any text editor
  • append this to the end of the ./valheim_server.x86_64
    >> /tmp/valheim_log.txt < dev/null &
    

  • Your file should now look something like this:
    #!/bin/sh 
    export templdpath=$LD_LIBRARY_PATH  
    export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH  
    export SteamAppID=892970
    
    echo "Starting server PRESS CTRL-C to exit"  
    ./valheim_server.x86_64 -name "<servername>" -port 2456 <-nographics> <-batchmode> -world "<worldname>" -password "<serverpassword" -public 1 >> /tmp/valheim_log.txt < /dev/null &  
    export LD_LIBRARY_PATH=$templdpath
    
  • >> /tmp/valheim_log.txt tells the linux kernal to pipe anything received on stdout to this text file instead.
  • < /dev/null & is used to instantly send EOF to the program, so that it doesn't wait for input (/dev/null, the null device, is a special file that discards all data written to it, but reports that the write operation succeeded, and provides no data to any process that reads from it, yielding EOF immediately). & is a special type of command separator used to background the preceding process. ref
Advertisement