Game Server Guide

    Valheim Dedicated Server

    Host your own Viking survival world on RamNode VPS. Full control over your game world, mods, and player experience.

    Ubuntu 22.04 / Debian 12
    Multiplayer
    ⏱️ 20-30 minutes

    Prerequisites & VPS Selection

    Valheim is a popular survival and exploration game that supports dedicated server hosting for multiplayer gameplay. Running your own server gives you complete control over the game world.

    Before starting, ensure you have:

    • Ubuntu 22.04 LTS or Debian 12
    • Root or sudo access
    • Basic familiarity with Linux command line
    • Your server name and password decided

    Minimum

    • • 4GB RAM
    • • 2 CPU cores
    • • 10GB SSD

    Recommended

    • • 6GB+ RAM
    • • 2+ CPU cores
    • • Large worlds

    Premium

    • • 8GB+ RAM
    • • 4+ CPU cores
    • • Heavy mods
    2

    Initial Server Setup

    Connect to your VPS via SSH and update the system:

    Update System
    sudo apt update && sudo apt upgrade -y
    Install Dependencies
    sudo apt install -y curl wget tar lib32gcc-s1 software-properties-common

    Create Dedicated User

    Never run game servers as root:

    Create Valheim User
    sudo useradd -m -s /bin/bash valheim
    sudo passwd valheim  # Set a password
    3

    Install SteamCMD

    SteamCMD is required to download and update the Valheim dedicated server files.

    Install SteamCMD
    sudo add-apt-repository multiverse
    sudo dpkg --add-architecture i386
    sudo apt update
    sudo apt install -y steamcmd
    4

    Install Valheim Server

    Switch to Valheim User
    sudo su - valheim
    Create Directory Structure
    mkdir -p ~/valheim-server ~/valheim-data
    cd ~/valheim-server
    Download Valheim Server
    steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir ~/valheim-server +login anonymous +app_update 896660 validate +quit

    💡 Note: The Valheim dedicated server App ID is 896660. Download takes several minutes depending on your connection speed.

    5

    Configure the Server

    Create a startup script with your server configuration:

    Create Startup Script
    nano ~/start_valheim.sh
    start_valheim.sh
    #!/bin/bash
    export templdpath=$LD_LIBRARY_PATH
    export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
    export SteamAppId=892970
    
    # Server Configuration
    SERVER_NAME="RamNode Valheim Server"
    WORLD_NAME="Dedicated"
    SERVER_PASSWORD="YourSecurePassword123"
    SERVER_PORT=2456
    
    # Start the server
    ./valheim_server.x86_64 \
      -name "$SERVER_NAME" \
      -port $SERVER_PORT \
      -world "$WORLD_NAME" \
      -password "$SERVER_PASSWORD" \
      -public 1 \
      -savedir ~/valheim-data
    
    export LD_LIBRARY_PATH=$templdpath

    Configuration Parameters

    -name: Server name in browser
    -port: Main port (uses 2456-2458)
    -world: World save file name
    -password: Min 5 characters
    -public: 1=public, 0=private
    -savedir: World saves location
    Make Executable
    chmod +x ~/start_valheim.sh
    6

    Configure Firewall

    Exit the valheim user and configure firewall rules:

    Configure UFW
    exit  # Return to root
    
    sudo ufw allow 2456:2458/udp
    sudo ufw allow 22/tcp  # Ensure SSH remains accessible
    sudo ufw enable
    sudo ufw status

    Port Requirements

    • 2456/UDP: Main game port
    • 2457/UDP: Query port
    • 2458/UDP: Steam server list port
    7

    Systemd Service

    Create Service File
    sudo nano /etc/systemd/system/valheim.service
    valheim.service
    [Unit]
    Description=Valheim Dedicated Server
    After=network.target
    
    [Service]
    Type=simple
    User=valheim
    WorkingDirectory=/home/valheim/valheim-server
    ExecStart=/home/valheim/start_valheim.sh
    Restart=on-failure
    RestartSec=10
    StandardOutput=journal
    StandardError=journal
    
    [Install]
    WantedBy=multi-user.target
    Enable and Start
    sudo systemctl daemon-reload
    sudo systemctl enable valheim
    sudo systemctl start valheim
    Check Status
    sudo systemctl status valheim
    
    # View logs
    sudo journalctl -u valheim -f
    8

    Server Management

    Management Commands
    # Start server
    sudo systemctl start valheim
    
    # Stop server
    sudo systemctl stop valheim
    
    # Restart server
    sudo systemctl restart valheim
    
    # View status
    sudo systemctl status valheim

    Update Server

    Update Valheim
    sudo systemctl stop valheim
    sudo su - valheim
    steamcmd +@sSteamCmdForcePlatformType linux +force_install_dir ~/valheim-server +login anonymous +app_update 896660 validate +quit
    exit
    sudo systemctl start valheim
    9

    Backup Strategy

    Create Backup Script
    sudo su - valheim
    mkdir -p ~/backups
    nano ~/backup_valheim.sh
    backup_valheim.sh
    #!/bin/bash
    BACKUP_DIR=~/backups
    DATE=$(date +%Y%m%d_%H%M%S)
    
    tar -czf $BACKUP_DIR/valheim_backup_$DATE.tar.gz ~/valheim-data/
    
    # Keep only last 7 days of backups
    find $BACKUP_DIR -name "valheim_backup_*.tar.gz" -mtime +7 -delete
    Schedule Daily Backups
    chmod +x ~/backup_valheim.sh
    crontab -e
    
    # Add this line for daily backup at 4 AM:
    0 4 * * * /home/valheim/backup_valheim.sh
    10

    Performance Optimization

    CPU Affinity

    Pin to CPU Cores
    sudo systemctl edit valheim
    
    # Add:
    [Service]
    CPUAffinity=0-1

    Network Optimization

    Adjust Network Buffers
    sudo nano /etc/sysctl.conf
    
    # Add:
    net.core.rmem_max=16777216
    net.core.wmem_max=16777216
    
    # Apply changes:
    sudo sysctl -p

    Monitor Resources

    Install Monitoring Tools
    sudo apt install -y htop iotop nethogs
    
    # Monitor in real-time:
    # htop - CPU and memory usage
    # iotop - Disk I/O
    # nethogs - Network bandwidth per process
    11

    Mods & Admin Configuration

    Admin Privileges

    Add Admin Players
    sudo su - valheim
    nano ~/valheim-data/adminlist.txt
    
    # Add Steam64 IDs of admin players (one per line)

    BepInEx Mod Support

    Popular Valheim mods require BepInEx:

    1. Download BepInExPack for Valheim from Thunderstore
    2. Extract to the server directory
    3. Place mod DLLs in BepInEx/plugins/
    4. Restart the server

    Connecting to Your Server

    Method 1: Server Browser

    1. Open Valheim
    2. Click "Join Game"
    3. Search for your server name
    4. Enter the password

    Method 2: Direct Connection

    1. Press F2 in server browser
    2. Enter: your-server-ip:2456
    3. Click "Connect"

    Troubleshooting

    Security Best Practices

    • Strong Passwords: Minimum 8 characters with mixed case, numbers, and symbols
    • Keep System Updated: Regular security patches
    • Limit SSH Access: Use SSH keys and disable password authentication
    • Monitor Server Activity: Review logs regularly
    • Regular Backups: Automate world backups to prevent data loss