> Intel // field guide_

How to Set Up a Valheim Dedicated Server on Windows & Linux

By Matthew Zhao||Updated
ValheimGuides

Exploring Valheim with friends is a lot more fun when the world is always available and nobody's PC has to stay on to host it. That's what a dedicated server gives you, and setting one up is straightforward.

This guide walks through launching a Valheim dedicated server on Windows or Linux, then covers configuration, crossplay, backups and troubleshooting. Iron Gate's guide to dedicated servers is the official reference. Check it if a step here doesn't match what you see, since details can change with game updates.

Why Run a Dedicated Valheim Server?

Always-on world: Your world stays available when you're offline. Friends can log in and keep playing.

No load on your gaming PC: The server runs separately, so hosting doesn't compete with the game on your machine.

Full control: Set world modifiers, passwords and admin permissions yourself.

Mods: Run the mods and configurations your group wants (PC only).

Valheim supports 1 to 10 players per server, so a dedicated server is mostly about availability and convenience rather than raising the player limit.

What You'll Need

  • A server machine (PC, VPS or dedicated hardware) running Windows or Linux
  • Steam or SteamCMD to download the Valheim Dedicated Server
  • Enough RAM and a decent CPU: Iron Gate doesn't publish official server specs. See our Valheim RAM guide for how to size and measure it.
  • Port access: Valheim uses the game port and the next port up, 2456 to 2457 by default. With crossplay turned on, port forwarding isn't needed.
  • Basic comfort with a terminal or text editor

Setting Up a Valheim Dedicated Server on Windows

Step 1: Download the Valheim Dedicated Server

With the Steam client

  1. Open your Steam Library
  2. Turn on the Tools filter
  3. Find Valheim Dedicated Server and install it

With SteamCMD

  1. Download SteamCMD from Valve's SteamCMD page and extract it to a folder such as C:\SteamCMD
  2. Run steamcmd.exe once to let it update. You'll see the Steam> prompt when it's ready.
  3. Run:
login anonymous
app_update 896660 validate
quit

896660 is the Valheim Dedicated Server's app ID. The files go to steamapps\common\Valheim dedicated server inside your SteamCMD folder.

Step 2: Configure Your Server Settings

Inside the server folder you'll find start_headless_server.bat. Make a copy of it and edit the copy, because Steam resets the original when the server updates.

Open your copy in a text editor. The line that starts with start valheim_server holds the launch arguments. It looks similar to this:

start valheim_server -nographics -batchmode -name "My server" -port 2456 -world "Dedicated" -password "secret" -crossplay

Edit the arguments to match your server:

  • -name: The server name shown in the server list
  • -port: The game port (default 2456). Valheim also uses the next port up, so the default range is 2456 to 2457.
  • -world: The world name. If a world with this name exists, it's loaded. If not, a new one is created.
  • -password: The password players need to join
  • -public: 1 lists the server in the browser (the default). 0 hides it, so players must use Join IP.

Other useful arguments from Iron Gate's guide:

  • -crossplay: Uses the crossplay backend so players on any platform can join. Without it, only Steam players can join. See the crossplay section below.
  • -saveinterval 1800: How often the world saves, in seconds. The default is 1800 (30 minutes).
  • -backups 4: How many automatic backups to keep. -backupshort and -backuplong set the intervals.
  • -savedir [PATH]: Stores worlds and server lists in a different folder.
  • -preset hard: Applies a world preset: Normal, Casual, Easy, Hard, Hardcore, Immersive or Hammer.
  • -modifier: Fine-tunes settings after a preset, such as -modifier combat hard or -modifier raids none. Options cover Combat, DeathPenalty, Resources, Raids and Portals.
  • -setkey: Turns on checkbox options such as nobuildcost, playerevents, passivemobs or nomap.

Step 3: Configure Windows Firewall and Port Forwarding

With -crossplay: The server connects through a relay, so you don't need to forward ports.

Without -crossplay (Steam only): Players outside your network need to reach your server on the game port range.

  1. Log into your router's admin panel (often 192.168.1.1 or 192.168.0.1)
  2. Find the port forwarding settings
  3. Forward UDP ports 2456 to 2457 to your server's local IP address (for example 192.168.1.100)
  4. When Windows Firewall asks whether to allow valheim_server, allow it

To add the firewall rule yourself (PowerShell as Administrator):

New-NetFirewallRule -DisplayName "Valheim Server" -Direction Inbound -Action Allow -Protocol UDP -LocalPort 2456-2457

If you changed -port, use your port and the one after it instead.

On a VPS or cloud server: Open the same UDP ports in your provider's firewall settings.

Step 4: Set Up Admins and Bans

The server reads three lists from its save folder (see World Files and Backups below):

  • adminlist.txt: Admins
  • bannedlist.txt: Banned players
  • permittedlist.txt: An allowlist. Adding anyone here blocks everyone who isn't on it.

Add one Platform User ID per line in the format [Platform]_[User ID], for example Steam_76561198000000000. The format is case sensitive. You can find a player's ID in the server log when they connect, or in the in-game F2 panel.

Admins can open the console with F5 and use kick, ban, unban and banned.

Step 5: Launch Your Server

Run your copy of the .bat file, or start the server through Steam (Steam always launches the original filename). The server is ready when the console shows "Game server connected".

To stop the server, press CTRL+C in its window. Iron Gate warns that closing the window with the X can leave the server running in the background.

Step 6: Connect and Test

Launch Valheim, choose your character, go to Join Game and either:

  • Find your server in the list (if -public 1), or
  • Use Join IP and enter your server's public IP and port, or
  • With crossplay on, enter the server's join code

Then enter the password.

If you can't connect, check:

  • The ports are forwarded (if crossplay is off)
  • The firewall allows the server
  • The password matches exactly
  • The server console shows "Game server connected" with no errors

Setting Up a Valheim Dedicated Server on Linux

Step 1: Install SteamCMD and Dependencies

On Debian or Ubuntu:

sudo apt-get update
sudo apt-get install steamcmd libatomic1 libpulse-dev libpulse0

Iron Gate lists libatomic1, libpulse-dev and libpulse0 as dependencies. If your distro doesn't package SteamCMD, install it manually:

mkdir -p ~/steamcmd
cd ~/steamcmd
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xvzf steamcmd_linux.tar.gz

The server needs GLIBC 2.29 and GLIBCXX 3.4.26 or newer. On older systems, Iron Gate recommends the Docker option (below).

Step 2: Download the Valheim Dedicated Server

steamcmd +login anonymous +app_update 896660 validate +quit

(Use ./steamcmd.sh instead of steamcmd for a manual install.) The files go to ~/Steam/steamapps/common/Valheim dedicated server/ or the equivalent folder in your SteamCMD directory.

Step 3: Edit the Startup Script

The server folder includes start_server.sh. Copy it (for example to start_myserver.sh) so updates don't overwrite your changes, and make it executable:

cp start_server.sh start_myserver.sh
chmod +x start_myserver.sh

Open your copy and edit the line that runs ./valheim_server.x86_64. Change the arguments as you would on Windows:

./valheim_server.x86_64 -name "My server" -port 2456 -world "Dedicated" -password "secret" -crossplay

Leave the rest of the script (the library path and environment lines) as it is.

Step 4: Configure the Linux Firewall

If you're not using -crossplay and you run UFW:

sudo ufw allow 2456:2457/udp
sudo ufw enable

Make sure SSH is allowed before enabling UFW on a remote server. On a VPS, also open the ports in your provider's firewall.

Step 5: Set Up Admins and Bans

Same as Windows. The lists live in the save folder, which on Linux is ~/.config/unity3d/IronGate/Valheim by default.

Step 6: Run the Server

./start_myserver.sh

Wait for "Game server connected", then test connecting from the game.

Step 7: Auto-Start with systemd (Optional)

To run the server in the background and start it at boot, create a service:

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

Paste this, adjusting the user and paths:

[Unit]
Description=Valheim Dedicated Server
After=network.target

[Service]
Type=simple
User=valheim
WorkingDirectory=/home/valheim/Steam/steamapps/common/Valheim dedicated server
ExecStart=/home/valheim/Steam/steamapps/common/Valheim dedicated server/start_myserver.sh
KillSignal=SIGINT
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

KillSignal=SIGINT matches pressing CTRL+C, which gives the server a chance to save on shutdown.

Enable and start it:

sudo systemctl daemon-reload
sudo systemctl enable valheim-server
sudo systemctl start valheim-server

Check status and logs:

sudo systemctl status valheim-server
sudo journalctl -u valheim-server -f

Docker Option

Iron Gate also ships a Docker path. Run ./docker_start_server.sh start_server.sh (or your copy of the script) from the server folder. The first run builds the container and takes a few minutes. Your user must be in the docker group. Data is stored in the valheim_server_data volume unless you set DOCKER_DATA_VOLUME to a host folder.

Crossplay

Add -crossplay to let players on Xbox, PlayStation 5, Nintendo Switch 2 and the Microsoft Store version join alongside Steam players. With crossplay on, the server uses a relay, so you don't need to forward ports. Players can join by public IP and port, by join code, or through the server list.

For more detail, see our Valheim crossplay server guide.

World Files and Backups

By default, the server keeps its worlds and admin lists in:

  • Windows: %USERPROFILE%\AppData\LocalLow\IronGate\Valheim
  • Linux: ~/.config/unity3d/IronGate/Valheim

You can change this with -savedir.

Valheim 1.0 changed how worlds are saved. A world is now stored as a folder of chunk files rather than the older pair of .db and .fwl files. Older guides that tell you to copy two files are out of date. When you back up or move a world, copy the whole world folder and keep it intact, and check Iron Gate's dedicated server guide for current details.

The server also makes automatic backups based on -backups. Copy backups somewhere other than the server for extra safety.

To back up everything manually on Linux, stop the server and archive the whole save folder:

tar -czf valheim-backup-$(date +%Y%m%d).tar.gz ~/.config/unity3d/IronGate/Valheim

Valheim Server Performance

Iron Gate doesn't publish RAM or CPU requirements for the dedicated server. Memory use grows with the number of players online, how much of the world they've built and explored, and any mods. Watch actual usage during busy sessions and add resources when the server gets close to its limit. Our Valheim RAM guide covers how to measure it.

Common Issues and Troubleshooting

"Connection Failed" Error

  • Without crossplay, check that ports 2456 to 2457 (or your custom range) are forwarded and allowed
  • With crossplay, try the join code instead of the IP
  • Don't use a local or loopback IP with crossplay. Iron Gate notes these don't work with the crossplay backend.
  • Check that the password is correct

Server Crashes Frequently

  • Check available RAM and CPU while the server runs
  • Read the server log for errors
  • Remove recently added mods to test
  • Update the server to match the game version

Players Can't Find the Server in the Browser

  • Make sure -public isn't set to 0
  • Give it a few minutes after startup
  • Use Join IP or the join code instead

Lag or Rubber-Banding

  • Check the server's CPU and memory usage
  • Check your upload speed and other traffic on the connection
  • Remember that one player's slow connection or machine can cause lag for others nearby

Server Management Tips

Keep the server updated: Players can't join a server on a different game version. Update the server when Valheim updates.

Make regular backups: Keep copies of your whole save folder off the server.

Monitor resources: Use Task Manager (Windows) or htop (Linux) during peak play.

Set clear rules: Tell players your rules on griefing and how admin decisions are made.

FAQ: Valheim Dedicated Server Setup

How do I set up a Valheim dedicated server?

Download the Valheim Dedicated Server (app ID 896660) through Steam or SteamCMD, copy and edit the start script with your server name, world and password, open ports or use -crossplay, and run it.

What ports does Valheim use?

The game port and the next one up: 2456 to 2457 by default. If you change -port, the range moves with it. With crossplay on, you don't need to forward them.

How do I run a Valheim server on Linux?

Install the dependencies, download the server with SteamCMD, copy and edit start_server.sh, and run it. A systemd service keeps it running in the background.

How do I make my server start automatically?

On Linux, use a systemd service (see Step 7 above). On Windows, create a Task Scheduler task that runs your copy of start_headless_server.bat at startup.

Can I run a Valheim server on my PC and still play?

Yes. Running both on one machine uses more resources, so close other apps and watch performance. A separate machine is more reliable.

How many players can a Valheim dedicated server support?

Valheim supports 1 to 10 players per server.

How do I back up my Valheim world?

The server makes automatic backups based on -backups. For a manual backup, stop the server and copy the whole save folder. Since 1.0, each world is a folder, so copy folders rather than individual files.

Can I run mods on a dedicated server?

Mods like BepInEx-based ones can run on PC servers, but Iron Gate doesn't officially support mods, and there's no mod support on consoles. Most mods need matching versions on each player's PC. If you want crossplay with console players, keep the server vanilla or check each mod carefully.

Final Thoughts

Setting up a Valheim dedicated server comes down to a few steps: download the server, set your name, world and password in a copy of the start script, decide between crossplay and port forwarding, and back up your save folder regularly. If you hit problems, Iron Gate's guide and the Valheim community are good places to look.

If you're thinking about renting instead, our guide to Valheim server hosting covers what to compare.

Valheim Hosting on EZ Game Host

EZ Game Host offers Valheim server hosting with crossplay support, 3 backup slots, world file uploads, scheduled restarts and 24/7 support. Plans start at $12 a month, and monthly plans can be cancelled any time.

We use cookies for analytics, ad measurement and session recordings. Accept to allow them, or Decline to opt out of analytics and the sale or sharing of your personal information. Privacy Policy