Back to Blog

How to Make a Valheim Server, Step by Step

How to make a Valheim server with SteamCMD: dedicated server setup, launch settings, ports, crossplay, moving your world, mods and backups, step by step.

Nodesty Team7 min readGame servers
The word Valheim with SteamCMD, BepInEx and 2456 on a dark Nodesty background

Making a Valheim server comes down to three steps: you download the free Valheim Dedicated Server files with SteamCMD, run the server with a launch script that sets the name, world and password, and open UDP ports 2456–2457. On your own server, the world stays online even when none of your friends are in the game, and everyone can jump in and keep playing whenever they like.

This guide walks through every step of setting up a Valheim server on Linux, from requirements and SteamCMD to launch settings, crossplay, moving your world and mods.

Requirements

  • Operating system: Valheim Dedicated Server runs on 64-bit Linux and Windows. This guide uses Ubuntu and Debian; Linux uses fewer resources and is better suited to running 24/7.
  • RAM: 4 GB is a comfortable start for a vanilla world. Usage grows as the world is explored and more is built; for modded servers, go for 8 GB.
  • CPU: The server calculates physics and structures in the areas where players are. In large bases, single-core speed directly affects how smoothly the game runs.
  • Disk: The server files take up a few GB. Set aside extra space for the world and its backups.
  • Player limit: Vanilla Valheim supports up to 10 players.

All you need is to know how to connect to a server over SSH; we give you the rest of the commands step by step.

Installing SteamCMD

For security, run the server as a separate user instead of root.

  1. Install the required packages and create a user called valheim:
    sudo apt update
    sudo apt install lib32gcc-s1 libatomic1 libpulse0 curl tmux
    sudo useradd -m -s /bin/bash valheim
    sudo su - valheim
    
  2. Download SteamCMD from Valve's official archive:
    mkdir ~/steamcmd && cd ~/steamcmd
    curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
    

Downloading the Valheim server files

The Steam app ID for Valheim Dedicated Server is 896660:

~/steamcmd/steamcmd.sh +force_install_dir /home/valheim/server +login anonymous +app_update 896660 validate +quit

+force_install_dir must come before +login. Run the same command again after every Valheim update to keep the server files up to date.

Starting the server and basic settings

The server folder comes with a ready-made start_server.sh file, but every update overwrites it. To avoid losing your own settings, copy it and edit the copy:

cd ~/server
cp start_server.sh start_myserver.sh
nano start_myserver.sh

The file should look like this:

#!/bin/bash
export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970

./valheim_server.x86_64 -nographics -batchmode \
  -name "Your server name" \
  -port 2456 \
  -world "MyWorld" \
  -password "secret12345" \
  -public 1 \
  -savedir "/home/valheim/data"

export LD_LIBRARY_PATH=$templdpath
  • -name: The name shown in the server list.
  • -world: The world's name. If no world with this name exists, a new one is created on first launch.
  • -password: The server password. It must be at least 5 characters and must not contain the server name; otherwise the server won't start.
  • -public: 1 shows the server in the community list, 0 hides it. Players connect to a hidden server by IP address.
  • -savedir: The folder where world and settings files are kept. If you don't set it, ~/.config/unity3d/IronGate/Valheim is used.

Make the script executable and start it in a tmux session so the server doesn't stop when you close your SSH connection:

chmod +x start_myserver.sh
tmux new -s valheim ./start_myserver.sh

Press Ctrl + B then D to detach from the session, and return with tmux attach -t valheim. Use Ctrl + C to stop the server; Valheim saves the world as it shuts down.

Difficulty and world settings

You can set Valheim's world settings on the server with launch parameters:

  • -preset normal: A preset difficulty level. The options are casual, easy, normal, hard, hardcore, immersive and hammer.
  • -modifier raids none: Changes a single setting. For example, it turns off raids, or -modifier combat hard makes combat harder.
  • -setkey nomap: Turns on special rules, such as disabling the map.

Ports and firewall

A Valheim server uses the port you give it and the next port up. With the default setting:

  • 2456 UDP: Game traffic.
  • 2457 UDP: Steam query port; lets the server be found in the list and through Steam.

If you use ufw on Ubuntu:

sudo ufw allow 2456:2457/udp

If you're running a second server on the same machine, give it -port 2458 and open UDP ports 2458–2459. We explain how ports work in What is a port?

Connecting to the server

In the game, click Start Game and choose your character, switch to the Join Game tab, press the Add server button and enter the server's IP address and port, like 203.0.113.10:2456. After entering the password, you connect to the world. If the server is public, you can also search for it by name in the Community tab.

Crossplay

To let Xbox and PC Game Pass players join too, add -crossplay to the launch script. In this mode, connections go through PlayFab and a join code that players can use to connect appears in the server console. Some mods may not work properly while crossplay is on.

Moving your existing world to the server

You can move a world you started with friends on your own computer to the server. Each world consists of two files: WorldName.db and WorldName.fwl.

  1. Find the files on your computer. On Windows, they're in the %USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worlds_local folder.
  2. Stop the server.
  3. Copy both files to the /home/valheim/data/worlds_local folder on the server. You can use WinSCP or scp to transfer the files.
  4. Set the -world value in the launch script to the file name (without the extension) and start the server.

Admins and player management

The server's save folder (the folder you set with -savedir) contains three text files:

  • adminlist.txt: Admins. Write one SteamID64 per line.
  • bannedlist.txt: Banned players.
  • permittedlist.txt: If it isn't empty, only the players on this list can join.

You can find your SteamID64 from your Steam profile URL or on a SteamID lookup site. As an admin, open the console in-game with F5 to use commands such as kick, ban and save. If the console doesn't open, add -console to Valheim's launch options in Steam.

Mods: BepInEx

Almost all Valheim mods are built on BepInEx. The easiest way is to extract the BepInExPack Valheim package from Thunderstore into the server folder and put your mods in the BepInEx/plugins folder. After installing BepInEx, you start the server with the start_server_bepinex.sh script that comes with the package; move your own settings into a copy of this script.

Most mods must be installed both on the server and on every player's computer, and the versions need to match. Sharing the same mod list with players as a profile code through r2modman or Thunderstore Mod Manager largely prevents version mismatches.

Backups and updates

Valheim keeps automatic backups of the world in the save folder. You can change the number and frequency of backups with the -backups, -backupshort and -backuplong parameters, and the save interval with -saveinterval (in seconds). Even so, make it a habit to take a separate copy of the worlds_local folder before a major update or a mod change:

tar -czf ~/world-backup-$(date +%F).tar.gz -C /home/valheim/data worlds_local

When the game updates, players can't connect to a server running an older version. Stop the server and run the SteamCMD command again; if you use mods, make sure they're compatible with the new version.

Nodesty for your Valheim server

A Valheim server is easy to set up on a virtual server with basic Linux knowledge. Nodesty AMD Ryzen 9 9950X VPS plans deliver smooth gameplay even in large bases with single-core speeds of up to 5.7 GHz, and run in Frankfurt and New York with NVMe storage, L3–L7 nShield DDoS protection and free daily backups kept for 7 days. If you'd rather start with a ready-made server, take a look at our game server plans for games such as Minecraft, Rust and Unturned.

Valheim is a trademark of Iron Gate AB; Steam is a trademark of Valve Corporation. Nodesty is not affiliated with or endorsed by these companies.

Frequently Asked Questions

Does it cost anything to make a Valheim server?

No. The Valheim Dedicated Server software is free and downloads anonymously with SteamCMD. You only pay for the machine that keeps the server online 24/7. Players just need to own Valheim.

How many players can join a Valheim server?

Vanilla Valheim servers support up to 10 players. This limit comes from the game itself; mods that remove the limit are used for more players, but going above 10 puts a noticeable load on both the server and the players.

How much RAM does a Valheim server need?

A vanilla server uses 2–4 GB of RAM as the world is explored. For a vanilla world with 10 players, 4 GB is a comfortable start; for servers running many mods, go for 8 GB. Single-core speed also matters in Valheim.

Can I move my own world to the server?

Yes. Copy the world files from your computer (two files with the .db and .fwl extensions) to the server's worlds_local folder and start the server with the same world name. On Windows, these files are in the AppData\LocalLow\IronGate\Valheim\worlds_local folder.

Why doesn't my server show up in the in-game list?

Make sure the server was started with -public 1 and that UDP ports 2456–2457 are open. It can take a few minutes to appear in the list, and because the community list is very crowded, you may need to type the exact name when searching. In the meantime, players can connect directly by IP address with Add server.

Can Xbox and Game Pass players join my server?

Yes, if you start the server with the -crossplay parameter. In this mode, connections go through PlayFab and players join the server with the join code shown in the console. Some mods may not work while crossplay is on.

Nodesty

About the author

Nodesty Team · Infrastructure & Support

The Nodesty team runs our servers, network and DDoS protection day to day and answers customer support requests around the clock. These guides come from that work.

Related articles

Launch your server now.

Build, scale, and conquer without limits on Nodesty's premium infrastructure.

                                                                                                                                                                                                                            
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            
                                                                                                                             ············································                                                   
                                                ··································································································..........···························                                     
                                       ················..........................................................................................................................··············                             
                                  ·············.................::::::::::::::::::::::::::::::::::::::::::::::....................:::::::::::::::::::::::::::::::::::::::................···········                        
                             ············................:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::............·········                     
                         ············.................:::::::::::::::::::::::::::::::::::::::::::::::::::------------::::::::::::::::::::::::::::::----------------:::::::::::::::::::::..........········                  
                    ············......................::::::::::::::::::::::::::::::::::::------------------------------------------------------------------------------------:::::::::::::.........········                
                ··········.............................................::::::::::::::::::-------------==========================================-----------------------------------:::::::::::........·······               
             ········..................:.....................................::::::::::--------=======+++++++++++++++++++++++++++++++++++++=========================------------------::::::::::.......·······              
           ······.........::::::::::::::::::::................................:::::::-----=====++++xxxxxx**************************xxxxxxxxx++++++++++++++===================------------::::::::.......·······             
          ·····.......:::::::::::::::::::::::::::.............................:::::----===+++xxx****%%%%&&&&&&#############&&&&&&&%%%%%*******xxxxxxxx++++++++++++++==============----------:::::::......······             
         ····......::::::::-------------:::::::::::..........................::::---===+++xx***%%%&&&####@@@@@@@@@@@@@@@@@@@@@@@@####&&&&&%%%%*******xxxxxxxxx+++++++++++++===========--------::::::......·····             
        ····.....:::::::--------------------:::::::::.......................::::---===++xxx**%%&&&###@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###&&&&%%%%%********xxxxxxxxxxx++++++++++++========------::::::.....······            
        ····.....:::::--------------------------::::::::....................::::---===++xx***%%&&&####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@###&&&&&%%%%%**********xxxxxxxxxxxxx+++++++++=======------:::::.....·····            
        ····....::::::-------=============---------:::::::::................:::::---===+++xx***%%%&&&#####@@@@@@@@@@@@@@@@@@@@@@@@@#####&&&&&%%%%%%*************xxxxxxxxxxxxxx+++++++++======-----:::::....·····            
         ····....:::::-------================---------:::::::::...............:::::----===++++xxx***%%%%&&&&&&#################&&&&&&%%%%%%%*******************xxxxxxxxxxxxxxxxx++++++++======----:::::....·····            
         ·····....:::::--------=================---------::::::::::..............:::::::-----====+++++xxxxxx**************************xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx++++++++=====-----::::....·····            
          ·····.....:::::--------=================----------:::::::::::.................:::::::::-------=============++++++++++++++++++++++++++++++++++++xxxxxxxxxxxxxxxxxxxxxxx++++++++======-----::::....·····            
            ·····.....:::::::----------===========-------------::::::::::::.........................::::::::::::::::::------------------=============+++++++++++++++++++++++++++++++++=======-----::::.....·····            
              ······......:::::::---------------------------------:::::::::::::........................................:::::::::::::::-----------============+++++++++++++++++++++========------:::::.....·····             
                 ······........:::::::::---------------------------:::::::::::::::::...........................................:::::::::::::------------=============================--------::::::.....······              
                    ·········.........:::::::::::::::-------------::::::::::::::::::::::::.......................................::::::::::::::::--------------------------------------::::::::......·······                
                          ··········............::::::::::::::::::::::::::::::::::::::::::::::::::................................::::::::::::::::::::::::::-------------:::::::::::::::.........········                   
                                  ············..................:::::::::::::::::::::::::::::::::::::::::::.........................:::::::::::::::::::::::::::::::::::::................···········                        
                                             ················.............................................................................................................·················                                 
                                                           ······················................................................................···························                                                
                                                                               ·········································································