How to Set Up a Valheim Dedicated Server
A dedicated Valheim server lets your Viking adventures continue 24/7. This comprehensive guide covers everything from system requirements to hosting alternatives.
Why a Dedicated Server?
Valheim's world is persistent, but hosting on your PC means:
- >Server goes offline when you quit
- >Performance issues for the host
- >Friends can't play when you're away
---
System Requirements
Before setting up, ensure your hardware meets these minimum specs:
Minimum Requirements
| Component | Specification |
|---|---|
| CPU | Dual-core 2.4 GHz |
| RAM | 4GB |
| Storage | 10GB SSD |
| Network | 5 Mbps upload |
| OS | Windows 10/11 or Linux |
Recommended Requirements
| Component | Specification |
|---|---|
| CPU | Quad-core 3.0 GHz |
| RAM | 8GB |
| Storage | 20GB SSD |
| Network | 20 Mbps upload |
| OS | Windows 10/11 or Linux |
Player Scaling Guide
| Players | CPU | RAM | Bandwidth |
|---|---|---|---|
| 2-4 | 2 cores | 4GB | 5 Mbps |
| 5-7 | 4 cores | 8GB | 10 Mbps |
| 8-10 | 4+ cores | 16GB | 20 Mbps |
Installation Methods
Method 1: Steam Tools (Easiest)
The official Valheim dedicated server tool makes setup simple.
#### Windows Installation
- >Open Steam
- >Go to Library → Tools
- >Find "Valheim Dedicated Server"
- >Right-click → Install
C:\Program Files (x86)\Steam\steamapps\common\Valheim dedicated server
- >Open
start_headless_server.batwith a text editor - >Edit the following line:
valheim_server -nographics -batchmode -name "Your Server Name" -port 2456 -world "YourWorldName" -password "YourPassword" -public 1
- >Change:
- >
"Your Server Name"- Display name in server list - >
"YourWorldName"- World save name (no spaces) - >
"YourPassword"- Required password (min 5 characters) - >
-public 1- Set to 0 for private server
- >Run
start_headless_server.bat - >Wait for "Game server connected" in console
# Ubuntu/Debian
sudo apt update
sudo apt install steamcmd
steamcmd +login anonymous +app_update 896660 validate +exit
#!/bin/bash
export SteamAppId=892970
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
./valheim_server.x86_64 -name "Your Server Name" -port 2456 -world "YourWorldName" -password "YourPassword" -public 1
chmod +x start_server.sh
./start_server.sh
Method 2: Docker (Advanced)
Docker provides isolated, easy-to-manage server deployment.
# docker-compose.yml
version: '3.8'
services:
valheim:
image: lloesche/valheim-server
container_name: valheim
environment:
- SERVER_NAME=Your Server Name
- WORLD_NAME=YourWorldName
- SERVER_PASS=YourPassword
- SERVER_PORT=2456
- PUBLIC=1
volumes:
- ./config:/config
- ./data:/opt/valheim
ports:
- "2456-2458:2456-2458/udp"
restart: unless-stopped
Run with:
docker-compose up -d
---
Port Forwarding
For external players to connect, you must forward ports on your router.
Ports to Forward
| Port | Protocol | Purpose |
|---|---|---|
| 2456 | UDP | Game traffic |
| 2457 | UDP | Steam query |
| 2458 | UDP | Steam master |
Port Forwarding Steps
- >Windows: Open CMD, type
ipconfig - >Linux: Type
ip addr - >Note your IPv4 address (usually 192.168.x.x)
- >Open browser to router IP (usually 192.168.1.1 or 192.168.0.1)
- >Login with admin credentials
- >Find "Port Forwarding" or "NAT" section
- >Create new rules for ports 2456-2458
- >Set protocol to UDP
- >Point to your local IP address
netsh advfirewall firewall add rule name="Valheim Server" dir=in action=allow protocol=UDP localport=2456-2458
sudo ufw allow 2456:2458/udp
- >Visit whatismyip.com
- >Share this IP with friends
Connect to Your Server
Players can connect using:
- >In-game: Server list (if public)
- >Direct connect:
your-public-ip:2456 - >Steam: View → Servers → Add server
Configuration
Server Settings File
Create or edit adminlist.txt, bannedlist.txt, and permittedlist.txt in the server directory.
Admin Commands
Connect to your server and press F5 to open console:
| Command | Description |
|---|---|
help | Show available commands |
kick [name/ip/userID] | Remove player |
ban [name/ip/userID] | Ban player |
unban [name/ip/userID] | Remove ban |
banned | List banned players |
save | Force world save |
resetmap | Reset exploration map |
Performance Optimization
Edit launch parameters for better performance:
valheim_server -nographics -batchmode -name "Server" -port 2456 -world "World" -password "pass" -public 1 -crossplay
Key flags:
- >
-crossplay- Enable cross-platform play - >
-preset Hardcore- Set gameplay preset
World Backup
Valheim saves are stored in:
- >Windows:
%USERPROFILE%\AppData\LocalLow\IronGate\Valheim\worlds - >Linux:
~/.config/unity3d/IronGate/Valheim/worlds
---
Hosting Provider Alternatives
Don't want to host yourself? Consider these providers:
Top Valheim Hosting Providers
| Provider | Starting Price | Features |
|---|---|---|
| GPortal | $6.50/mo | Instant setup, DDoS protection |
| HostHavoc | $8.00/mo | Mod support, 24/7 support |
| Survival Servers | $8.50/mo | Full FTP access, custom mods |
| PingPerfect | $9.00/mo | Low latency, control panel |
| GTXGaming | $6.00/mo | Budget option, basic features |
Benefits of Paid Hosting
- >No need to keep your PC running
- >Professional DDoS protection
- >Easy control panel
- >Automatic backups
- >Technical support
- >Guaranteed uptime
Troubleshooting
Server Not Appearing in List
-public 1 is setPlayers Can't Connect
High Lag/Poor Performance
Server Crashes
---
Quick Reference
Default Ports
- >Game: 2456 UDP
- >Query: 2457 UDP
- >Master: 2458 UDP
File Locations
- >Config:
[server]/valheim_server_Data/ - >Worlds:
[server]/worlds/or user AppData - >Logs:
[server]/output_log.txt
Useful Links
---Conclusion
Setting up a Valheim dedicated server requires some technical knowledge, but the benefits of 24/7 uptime and better performance make it worthwhile. Choose self-hosting for control and cost savings, or a hosting provider for convenience and support.
Your Viking adventures await—good luck building your server!