Sign inSign up

gamepackets/valheim

By gamepackets

•Updated 6 months ago

Host Valheim dedicated servers using Docker hosts or Kubernetes.

Image
0

1.3K

gamepackets/valheim repository overview

⁠Valheim Dedicated Server

This is NOT an official Valheim docker container.

Dedicated Valheim server using Docker.

⁠Version Tags

TagDescription
stableLatest stable release build
latestLatest stable release build
experimentalLatest experimental release build

⁠Parameters

ParameterFunctionDefault
SERVER_DIRLocation for server files./data/server
STEAMLocation of steamcmd client./steam
STEAM_APP_EXTRASOptional. Additional options and values for steam app update, e.g setting BETA versions.``
UPDATE_OSUpdate core OS on startup. 1 enable, 0 disable.1
UPDATE_STEAMUpdate steamcmd on startup. 1 enable, 0 disable.1
UPDATE_SERVERUpdate dedicated server specified by STEAM_APP_ID on startup. 1 enable, 0 disable.1
PUIDUser ID to run steamcmd under as well as mount permissions.1000
PGIDGroup ID to run steamcmd under as well as mount permissions.1000
LANGLanguage environment to use in containers.en_US.UTF-8
LANGUAGELanguage environment to use in containers.en_US:UTF-8
LC_ALLLanguage environment to use in containers.en_US.UTF-8
SERVER_NAMEName of your Valheim server.My Valheim Server
WORLD_NAMEName of the world to load/create.Dedicated
SERVER_PASSWORDPassword required to join the server (minimum 5 characters).pleasechangeme
SERVER_PORTPrimary port for the server.2456
SERVER_PUBLICWhether the server appears in the public server list. 1 for public, 0 for private.1

⁠Ports

PortProtocolRequired?Description
2456UDPMandatoryMain game port (configurable via SERVER_PORT)
2457UDPMandatorySecondary port (automatically SERVER_PORT + 1)
2458UDPMandatoryTertiary port (automatically SERVER_PORT + 2)

⁠Volumes

VolumeFunction
/dataUser data location for the server.

⁠Usage

services:
  valheim-server:
    image: gamepackets/valheim:latest
    container_name: valheim-server
    restart: unless-stopped
    environment:
      - PUID=1000
      - PGID=1000
      - UPDATE_SERVER=1
      - SERVER_NAME=My Valheim Server
      - WORLD_NAME=Dedicated
      - SERVER_PASSWORD=ChangeMe123
      - SERVER_PUBLIC=1
    ports:
      - "2456:2456/udp"
      - "2457:2457/udp"
      - "2458:2458/udp"
    volumes:
      - ./data:/data
⁠Docker Run
docker run -d \
  --name=valheim-server \
  --restart=unless-stopped \
  -e PUID=1000 \
  -e PGID=1000 \
  -e UPDATE_SERVER=1 \
  -e SERVER_NAME="My Valheim Server" \
  -e WORLD_NAME="Dedicated" \
  -e SERVER_PASSWORD="ChangeMe123" \
  -e SERVER_PUBLIC=1 \
  -p 2456:2456/udp \
  -p 2457:2457/udp \
  -p 2458:2458/udp \
  -v ./data:/data \
  gamepackets/valheim:latest

⁠Building

# Build latest version
docker build -f Dockerfile.Latest -t valheim:latest .

# Build stable version
docker build -f Dockerfile.Stable -t valheim:stable .

# Build experimental version
docker build -f Dockerfile.Experimental -t valheim:experimental .

⁠Additional Configuration

⁠Server Customization

All server configuration is done through environment variables:

  • SERVER_NAME: Set the name that appears in the server browser
  • WORLD_NAME: Choose the world name (determines save file)
  • SERVER_PASSWORD: Must be at least 5 characters long
  • SERVER_PORT: Default is 2456. The server will use this port and the next two (2457, 2458)
  • SERVER_PUBLIC: Set to 1 to list publicly, 0 for private (LAN only)
⁠Beta Branches

To use Valheim's public test branch, add the following environment variable:

environment:
  - STEAM_APP_EXTRAS=-beta public-test
⁠World Saves

World data is stored in /data/server/.config/unity3d/IronGate/Valheim/worlds_local/ inside the container.

⁠Backups

It's recommended to regularly backup the ./data directory to preserve your world and character data.

⁠Troubleshooting

⁠Server not appearing in server list
  • Ensure SERVER_PUBLIC=1 is set
  • Verify ports 2456-2458 are properly forwarded through your router
  • Check that SERVER_PASSWORD is at least 5 characters
⁠Can't connect to server
  • Verify all three ports (2456, 2457, 2458) are exposed and properly mapped
  • Ensure firewall rules allow UDP traffic on these ports
  • If connecting locally, use the server's LAN IP address
⁠Server crashes or won't start
  • Check container logs: docker logs valheim-server
  • Ensure sufficient memory is available (minimum 2GB recommended)
  • Verify the server password meets minimum requirements (5 characters)
⁠World not saving
  • Ensure the /data volume is properly mounted
  • Check file permissions (PUID/PGID should match your user)
  • Verify sufficient disk space is available

⁠License

MIT License - See LICENSE⁠ file for details

Tag summary

Content type

Image

Digest

sha256:88a409c52…

Size

1.6 GB

Last updated

6 months ago

docker pull gamepackets/valheim:sha-720b6b6