Sign inSign up

indifferentbroccoli/valheim-server-docker

By indifferentbroccoli

Updated about 14 hours ago

This is a Dockerized version of the Valheim dedicated server.

Image
0

10K+

indifferentbroccoli/valheim-server-docker repository overview

marketing_assets_banner

GitHub License GitHub Release GitHub Repo stars Docker Pulls

Game server hosting

Fast RAM, high-speed internet

Eat lag for breakfast

Try our valheim Server hosting free for 2 days!

Valheim Server Docker

Server Requirements

ResourceMinimumRecommended
CPUQuad-Core Processor 2.8GHz (4 Cores)Hexa-Core Processor 3.4GHz+ (6 Cores)
RAM2GBRecommend over 4GB for stable operation
Storage2GB4GB+

How to use

Copy the .env.example file to a new file called .env file. Then use either docker compose or docker run

Important

Please make sure to change the following in the .env: SERVER_PASSWORD
Docker compose

Starting the server with Docker Compose:

services:
  valheim:
    image: indifferentbroccoli/valheim-server-docker
    restart: unless-stopped
    container_name: valheim
    stop_grace_period: 30s
    ports:
      - '2456:2456/udp'
      - '2457:2457/udp'
    environment:
      PUID: 1000
      PGID: 1000
    env_file:
      - .env
    volumes:
      - ./valheim/server-files:/valheim
      - ./valheim/server-data:/valheim-saves

Then run:

docker-compose up -d
Docker Run
docker run -d \
    --restart unless-stopped \
    --name valheim \
    --stop-timeout 30 \
    -p 2456:2456/udp \
    -p 2457:2457/udp \
    --env-file .env \
    -v ./valheim/server-files:/valheim \
    -v ./valheim/server-data:/valheim-saves
    indifferentbroccoli/valheim-server-docker

Environment Variables

VariableDescriptionDefault Value
PORTChoose the Port which you want the server to communicate with. Please note that this has to correspond with the Port Forwarding settings on your Router. Valheim uses the specified Port AND specified Port+1. Default Ports are 2456-2457.2456
SERVER_NAMEthe name of your server that will be visible in the Server list.valheim
SERVER_PASSWORDThe password for the serversecret
CROSSPLAY_ENABLEDRuns the Server on the Crossplay backend (PlayFab), which lets users from any platform join.true
WORLD_NAMEA World with the name entered will be created. You may also choose an already existing World by entering its name.dedicated
PUBLICSet the visibility of your server. true is default and will make the server visible in the browser. Set it to false to make the server invisible and only joinable via the ‘Join IP’-button.true
SAVE_INTERVALChange how often the world will save in seconds.1800
KEEP_BACKUPSSets how many automatic backups will be kept. The first is the ‘short’ backup length, and the rest are the ‘long’ backup length. By default that means one backup that is 2 hours old, and 3 backups that are 12 hours apart.4
BACKUPS_SHORTSets the interval between the first automatic backups in seconds.7200
BACKUPS_LONGSets the interval between the subsequent automatic backups in seconds.43200
SERVER_PRESETSets world modifier preset. Setting a preset will overwrite any other previous modifiers. Valid values are: Normal, Casual, Easy, Hard, Hardcore, Immersive, Hammer.Normal
MODIFIER_COMBATSets chosen world modifier with value. If combined with a preset should be set after. Valid modifiers and values are: veryeasy, easy, hard, veryhard
MODIFIER_DEATHSets chosen world modifier with value. If combined with a preset should be set after. Valid modifiers and values are: casual, veryeasy, easy, hard, hardcore
MODIFIER_RESOURCESSets chosen world modifier with value. If combined with a preset should be set after. Valid modifiers and values are: muchless, less, more, muchmore, most
MODIFIER_RAIDSSets chosen world modifier with value. If combined with a preset should be set after. Valid modifiers and values are: none, muchless, less, more, muchmore
MODIFIER_PORTALSSets chosen world modifier with value. If combined with a preset should be set after. Valid modifiers and values are: casual, hard, veryhard
NO_MAPDisables the map.false
PLAYER_EVENTSWhen set, raid events are player-based rather than world-basefalse
PASSIVE_MOBSEnables passive mobs.false
NO_BUILD_COSTDisables building cost.false

Developer information

Building the image

You can build the image from the Dockerfile using the following command:

docker build -t indifferentbroccoli/valheim-server-docker .
Scripts
init.sh

Entrypoint of the container. This script will check if the server is installed and if not, it will install it. Also has a term_handler function to catch SIGTERM/SIGINT signals to gracefully stop the server. Features basic checks that will confirm if the server can be started.

start.sh

Starts the server with the settings from the .env file. Will also call the compile-settings.sh script to generate the server settings.

install.scmd

Installs the server. This script will download the server files using SteamCMD and extract them to the server directory.

funtions.sh

Contains functions that are used in the other scripts.

Tag summary

Content type

Image

Digest

sha256:0197c3566

Size

183.6 MB

Last updated

about 14 hours ago

docker pull indifferentbroccoli/valheim-server-docker