Articles
Explore some articles written by our team & fellow gamers!
Explore some articles written by our team & fellow gamers!
We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking “Accept”, you consent to our use of cookies. Read our Privacy Policy to learn more.
There's something magical about exploring the Norse-inspired world of Valheim with your friends, but nothing kills the vibe faster than lag, disconnections, or someone griefing your homestead. That's where a dedicated server comes in—and the good news is, setting one up is way easier than you might think.
In this guide, we'll walk you through everything you need to know to launch your own Valheim dedicated server, whether you're running Windows or Linux. We'll cover the technical setup, configuration, and management, plus some pro tips to keep things running smoothly.
Before we dive into the how-to, let's talk about why dedicated servers are worth your time:
Always-On Gameplay – Your world persists even when you're offline. Friends can log in, gather resources, and progress while you're sleeping.
Performance – No more hosting from your gaming PC. A dedicated server runs on its own hardware, meaning zero impact on your main machine's performance.
Full Control – Set your own difficulty, spawn rates, world size, and admin permissions. No compromises, no negotiations with whoever's hosting from their laptop.
Scalability – Support more players without the strain of hosting on consumer-grade hardware.
Mods Support – Run custom mods and configurations tailored to your group's playstyle.
If manual setup feels like a headache, remember that EZ Game Host offers managed Valheim server hosting that handles all the technical complexity for you—but we get it if you want to learn the ropes yourself.
Before setting up, make sure you have:
SteamCMD is Steam's command-line interface that lets you download server files without launching Steam itself.
C:\SteamCMDsteamcmd.exe to initialize it (this might take a minute)You'll know it worked when you see the Steam> command prompt.
With SteamCMD open, run these commands:
login anonymous
app_update 896660 validate
quit
The app ID 896660 is the Valheim Dedicated Server app. SteamCMD will download the server files to your SteamCMD directory. The validate flag ensures all files are complete and correct.
Once complete, navigate to your SteamCMD folder and look for a steamapps\common\Valheim dedicated server directory—that's where the magic happens.
Inside the Valheim dedicated server folder, you'll find a file called start_headless_server.bat. This is the Windows batch script that launches your server. Open it in a text editor (Notepad works) and you'll see something like:
@echo off
setlocal enabledelayedexpansion
REM Script for launching the headless server
set SteamCMD=D:\SteamCMD\steamapps\common\Valheim dedicated server
REM Tip: Make sure the login name and password matches an account with CSGO or CS2 purchased
set port=2456
set world=Dedicated
set password=secret
set public=1
REM Between each argument in the start command there needs to be a space
"%SteamCMD%\valheim_server.exe" -nographics -batchmode -logFile - -port %port% -world %world% -password %password% -public %public%
Edit the variables to match your server setup:
1 if you want your server listed in the server browser, or 0 to keep it private.Additional parameters you might find useful:
-maxplayers N – Set max players (default 10, max 10 without mods)-saveinterval N – Save world every N seconds (default 600)-backups N – Number of world backups to keep (default 4)-difficulty 0-1 – Difficulty level (0 = normal, 1 = hardcore)-crossplay 0-1 – Enable crossplay between Windows and Linux clients (1 = enabled)For players outside your local network to connect, they need access to your server on UDP ports 2456-2458.
If hosting on a VPS or cloud provider: Contact your provider to ensure these UDP ports are open. Most have firewall rules you can configure in their admin panel.
If hosting locally behind a router:
Windows Firewall rule (via PowerShell as Admin):
New-NetFirewallRule -DisplayName "Valheim Server" -Direction Inbound -Action Allow -Protocol UDP -LocalPort 2456-2458
In the Valheim dedicated server folder, create two text files:
adminlist.txt – One SteamID per line (64-bit Steam ID)
76561198000000000
76561198000000001
bannedlist.txt – Same format, one SteamID per line
76561198000000002
Admins can use in-game commands like /kick and /ban. To find your SteamID, visit steamcommunity.com, view your profile, and check the Community ID in the page source.
Navigate to your Valheim dedicated server folder and run start_headless_server.bat. You should see console output confirming the server is running and listening on port 2456.
Keep this command window open—closing it shuts down the server.
Launch Valheim on your client machine and go to Start Game > Join Game > Connect to IP. Enter your server's IP address (or domain name if you have one) and the password you set. You should connect within a few seconds.
If you can't connect, double-check:
Linux hosting offers better stability and lower resource usage. Here's how to set it up:
First, update your package manager and install dependencies:
sudo apt-get update
sudo apt-get install steamcmd
If your distro doesn't have steamcmd in repos, 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
./steamcmd.sh +login anonymous +app_update 896660 validate +quit
The server files will be downloaded to ~/Steam/steamapps/common/Valheim dedicated server/.
Navigate to your Valheim server directory and create a bash script called start_server.sh:
#!/bin/bash
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
./valheim_server.x86_64 \
-nographics \
-batchmode \
-logFile - \
-port 2456 \
-world Dedicated \
-password your_secure_password \
-public 1
Make it executable:
chmod +x start_server.sh
Customize the parameters as needed (same options as Windows).
If you're running UFW (Uncomplicated Firewall):
sudo ufw allow 2456:2458/udp
sudo ufw enable
For VPS hosting, configure your provider's firewall rules to allow UDP on ports 2456-2458.
Same as Windows—create adminlist.txt and bannedlist.txt in your server directory with SteamIDs.
Test the server first:
./start_server.sh
You should see server initialization messages and confirmation that it's listening on port 2456.
Instead of manually running the server, use systemd to manage it automatically.
Create a systemd service file:
sudo nano /etc/systemd/system/valheim-server.service
Paste this content (adjust paths and user as needed):
[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_server.sh
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable valheim-server
sudo systemctl start valheim-server
Check status anytime with:
sudo systemctl status valheim-server
View logs with:
sudo journalctl -u valheim-server -f
The server will now auto-start on boot and restart if it crashes.
Your Valheim world data is stored in:
Windows: C:\Users\[YourUsername]\AppData\LocalLow\IronGate\Valheim\worlds
Linux: ~/.config/unity3d/IronGate/Valheim/worlds
The server creates world backup files automatically based on your -backups setting. Store these backups offsite for extra safety.
To backup manually, zip the world folder:
tar -czf valheim-world-backup-$(date +%Y%m%d).tar.gz ~/.config/unity3d/IronGate/Valheim/worlds
Running a smooth Valheim server depends on hardware. Check out our Valheim RAM Guide for detailed optimization tips, but here's the quick version:
CPU matters less than RAM, but a modern processor (2GHz+) is recommended.
If you need higher performance without the setup hassle, check out our Valheim server hosting options.
"Connection Failed" error
Server crashes frequently
Players can't find server in browser
-public 1 is set in your launch scriptHigh latency or lag
Keep Your Server Updated – Valheim receives regular updates. Restart your server after game patches to ensure compatibility.
Regular Backups – Backup your world files weekly. Corruption happens; backups save you.
Monitor Resources – Use tools like Task Manager (Windows) or htop (Linux) to watch CPU and RAM usage during peak playtime.
Set Clear Rules – Communicate rules about griefing, admin decisions, and expected behavior to your players.
Use Discord Integration – Many server management tools integrate with Discord for notifications and remote control.
Setting up a dedicated server teaches you a lot, but it also requires ongoing maintenance, backups, updates, and troubleshooting. If you'd rather focus on playing and less on server management, EZ Game Host's Valheim server hosting handles all of this for you:
It's the difference between building a car from scratch and just driving it.
How do I set up a Valheim dedicated server? Download SteamCMD, use it to grab the Valheim Dedicated Server app (ID 896660), configure your launch script with server settings, open ports 2456-2458, and run the server executable. We've covered both Windows and Linux setups above in detail.
What ports does Valheim use? Valheim uses UDP ports 2456, 2457, and 2458. All three must be open and forwarded for players to connect.
How do I run Valheim server on Linux?
Follow the same steps as Windows but using the Linux version of SteamCMD and the valheim_server.x86_64 executable. We recommend setting up a systemd service for auto-start.
How do I make my server start automatically?
On Linux, use systemd (see Step 7 above). On Windows, create a scheduled task in Task Scheduler to run your start_headless_server.bat at startup.
Can I run a Valheim server on my PC and still play normally? Yes, but expect performance hits. A dedicated server machine is better. If you must use your gaming PC, close unnecessary apps and monitor resource usage.
How many players can a Valheim dedicated server support? Valheim's default max is 10 players. Without modding, you're capped at 10, but with proper hardware and mods, some communities run larger servers.
Is there a server browser for Valheim?
Yes, if you set -public 1, your server appears in the in-game server list after a few minutes. For private servers, players connect directly via IP address.
How do I backup my Valheim world?
The server auto-backs up based on your -backups setting. For manual backups, copy your world folder or use tar on Linux to create a compressed archive.
Can I run mods on a dedicated server? Yes. Popular mod managers like BepInEx work on servers. Ensure all players have matching mods installed.
Why would I choose EZ Game Host over self-hosting? Self-hosting is educational but requires upkeep, backups, security patches, and troubleshooting. Managed hosting handles all that and costs around $10-15/month for reliable, always-on gameplay.
Setting up your own Valheim dedicated server is a rewarding project that gives you full control over your Norse adventure. Whether you're hosting on Windows, Linux, or leveraging a managed hosting provider, the core principle stays the same: create a space where you and your friends can build, explore, and conquer together without lag or interruptions.
We've covered the technical setup, troubleshooting, and everything in between. If you hit any snags, the Valheim community forums and Discord servers are full of helpful players. And if you decide to go the managed route, EZ Game Host is here to support your Valheim journey.
Happy building, Viking.