# Valheim Dedicated Server + Status Page

> Valheim dedicated server with automatic updates, backups, and status monitoring.

- Category: Home Lab & Self-Hosting
- Difficulty: intermediate
- Components: valheim-server, valheim-status, nginx, backup-service
- Tags: valheim, gaming, dedicated-server, backup, monitoring
- Source: https://docker.recipes/homelab/valheim-server-complete

## Overview

The Valheim dedicated server (lloesche/valheim-server) is a containerized solution that runs Iron Gate Studio's popular Viking survival game server without requiring the full Steam client or GUI interface. This Docker image handles automatic game updates, world persistence, backup management, and server configuration through environment variables, making it ideal for hosting persistent multiplayer worlds that run independently of player sessions.

This stack combines the Valheim server with aldjinn/valheim-status for real-time server monitoring and NGINX as a reverse proxy to create a complete hosting solution. The status component provides web-based visibility into server health, player counts, and world information, while NGINX handles HTTP traffic routing and can serve as an entry point for additional web services. The lloesche image includes built-in backup functionality with configurable retention policies and automatic Steam workshop mod support.

Gamers running private servers for their communities, homelab enthusiasts hosting game servers, and small gaming clans will find this stack particularly valuable. The combination eliminates the need for manual server management while providing transparency into server status - crucial for coordinating multiplayer sessions and troubleshooting connectivity issues without requiring direct server access.

## Features

- Automatic Valheim server updates via Steam CMD with configurable cron scheduling (default every 15 minutes)
- Built-in world backup system with customizable retention policies and hourly backup scheduling
- Real-time server status monitoring showing player count, world name, and server health metrics
- Steam workshop mod support with automatic mod downloading and updating
- BepInEx mod framework integration for server-side modifications and plugins
- RCON protocol support for remote server administration and command execution
- World seed and difficulty configuration through environment variables
- NGINX reverse proxy setup for serving multiple web interfaces from a single port

## Use cases

- Private gaming communities hosting persistent Valheim worlds for clan members
- Content creators running modded Valheim servers for streaming and video production
- Gaming server providers offering managed Valheim hosting services
- Homelab enthusiasts learning containerized game server deployment and management
- Educational environments teaching server administration through gaming contexts
- Remote friend groups maintaining a shared Viking world across different time zones
- Gaming cafes or local businesses providing hosted multiplayer experiences

## Prerequisites

- Minimum 4GB RAM available (Valheim server requires 2-3GB, additional overhead for monitoring)
- UDP ports 2456-2458 forwarded through firewall and router for client connections
- SERVER_PASS environment variable set with minimum 5 characters for server access
- Docker host with at least 8GB disk space for world saves and backup retention
- Basic understanding of Valheim server administration and player management
- Network configuration knowledge for port forwarding and firewall rules

## docker-compose.yml

```yaml
services:
  valheim:
    image: lloesche/valheim-server
    environment:
      - SERVER_NAME=${SERVER_NAME:-My Valheim Server}
      - WORLD_NAME=${WORLD_NAME:-Dedicated}
      - SERVER_PASS=${SERVER_PASS}
      - SERVER_PUBLIC=true
      - UPDATE_CRON=*/15 * * * *
      - BACKUPS=true
      - BACKUPS_CRON=0 * * * *
      - BACKUPS_MAX_AGE=7
      - BACKUPS_MAX_COUNT=10
    volumes:
      - valheim-config:/config
      - valheim-data:/opt/valheim
    ports:
      - "2456-2458:2456-2458/udp"
    cap_add:
      - SYS_NICE
    networks:
      - valheim-network
    restart: unless-stopped

  status:
    image: aldjinn/valheim-status:latest
    environment:
      - SERVER_HOST=valheim
      - SERVER_PORT=2457
    ports:
      - "13080:80"
    depends_on:
      - valheim
    networks:
      - valheim-network
    restart: unless-stopped

  nginx:
    image: nginx:alpine
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    ports:
      - "80:80"
    depends_on:
      - status
    networks:
      - valheim-network
    restart: unless-stopped

volumes:
  valheim-config:
  valheim-data:

networks:
  valheim-network:
    driver: bridge
```

## .env

```bash
# Valheim Server
SERVER_NAME=My Valheim Server
WORLD_NAME=Dedicated
SERVER_PASS=minimum5chars

# Backup settings in compose environment
```

## Usage notes

- Game server on UDP 2456-2458
- Status page at http://localhost:13080
- Automatic updates every 15 minutes
- Hourly backups with 7-day retention
- Server password minimum 5 characters

## Troubleshooting

- Players cannot connect to server: Verify UDP ports 2456-2458 are forwarded and SERVER_PUBLIC is set to true
- Server fails to start with 'SteamCMD failed': Check internet connectivity and Steam service status, restart container
- World saves corrupted after container restart: Ensure valheim-data volume is properly mounted and not using tmpfs
- Status page shows server offline: Verify valheim container is running and SERVER_HOST points to correct service name
- Backup process failing with permission errors: Add proper user ID mapping or check volume mount permissions
- High memory usage causing container kills: Increase Docker host memory or adjust BACKUPS_MAX_COUNT to reduce retention

