Valheim
| Platform | Support | Notes |
|---|---|---|
| Linux | ✅ Native | Recommended |
| Windows | ✅ Native |
Valheim is a Viking survival game that supports dedicated servers for up to 10 players. The server is lightweight: 4 GB of RAM and 2 CPU cores are enough for a smooth session.
Requirements
| Component | Minimum | Recommended |
|---|---|---|
| RAM | 4 GB | 6 GB |
| CPU | 2 core | 4 core |
| Disk | 5 GB | 10 GB SSD |
| OS | Ubuntu 22.04 | Ubuntu 22.04 |
| Ports | 2456-2457 UDP | : |
Preparation
# Install dependencies
dpkg --add-architecture i386
apt update
apt install -y lib32gcc-s1 curl wget screen
# Create dedicated user
useradd -m -s /bin/bash valheim
su - valheim
# Install SteamCMD
mkdir ~/steamcmd && cd ~/steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -
Server Installation
# Create server directory
mkdir ~/valheim_server
# Download server (AppID 896660)
~/steamcmd/steamcmd.sh \
+force_install_dir ~/valheim_server \
+login anonymous \
+app_update 896660 validate \
+quit
Startup Script
nano ~/start_valheim.sh
#!/bin/bash
export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=~/valheim_server/linux64:$LD_LIBRARY_PATH
export SteamAppId=892970
cd ~/valheim_server
./valheim_server.x86_64 \
-name "My Valheim Server" \
-port 2456 \
-world "MyWorld" \
-password "server_password" \
-public 1 \
-crossplay \
-savedir ~/.config/unity3d/IronGate/Valheim \
2>&1 | tee ~/valheim_server/logs/server.log
export LD_LIBRARY_PATH=$templdpath
chmod +x ~/start_valheim.sh
mkdir ~/valheim_server/logs
Valheim requires a password of at least 5 characters. Without a password the server won't start.
systemd Service
Return to root:
exit
nano /etc/systemd/system/valheim.service
[Unit]
Description=Valheim Dedicated Server
After=network.target
[Service]
User=valheim
Group=valheim
ExecStart=/home/valheim/start_valheim.sh
Restart=on-failure
RestartSec=30
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable --now valheim
systemctl status valheim
Firewall
ufw allow 2456:2457/udp
Cross-play (PC + Xbox/Game Pass)
The -crossplay flag in the startup script enables compatibility with Xbox and Game Pass players. The server will appear in both the Steam and Xbox server list.
PlayStation cross-play is not supported by the dedicated server side: only official servers managed by IronGate support it.
Managing Saves
Worlds are saved in:
~/.config/unity3d/IronGate/Valheim/worlds_local/
# Backup world
tar -czf ~/valheim-backup-$(date +%Y%m%d).tar.gz \
~/.config/unity3d/IronGate/Valheim/worlds_local/
# Automatic backup every 6 hours
echo "0 */6 * * * valheim tar -czf ~/backups/valheim-\$(date +\%Y\%m\%d_\%H\%M).tar.gz ~/.config/unity3d/IronGate/Valheim/worlds_local/ 2>/dev/null" >> /etc/cron.d/valheim
Update
systemctl stop valheim
su - valheim -c "~/steamcmd/steamcmd.sh +force_install_dir ~/valheim_server +login anonymous +app_update 896660 +quit"
systemctl start valheim
Logs and Diagnostics
# Live logs
journalctl -u valheim -f
# Search for errors
journalctl -u valheim | grep -i "error\|failed\|warning"
# Verify server is reachable (from outside)
# Use https://valheim.shockbyte.com/check and enter IP:2456
Tips & Tweaks
Startup Script Flags
Customize your server with these flags:
#!/bin/bash
export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=~/valheim_server/linux64:$LD_LIBRARY_PATH
export SteamAppId=892970
cd ~/valheim_server
./valheim_server.x86_64 \
-name "My Valheim Server" \
-port 2456 \
-world "MyWorld" \
-password "secure_password_min_5chars" \
-public 1 \
-crossplay \
-savedir ~/.config/unity3d/IronGate/Valheim \
2>&1 | tee ~/valheim_server/logs/server.log
export LD_LIBRARY_PATH=$templdpath
Important flags:
World Backup Strategy
Manual backup:
# Backup world and character data
tar -czf ~/valheim-backup-$(date +%Y%m%d_%H%M).tar.gz \
~/.config/unity3d/IronGate/Valheim/worlds_local/ \
~/.config/unity3d/IronGate/Valheim/characters_local/
Automated backup every 6 hours:
# Add to crontab: crontab -e
0 */6 * * * su - valheim -c "tar -czf ~/backups/valheim-\$(date +\%Y\%m\%d_\%H\%M).tar.gz ~/.config/unity3d/IronGate/Valheim/worlds_local/ 2>/dev/null"
Restore world:
systemctl stop valheim
tar -xzf ~/valheim-backup-20240101_1200.tar.gz -C ~/.config/unity3d/IronGate/Valheim/
systemctl start valheim
BepInEx Mods Installation
BepInEx allows plugins and mods on Valheim servers:
# As valheim user
cd ~/valheim_server
# Download latest BepInEx
wget https://github.com/BepInEx/BepInEx/releases/download/v5.4.22/BepInEx_linux.zip
unzip BepInEx_linux.zip
rm BepInEx_linux.zip
# Install example mod (ServerSync for mod sync)
# Create plugins folder
mkdir -p BepInEx/plugins
# Download mods into BepInEx/plugins/
# Then restart server
systemctl restart valheim
Popular server mods:
Admin Commands
Valheim admin commands (via chat when connected):
# Teleport self to player
/goto PlayerName
# Teleport player to you
/summon PlayerName
# List player locations
/pos
# Start raid (random creatures attack)
/raid
# God mode (admin only)
/god
# Ghost mode (invisible, pass through walls)
/ghost
# Kill all enemies
/killall
# Spawn item
/give ItemName Count
# Set time of day
/time <0-1> # 0=day, 1=night
# Reset portal entrance
/resetworldportals
Cross-play Configuration
Enable cross-play between Steam and Xbox:
In startup script:
-crossplay
Important notes:
Performance Tuning
Valheim is lightweight, but optimize for more players:
# In startup script, reduce load by limiting entities:
# (Valheim doesn't support these flags, but you can:)
# 1. Limit world size (use smaller world for smaller servers)
# 2. Manage active mods (some are CPU-heavy)
# 3. Monitor with: top, ps aux | grep valheim_server
Monitoring Commands
# Server status
systemctl status valheim
# Real-time logs
journalctl -u valheim -f
# Active connections
ss -tulnp | grep 2456
# Memory usage
ps aux | grep valheim_server | grep -v grep
# World file size (can grow large)
du -h ~/.config/unity3d/IronGate/Valheim/worlds_local/
Troubleshooting Connection Issues
Server not appearing in browser:
# Check if -public 1 is set in startup script
# Verify ports are open
sudo ufw allow 2456:2457/udp
# Restart server
systemctl restart valheim
Clients can't connect:
# Verify firewall
ss -tulnp | grep 2456
# Check server is running
systemctl status valheim
# Inspect logs
journalctl -u valheim -n 20
Lag/slow world:
# Check server memory
free -h
# Monitor active connections
watch -n 2 "ss -tulnp | grep 2456 | wc -l"
# Reduce active mods or restart to clear memory
systemctl restart valheim
Wipe Procedures
Reset world for new season:
# 1. Backup current world
tar -czf ~/valheim-wipe-$(date +%Y%m%d).tar.gz \
~/.config/unity3d/IronGate/Valheim/worlds_local/
# 2. Stop server
systemctl stop valheim
# 3. Delete world files
rm ~/.config/unity3d/IronGate/Valheim/worlds_local/MyWorld*
# 4. Restart (creates fresh world)
systemctl start valheim
Network Optimization
For servers with latency issues:
# Check network from server
ping -c 3 $(echo $SSH_CLIENT | awk '{print $1}')
# Monitor bandwidth
iftop -i eth0
# If behind NAT/firewall, consider port forwarding
sudo ufw allow 2456:2457/udp
- -crossplay: Enable Xbox Game Pass support
- -public 1: List on server browser (0 to hide)
- -password: Minimum 5 characters
- ServerSync: Auto-sync mods to clients
- ConfigurationManager: Web config editor
- Nexus Mods: Browse at nexusmods.com/valheim
- Server appears on both Steam and Xbox Game Pass server lists
- Mixed accounts play together seamlessly
- PlayStation not supported on dedicated servers (console only)
Articoli correlati
CS2
How to install and configure a Counter-Strike 2 dedicated server on Linux VPS with SteamCMD
Palworld
Create a dedicated Palworld server on Linux with SteamCMD. Configuration, ports and automatic startup.
Rust
Install and manage a Rust server (Facepunch) on Linux with SteamCMD. Includes automatic updates, Oxide plugins and optimizations.
