Git Product home page Git Product logo

valheim-server-docker's Introduction

lloesche/valheim-server Docker image

Valheim

Valheim Server in a Docker Container (with BepInEx and ValheimPlus support)
This project is hosted at https://github.com/lloesche/valheim-server-docker

Table of contents

Basic Docker Usage

The name of the Docker image is ghcr.io/lloesche/valheim-server.

Volume mount the server config directory to /config within the Docker container.

If you have an existing world on a Windows system you can copy it from e.g.
C:\Users\Lukas\AppData\LocalLow\IronGate\Valheim\worlds_local to e.g.
$HOME/valheim-server/config/worlds_local and run the image with $HOME/valheim-server/config volume mounted to /config inside the container. The container directory /opt/valheim contains the downloaded server. It can optionally be volume mounted to avoid having to download the server on each fresh start.

$ mkdir -p $HOME/valheim-server/config/worlds_local $HOME/valheim-server/data
# copy existing world
$ docker run -d \
    --name valheim-server \
    --cap-add=sys_nice \
    --stop-timeout 120 \
    -p 2456-2457:2456-2457/udp \
    -v $HOME/valheim-server/config:/config \
    -v $HOME/valheim-server/data:/opt/valheim \
    -e SERVER_NAME="My Server" \
    -e WORLD_NAME="Neotopia" \
    -e SERVER_PASS="secret" \
    ghcr.io/lloesche/valheim-server

Warning: SERVER_PASS must be at least 5 characters long. Otherwise valheim_server.x86_64 will refuse to start!

A fresh start will take several minutes depending on your Internet connection speed as the container will download the Valheim dedicated server from Steam (~1 GB).

Do not forget to modify WORLD_NAME to reflect the name of your world! For existing worlds that is the filename in the worlds_local/ folder without the .db/.fwl extension.

If you want to play with friends over the Internet and are behind NAT make sure that UDP ports 2456-2457 are forwarded to the container host. (Remark: If you use crossplay, you don't need port forwarding! See official Valheim Dedicated Server Manual.pdf in the data/server folder.) Also ensure they are publicly accessible in any firewall.

Crossplay: To enable crossplay between different platforms add -crossplay to SERVER_ARGS:

    -e SERVER_ARGS="-crossplay"

There is more info in section Finding Your Server.

For LAN-only play see section Steam Server Favorites & LAN Play

For more deployment options see the Deployment section.

Granting CAP_SYS_NICE to the container is optional. It allows the Steam library that Valheim uses to give itself more CPU cycles. Without it you will see a message Warning: failed to set thread priority in the startup log.

Environment Variables

All variable names and values are case-sensitive!

Name Default Purpose
SERVER_NAME My Server Name that will be shown in the server browser
SERVER_PORT 2456 UDP start port that the server will listen on
WORLD_NAME Dedicated Name of the world without .db/.fwl file extension
SERVER_PASS secret Password for logging into the server - min. 5 characters!
SERVER_PUBLIC true Whether the server should be listed in the server browser (true) or not (false)
SERVER_ARGS Additional Valheim server CLI arguments
ADMINLIST_IDS Space separated list of admin SteamIDs in SteamID64 format. Overrides any existing adminlist.txt entries!
BANNEDLIST_IDS Space separated list of banned SteamIDs in SteamID64 format. Overrides any existing bannedlist.txt entries!
PERMITTEDLIST_IDS Space separated list of whitelisted SteamIDs in SteamID64 format. Overrides any existing permittedlist.txt entries!
UPDATE_CRON */15 * * * * Cron schedule for update checks (disabled if set to an empty string or if the legacy UPDATE_INTERVAL is set)
IDLE_DATAGRAM_WINDOW 3 The time window, in seconds, to wait for incoming UDP datagrams on non-public servers before determining if the server is idle
IDLE_DATAGRAM_MAX_COUNT 30 The number of incoming UDP datagrams the container should tolerate (including useless datagrams such as mDNS, as well as useful datagrams like queries against the UDP query port and active connections by players) on non-public servers before deciding that the server is not idle
UPDATE_IF_IDLE true Only run update check if no players are connected to the server (true or false)
RESTART_CRON 0 5 * * * Cron schedule for server restarts (disabled if set to an empty string)
RESTART_IF_IDLE true Only run daily restart if no players are connected to the server (true or false)
TZ Etc/UTC Container time zone
BACKUPS true Whether the server should create periodic backups (true or false)
BACKUPS_CRON 0 * * * * Cron schedule for world backups (disabled if set to an empty string or if the legacy BACKUPS_INTERVAL is set)
BACKUPS_DIRECTORY /config/backups Path to the backups directory
BACKUPS_MAX_AGE 3 Age in days after which old backups are flushed
BACKUPS_MAX_COUNT 0 Maximum number of backups kept, 0 means infinity
BACKUPS_IF_IDLE true Backup even when no players have been connected for a while
BACKUPS_IDLE_GRACE_PERIOD 3600 Grace period in seconds after the last player has disconnected in which we will still create backups when BACKUPS_IF_IDLE=false
BACKUPS_ZIP true Compress Backups with zip. If set to false Backups will be stored uncompressed.
PERMISSIONS_UMASK 022 Umask to use for backups, config files and directories
STEAMCMD_ARGS validate Additional steamcmd CLI arguments
PUBLIC_TEST false Run the Public Test Beta version of Valheim server. Note that this simply extends existing STEAMCMD_ARGS by adding the appropriate beta flags to it.
VALHEIM_PLUS false Whether ValheimPlus mod should be loaded (config in /config/valheimplus, additional plugins in /config/valheimplus/plugins). Can not be used together with BEPINEX.
VALHEIM_PLUS_REPO Grantapher/ValheimPlus Which ValheimPlus Github repo to use. Useful for switching to forks.
VALHEIM_PLUS_RELEASE latest Which version of ValheimPlus to download. Will default to latest available. To specify a specific tag set to tags/0.9.9.8
BEPINEX false Whether BepInExPack Valheim mod should be loaded (config in /config/bepinex, plugins in /config/bepinex/plugins). Can not be used together with VALHEIM_PLUS.
SUPERVISOR_HTTP false Turn on supervisor's http server
SUPERVISOR_HTTP_PORT 9001 Set supervisor's http server port
SUPERVISOR_HTTP_USER admin Supervisor http server username
SUPERVISOR_HTTP_PASS Supervisor http server password
STATUS_HTTP false Turn on the status http server. Only useful on public servers (SERVER_PUBLIC=true).
STATUS_HTTP_PORT 80 Status http server tcp port
STATUS_HTTP_CONF /config/httpd.conf Path to the busybox httpd config
STATUS_HTTP_HTDOCS /opt/valheim/htdocs Path to the status httpd htdocs where status.json is written
SYSLOG_REMOTE_HOST Remote syslog host or IP to send logs to
SYSLOG_REMOTE_PORT 514 Remote syslog UDP port to send logs to
SYSLOG_REMOTE_AND_LOCAL true When sending logs to a remote syslog server also log local
PUID 0 UID to run valheim-server as
PGID 0 GID to run valheim-server as

There are a few undocumented environment variables that could break things if configured wrong. They can be found in defaults.

Log filters

Valheim server by default logs a lot of noise. These env variables allow users to remove unwanted lines from the log.

Prefix Default Purpose
VALHEIM_LOG_FILTER_EMPTY true Filter empty log lines
VALHEIM_LOG_FILTER_UTF8 true Filter invalid UTF-8 characters
VALHEIM_LOG_FILTER_MATCH Filter log lines exactly matching
VALHEIM_LOG_FILTER_STARTSWITH (Filename: Filter log lines starting with
VALHEIM_LOG_FILTER_ENDSWITH Filter log lines ending with
VALHEIM_LOG_FILTER_CONTAINS Filter log lines containing
VALHEIM_LOG_FILTER_REGEXP Filter log lines matching regexp

The default filter removes:

  • Empty log lines
  • Log lines consisting of a single space (wtf?)
  • A repeating line saying (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
  • Lines flooding the log with Assertion Failed warnings on packet processing timeouts (See #104)
  • If ValheimPlus is turned on lines starting with Fallback handler could not load library

Log filter event hooks

If an environment variable prefixed with ON_ exists for an identically named log filter, instead of removing the log line the contents of the variable will be executed when the filter matches with the log line piped on stdin.

Prefix Purpose
ON_VALHEIM_LOG_FILTER_MATCH Run command hook on log lines exactly matching
ON_VALHEIM_LOG_FILTER_STARTSWITH Run command hook on log lines starting with
ON_VALHEIM_LOG_FILTER_ENDSWITH Run command hook on log lines ending with
ON_VALHEIM_LOG_FILTER_CONTAINS Run command hook on log lines containing
ON_VALHEIM_LOG_FILTER_REGEXP Run command hook on regexp match

All environment variables except for VALHEIM_LOG_FILTER_EMPTY and VALHEIM_LOG_FILTER_UTF8 are prefixes. Meaning you can define multiple matches like so:

-e VALHEIM_LOG_FILTER_STARTSWITH=foo \
-e VALHEIM_LOG_FILTER_STARTSWITH_BAR=bar \
-e VALHEIM_LOG_FILTER_STARTSWITH_SOMETHING_ELSE="some other filter"
-e VALHEIM_LOG_FILTER_CONTAINS_Connected="Got character ZDOID from"
-e ON_VALHEIM_LOG_FILTER_CONTAINS_Connected="cat >> /tmp/character_login"

Discord log filter event hook example

Sends a Discord message whenever a player spawns

-e DISCORD_WEBHOOK="https://discord.com/api/webhooks/8171522530..." \
-e VALHEIM_LOG_FILTER_CONTAINS_Spawned="Got character ZDOID from" \
-e ON_VALHEIM_LOG_FILTER_CONTAINS_Spawned='{ read l; l=${l//*ZDOID from /}; l=${l// :*/}; msg="Player $l spawned into the world"; curl -sfSL -X POST -H "Content-Type: application/json" -d "{\"username\":\"Valheim\",\"content\":\"$msg\"}" "$DISCORD_WEBHOOK"; }'

See Notify on Discord below for proper quoting in env and compose files.

If you are running ValheimPlus and this filter triggers twice, check this ValheimPlus issue. The cause is a misconfigured BepInEx.cfg that causes all log lines to be duplicated.

Event hooks

The following environment variables can be populated to run commands whenever specific events happen.

Name Default Purpose
PRE_SUPERVISOR_HOOK Command to be executed before supervisord is run. Startup is blocked until this command returns.
PRE_BOOTSTRAP_HOOK Command to be executed before bootstrapping is done. Startup is blocked until this command returns.
POST_BOOTSTRAP_HOOK Command to be executed after bootstrapping is done and before the server or any services are started. Can be used to install additional packages or perform additional system setup. Startup is blocked until this command returns.
PRE_BACKUP_HOOK Command to be executed before a backup is created. The string @BACKUP_FILE@ will be replaced by the full path of the future backup zip file. Backups are blocked until this command returns.
POST_BACKUP_HOOK Command to be executed after a backup is created. The string @BACKUP_FILE@ will be replaced by the full path of the backup zip file. Backups are blocked until this command returns. See Copy backups to another location for details.
PRE_UPDATE_CHECK_HOOK Command to be executed before an update check is performed. Current update is blocked until this command returns.
POST_UPDATE_CHECK_HOOK Command to be executed after an update check was performed. Future updates are blocked until this command returns.
PRE_START_HOOK Command to be executed before the first server start is performed by the valheim-updater. Current start is blocked until this command returns.
POST_START_HOOK Command to be executed after the first server start was performed by the valheim-updater. Future restarts and update checks are blocked until this command returns.
PRE_RESTART_HOOK Command to be executed before a server restart is performed by the valheim-updater. Current restart is blocked until this command returns.
PRE_SERVER_LISTENING_HOOK Command to be executed after the server runs, but before it's able to accept connections. The loop that checks connection status will be blocked until this command returns.
POST_SERVER_LISTENING_HOOK Command to be executed once the server is available for players to connect! The hook only fires after status is updated to running.
POST_RESTART_HOOK Command to be executed after a server restart was performed by the valheim-updater. Future restarts and update checks are blocked until this command returns.
PRE_SERVER_RUN_HOOK Command to be executed before the server is started. Server startup is blocked until this command returns.
POST_SERVER_RUN_HOOK Command to be executed after the server has finished running. Server shutdown is blocked until this command returns or a shutdown timeout is triggered after 29 seconds.
PRE_SERVER_SHUTDOWN_HOOK Command to be executed before the server is shut down. Server shutdown is blocked until this command returns. If PRE_SERVER_SHUTDOWN_HOOK holds the shutdown process for more than 90 seconds, the entire process will be hard-killed by supervisord.
POST_SERVER_SHUTDOWN_HOOK Command to be executed after the server has finished shutting down.
PRE_BEPINEX_CONFIG_HOOK Command to be executed before writing BepInEx.cfg.
POST_BEPINEX_CONFIG_HOOK Command to be executed after writing BepInEx.cfg. Can be used to write your own mod config using env2cfg.

Event hook examples

Install extra packages

-e POST_BOOTSTRAP_HOOK="apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install awscli"

Copy backups to another location

After a backup ZIP has been created the command specified by $POST_BACKUP_HOOK will be executed if set to a non-zero string. Within that command the string @BACKUP_FILE@ will be replaced by the full path to the just created ZIP file.

-v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa \
-v $HOME/.ssh/known_hosts:/root/.ssh/known_hosts \
-e POST_BACKUP_HOOK='timeout 300 scp @BACKUP_FILE@ [email protected]:~/backups/$(basename @BACKUP_FILE@)'

Notify on Discord

Because proper string quoting on the shell vs. inside a docker-compose.yaml vs. an env_file can be challenging, here are examples for each use case.

Using the commandline

Delay restarts by 1 minute and notify on Discord

-e DISCORD_WEBHOOK="https://discord.com/api/webhooks/8171522530..." \
-e DISCORD_MESSAGE="Restarting Valheim server in one minute!" \
-e PRE_RESTART_HOOK='curl -sfSL -X POST -H "Content-Type: application/json" -d "{\"username\":\"Valheim\",\"content\":\"$DISCORD_MESSAGE\"}" "$DISCORD_WEBHOOK" && sleep 60'
Inside docker-compose.yaml

Notify on Discord with server's name in the message

    environment:
      - DISCORD_WEBHOOK=https://discord.com/api/webhooks/8171522530...
      - DISCORD_MESSAGE=Starting Valheim server $$SERVER_NAME
      - 'PRE_BOOTSTRAP_HOOK=curl -sfSL -X POST -H "Content-Type: application/json" -d "{\"username\":\"Valheim\",\"content\":\"$$(eval echo $$DISCORD_MESSAGE)\"}" "$$DISCORD_WEBHOOK"'
Inside an env_file
DISCORD_WEBHOOK=https://discord.com/api/webhooks/8171522530...
DISCORD_MESSAGE=Starting Valheim server
PRE_BOOTSTRAP_HOOK=curl -sfSL -X POST -H "Content-Type: application/json" -d "{\"username\":\"Valheim\",\"content\":\"$DISCORD_MESSAGE\"}" "$DISCORD_WEBHOOK"

Notify on Matrix, inside an env_file

Create an account for your bot, log in and join the room you want to post to. The room ID is noted in the room's settings.

MATRIX_BOT_SERVER=https://matrix...
MATRIX_BOT_ROOM_ID=!...
MATRIX_BOT_ACCESS_TOKEN=...
PRE_RESTART_HOOK=curl -sfSL -X PUT -d "{\"msgtype\":\"m.notice\",\"body\":\"Valheim is being updated\"}" "$MATRIX_BOT_SERVER/_matrix/client/r0/rooms/$MATRIX_BOT_ROOM_ID/send/m.room.message/$(date +%s-%N)?access_token=$MATRIX_BOT_ACCESS_TOKEN"

Note the $(date +%s-%N) is used for the required unique txnId.

Mod config from Environment Variables

Mod config can be specified in environment variables using the syntax <prefix>_<section>_<variable>=<value>.

Predefined prefix list

Prefix Mod File
VPCFG ValheimPlus /config/valheimplus/valheim_plus.cfg
BEPINEXCFG BepInEx /config/valheimplus/BepInEx.cfg or /config/bepinex/BepInEx.cfg depending on whether VALHEIM_PLUS=true or BEPINEX=true

Translation table
Some characters that are allowed as section names in the config files are not allowed as environment variable names. They can be encoded using the following translation table.

Variable name string Replacement
_DOT_ .
_HYPHEN_ -
_UNDERSCORE_ _
_PLUS_ +
_SPACE_

Example:

-e VALHEIM_PLUS=true \
-e VPCFG_Server_enabled=true \
-e VPCFG_Server_enforceMod=false \
-e VPCFG_Server_dataRate=500 \
-e BEPINEXCFG_Logging_DOT_Console_Enabled=true

turns into /config/valheimplus/valheim_plus.cfg

[Server]
enabled=true
enforceMod=false
dataRate=500

and /config/valheimplus/BepInEx.cfg

[Logging.Console]
Enabled=true

All existing configuration in those files is retained and a backup of the old config is created as e.g. /config/valheimplus/valheim_plus.cfg.old before writing the new config file.

You could generate your own custom plugin config from environment variables using the POST_BEPINEX_CONFIG_HOOK event hook and env2cfg.

System requirements

On our system while idle with no players connected Valheim server consumes around 2.8 GB RSS. All the while using around 30% of one CPU Core on a 2.40 GHz Intel Xeon E5-2620 v3. Valheim server is making use of many threads with two of them seemingly doing the bulk of the work each responsible for around 8-10% of the 30% of idle load.

The picture changes when players connect. The first player increased overall load to 42%, the second player to 53%. In the thread view we see that a thread that was previously consuming 10% is now hovering around 38%. Meaning while Valheim server creates 50 threads on our system it looks like there is a single thread doing the bulk of all work (~70%) with no way for the Kernel to distribute the load to many cores.

Therefore our minimum requirements would be a dual core system with 4 GB of RAM and our recommended system would be a high clocked 4 core server with 8 GB of RAM. A few very high clocked cores will be more beneficial than having many cores. I.e. two 5 GHz cores will yield better performance than six 2 GHz cores. This holds especially true the more players are connected to the system.

Deployment

Deploying with Docker and systemd

Create a config file /etc/sysconfig/valheim-server

SERVER_NAME=My Server
SERVER_PORT=2456
WORLD_NAME=Dedicated
SERVER_PASS=secret
SERVER_PUBLIC=true

Then enable the Docker container on system boot

$ sudo mkdir -p /etc/valheim /opt/valheim
$ sudo curl -o /etc/systemd/system/valheim.service https://raw.githubusercontent.com/lloesche/valheim-server-docker/main/valheim.service
$ sudo systemctl daemon-reload
$ sudo systemctl enable valheim.service
$ sudo systemctl start valheim.service

Deploying with docker compose

Copy and paste the following into your shell

mkdir -p $HOME/valheim-server/config $HOME/valheim-server/data
cd $HOME/valheim-server/
cat > $HOME/valheim-server/valheim.env << EOF
SERVER_NAME=My Server
WORLD_NAME=Dedicated
SERVER_PASS=secret
SERVER_PUBLIC=true
EOF
curl -o $HOME/valheim-server/docker-compose.yaml https://raw.githubusercontent.com/lloesche/valheim-server-docker/main/docker-compose.yaml
docker compose up -d

Deploying to Kubernetes

Kubernetes manifests using this container image, along with a helm chart, are available from the following repository: https://github.com/Addyvan/valheim-k8s

The chart is also available directly using:

helm repo add valheim-k8s https://addyvan.github.io/valheim-k8s/
helm repo update
helm install valheim-server valheim-k8s/valheim-k8s # see repo for full config

Deploying to AWS ECS

CDK Project for spinning up a Valheim game server on AWS Using ECS Fargate and Amazon EFS is available here: https://github.com/rileydakota/valheim-ecs-fargate-cdk

Deploying to Nomad

$ sudo mkdir -p /var/lib/valheim/{config,data}
$ sudo curl -o /var/lib/valheim/valheim.nomad https://raw.githubusercontent.com/lloesche/valheim-server-docker/main/valheim.nomad
$ sudo nomad job run /var/lib/valheim/valheim.nomad

Updates

By default the container will check for Valheim server updates every 15 minutes if no players are currently connected to the server. If an update is found it is downloaded and the server restarted. This update schedule can be changed using the UPDATE_CRON environment variable.

Backups

The container will on startup and periodically create a backup of the worlds_local/ directory.

The default is once per hour but can be changed using the BACKUPS_CRON environment variable.

Default backup directory is /config/backups/ within the container. A different directory can be set using the BACKUPS_DIRECTORY environment variable. It makes sense to have this directory be a volume mount from the host. Warning: do not make the backup directory a subfolder of /config/worlds_local/. Otherwise each backup will backup all previous backups.

By default 3 days worth of backups will be kept. A different number can be configured using BACKUPS_MAX_AGE. The value is in days.

It is possible to configure a maximum number of to-be-kept backup files with BACKUPS_MAX_COUNT. When going over this limit, the oldest file(s) will be deleted. The default is 0 which means no limit. Note that BACKUPS_MAX_AGE will always be respected: if backups get too old, they will be deleted even if BACKUPS_MAX_COUNT was not yet reached (or is 0).

Beware that backups are performed while the server is running. As such files might be in an open state when the backup runs. However the worlds_local/ directory also contains a .db.old file for each world which should always be closed and in a consistent state.

See Copy backups to another location for an example of how to copy backups offsite.

If BACKUPS_IF_IDLE=false then backups are only created if there has been recent player activity. Once the last player disconnects there is a grace period BACKUPS_IDLE_GRACE_PERIOD in seconds after which backups are still being created. The reason for this is that Valheim dedicated server only saves the world in 20 minute intervals and on shutdown. So to make sure that we have a consistent world file backup of the most recent changes we want to wait out one world save. This grace period also needs to be long enough so that our BACKUPS_CRON had a chance to run.

BACKUPS_ZIP=false can be used to store backups uncompressed in the backup directory. Please note that this will increase the filesize of the backups, due to no compression.

Manual backup

Sending SIGHUP to the valheim-backup service or restarting the service will create a backup. If BACKUPS_IF_IDLE=false sending SIGHUP only creates a backup if there has been recent player activity. Restarting valheim-backup will always create a backup.

The PID of the running service can be found in /var/run/valheim-backup.pid

Assuming your container's name is valheim-server here's how both would work:

Sending SIGHUP using supervisorctl

docker exec -it valheim-server supervisorctl signal HUP valheim-backup

Sending SIGHUP manually

docker exec -it valheim-server bash -c 'kill -HUP $(< /var/run/valheim-backup.pid)'

Restarting valheim-backup

docker exec -it valheim-server supervisorctl restart valheim-backup

The restart can also be done from the Supervisor web UI. Backup Step 1

Finding Your Server

Once the server is up and running and the log says something like

02/09/2021 10:42:24: Game server connected

it can still be challenging to actually find the server.

There are three ways of getting to your server. Either using the Steam server browser, adding the IP manually or using the in-game Community server list.

In-game

When in-game, click on Join Game and select Community. Wait for the game to load the list of all 4000+ servers. Only 200 servers will be shown at a time so we will have to enter part of our server name to filter the view. in-game server browser

Joining Directly via Hostname/IP

Valheim has since added the Join IP button to the Join Game tab. If you click the Join IP button, you are prompted to enter your server's IP address and port number. If you left the SERVER_PORT at its default value of 2456, you do not have to enter the port. The hostname or IP of your server will suffice. If you changed the port, you have to specify it like this: example.com:3333.

This method of connecting to your server will work even if your server is not public (i.e., you set SERVER_PUBLIC to false).

in-game server browser with join ip button join ip dialog

Steam Server Browser

When using the Steam server browser, in Steam go to View -> Servers. Click on CHANGE FILTERS and select Game Valheim. Wait for Steam to load all 4000+ Servers then sort the SERVERS column by clicking on its title. Scroll down until you find your server. Steam server browser From there you can right-click it and add as a favourite.

Note that in my tests when connecting to the server via the Steam server browser I had to enter the server password twice. Once in Steam and once in-game.

Steam Server Favorites & LAN Play

A third option within Steam is to add the server manually by IP. This also allows for LAN play without the need to open or forward any firewall ports.

Remark: LAN-Play is only available for Steam-Version without CrossPlay enabled! See official Valheim Dedicated Server Manual.pdf in the data/server folder.

Steps:

  1. Within Steam click on View -> Servers
  2. FAVORITES
  3. ADD SERVER
  4. Enter Server IP and port+1. So if the server is running on UDP port 2456 enter ip:2457
  5. FIND GAMES AT THIS ADDRESS...
  6. ADD SELECTED GAME SERVER TO FAV...

Add server manually

Do not use the ADD THIS ADDRESS TO FAVORITES button at this point.

NOTE: Sometimes I will get the following error when trying to connect to a LAN server: Steam Server Browser Error

In those cases it sometimes helped to add the server again, but this time using port 2456 and now pressing the ADD THIS ADDRESS TO FAVORITES button. It will not generate a new entry in the favourites list but seemingly just update the existing one that was originally discovered on port 2457.

Sometimes it also helps to press the REFRESH button and then immediately double click on the Server.

Overall LAN play via the Steam Server Browser has been a bit hit and miss for me while online play using the in-game search has resulted in the most consistent success.

NOTE 2: You will only find your Valheim game server using this method if your server is public (SERVER_PUBLIC is NOT set to false). If you started your server with SERVER_PUBLIC set to false, you will get the error message: Server is not responding. in the list where the servers are supposed to appear.

Admin Commands

Upon startup the server will create a file /config/adminlist.txt. In it you can list the IDs of all administrator users.

The ID of a user can be gotten either in-game by pressing F2 User ID in-game

or in the server logs when a user connects. User ID in logs

Administrators can press F5 to open the in-game console and use commands like ban and kick. Kick a user

Enable Admin Console

In recent versions of Valheim the game client has to be started with the -console flag for F5 to work. Enable Admin Console

Supervisor

This container uses a process supervisor aptly named supervisor. Within the container processes can be started and restarted using the command supervisorctl. For instance supervisorctl restart valheim-server would restart the server.

Supervisor provides a very simple http interface which can be optionally turned on by supplying SUPERVISOR_HTTP=true and a password in SUPERVISOR_HTTP_PASS. The default SUPERVISOR_HTTP_USER is admin but can be changed to anything else. Once activated the http server will listen on tcp port 9001 which has to be exposed (-p 9001:9001/tcp).

Supervisor

Supervisor API

If Supervisor's http server is enabled it also provides an XML-RPC API at /RPC2. Details can be found in the official documentation.

Status web server

If STATUS_HTTP is set to true the status web server will be started. By default it runs on container port 80 but can be customized using STATUS_HTTP_PORT.

This only works for public Valheim servers (SERVER_PUBLIC=true) because private ones do not answer to Steam server queries.

A /status.json will be updated every 10 seconds.

Whenever Valheim server is not yet running the status will contain an error like

{
  "last_status_update": "2021-03-07T21:42:46.307232+00:00",
  "error": "timeout('timed out')"
}

The error is just a string representation of whatever Python exception was thrown when trying to connect to the query port (2457/udp by default).

Once the server is running and listening on its UDP ports /status.json will contain something like this

{
  "last_status_update": "2021-03-07T21:42:16.076662+00:00",
  "error": null,
  "server_name": "My Docker based server",
  "server_type": "d",
  "platform": "l",
  "player_count": 1,
  "password_protected": true,
  "vac_enabled": false,
  "port": 2456,
  "steam_id": 90143789459088380,
  "keywords": "[email protected]",
  "game_id": 892970,
  "players": [
    {
      "name": "",
      "score": 0,
      "duration": 7.000421047210693
    }
  ]
}

All the information in status.json is fetched from Valheim servers public query port. You will notice that some of the fields like player name or player score currently contain no information. However for completeness the entire query response is left intact.

Within the container status.json is written to STATUS_HTTP_HTDOCS which by default is /opt/valheim/htdocs. It can either be consumed directly or the user can add their own html/css/js to this directory to read the json data and present it in whichever style they prefer. A file named index.html will be shown on / if it exists.

As mentioned all the information is publicly available on the Valheim server query port. However the option is there to configure a STATUS_HTTP_CONF (/config/httpd.conf by default) containing busybox httpd config to limit access to the status web server by IP/subnet or login/password.

Modding

Remark: Some Mods are using RPC commands, which needs gameport+2 for communication (e.g. if you're using gamport 2456, you have to open port 2458 too for the network: 2456-2458:2456-2458/udp) and in your firewall rules (if defined).

BepInExPack Valheim

Enable with

Variable Value
BEPINEX true

BepInExPack Valheim packages BepInEx for Valheim. BepInEx is a plugin / modding framework for Unity Mono, IL2CPP and .NET framework games. To enable BepInExPack provide the env variable BEPINEX=true. This can not be specified together with VALHEIM_PLUS=true. Just like Valheim Server this mod is automatically updated using the UPDATE_CRON schedule.

Upon first start BepInExPack will create a new directory /config/bepinex where its config files are located. BepInEx plugins must be copied into the /config/bepinex/plugins/ directory. From there they will be automatically copied into /opt/valheim/bepinex/BepInEx/plugins/ on install/update.

Configuration

See Mod config from Environment Variables

ValheimPlus

Enable with

Variable Value
VALHEIM_PLUS true

ValheimPlus is a popular Valheim mod based on BepInEx. It has been incorporated into this container. To enable V+ provide the env variable VALHEIM_PLUS=true. This can not be specified together with BEPINEX=true. Upon first start V+ will create a new directory /config/valheimplus where its config files are located. As a user you are mainly concerned with the values in /config/valheimplus/valheim_plus.cfg. For most modifications the mod has to be installed both, on the server as well as all the clients that connect to the server. A few modifications, like for example changing the dataRate can be done server only.

Updates

ValheimPlus is automatically being updated using the same UPDATE_CRON schedule the Valheim server uses to check for updates. If an update of either Valheim server or ValheimPlus is found it is being downloaded, configured and the server automatically restarted. This also means your clients always need to run the latest ValheimPlus version or will not be able to connect. If this is undesired the schedule could be changed to only check for updates once per day. Example UPDATE_CRON='0 6 * * *' would only check at 6 AM.

Configuration

See Mod config from Environment Variables

Disable server password

Another popular mod for LAN play that does not require the clients to run ValheimPlus is to turn off password authentication.

To do so enable ValheimPlus (VALHEIM_PLUS=true), set an empty password (SERVER_PASS=""), make the server non-public (SERVER_PUBLIC=false) and configure the following section in /config/valheimplus/valheim_plus.cfg

[Server]
enabled=true
enforceMod=false
disableServerPassword=true

Alternatively start with -e VPCFG_Server_enabled=true -e VPCFG_Server_enforceMod=false -e VPCFG_Server_disableServerPassword=true.

Ensure that the server can not be accessed from the public Internet. If you like to have the LAN experience but over the Internet I can highly recommend ZeroTier. It is an open source VPN service where you can create a virtual network switch that you and your friends can join. It is like Hamachi but free and open source. They do have a paid product for Businesses with more than 50 users. So for more than 50 users you could either get their Business product or alternatively would have to host the VPN controller yourself.

Changing startup CMD in Portainer

Portainer retains the startup CMD from the first time the container ist deployed. This is also true if the container is updated using "Recreate" in combination with "Pull latest image".

Recent changes made it so that the startup CMD of the image was changed. To avoid recreating the container from scratch you can use the "Duplicate/Edit" function of Portainer by following the instructions outlined below.

Portainer Step 1

Stop the old container (1) and edit the name (2)

Portainer Step 2

Append _old or similar to the name (3) save the change (4) and click "Duplicate/Edit" (5)

Portainer Step 3

Change the name back to original name (2) (3) (4).

Unter Advanced container settings override (6) the command and enter /usr/local/sbin/bootstrap (7)

Make sure "Always pull the image" is enabled.

click "Deploy the container" to finish.

If your server starts and is working delete the old unused image and the old container.

Synology Help

First install

This is not an extensive tutorial, but I hope these screenshots can be helpful. Beware that the server can use multiple GB of RAM and produces a lot of CPU load.

Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 Step 7 Step 8

Updating the container image to the latest version

The process of updating the image clears all data stored inside the container. So before doing a container image upgrade, make absolutely sure that /config, which contains your world, is an external volume stored on your NAS (Step 4 of the First install process). It is also a good idea to copy the latest version of the world backup to another location, like your PC. Update Step 1 Update Step 2 Update Step 3 Update Step 4 Update Step 5 Update Step 6

Error after download of new container image

If you are getting the following error after an Update: Error Step 1

Error Step 2

"Failure: OCI runtime create failed: container_linux.go:367: [...]"

You will need to remove the container completely and perform the First install steps again. Error Step 3

Make sure to use the same folder settings as before so the existing /config and /opt/valheim directories are used.

The error is caused by Synology using the old image's CMD with the newly downloaded image. By removing the container and recreating it we're forcing Synology to use the new images CMD.

QNAP NAS Help

Creating container

As a prerequisite you need to create a folder where you will keep your saves, backups and configuration.

Here is an example docker-compose.yaml file that we will use in the next steps.

services:
  valheim:
    image: lloesche/valheim-server
    cap_add:
      - sys_nice
    volumes:
      - /share/CACHEDEV1_DATA/{path_to_folder}/config:/config
      - /share/CACHEDEV1_DATA/{path_to_folder}/data:/opt/valheim
    ports:
      - "2456-2457:2456-2457/udp"
      - "9001:9001/tcp"
    env_file:
      - /share/CACHEDEV1_DATA/{path_to_folder}/valheim.env
    restart: always
    stop_grace_period: 2m
    deploy:
      resources:
        limits:
          cpus: '0.70'
          memory: 4gb

The most important part is /share/CACHEDEV1_DATA/{path_to_folder}/config. You need to replace {path_to_folder} with the folder path where you want to store data and configuration for your Valheim server.

Change your memory and cpu limit according to your available resources on QNAP. Current settings are 70% of single CPU and 4gb of RAM.

In this folder you need to create a file valheim.env to store configuration variables.

Example valheim.env:

SERVER_NAME=My Server
WORLD_NAME=Dedicated
SERVER_PASS=secret
SERVER_PUBLIC=true

Qnap Step 1

Qnap Step 2

Qnap Step 3

Updating image

Qnap update Step 1

Qnap update Step 2

In the image name you have to specify the image from the container definition lloesche/valheim-server.

Qnap update Step 3

After the image is downloaded restart the container. As you can see the old image is now unused and the new one is in use by the container. You can now safely delete the old image.

Qnap update Step 4

QNAP ZFS issue

We have had a report from a QNAP user where Steam failed when using ZFS as the backing filesystem with the following error

valheim-updater [ 0%] !!! Fatal Error: Steamcmd needs 250MB of free disk space to update.
valheim-updater src/tier0/threadtools.cpp (3553) : Assertion Failed: Illegal termination of worker thread 'Thread(0x0x58a1d8f0/0x0xf7780b'

This appears to be due to a bad Steam/ZFS interaction akin to this Steam bug where very large ZFS volumes get interpreted as very small due to bad overflow handling. There are two workarounds available. Use a non-ZFS volume, or set a quota on the volume, e.g.:

  1. Connect to the QNAP SSH console.
  2. Get the ZFS volume ID from within the container
df /opt/valheim | tail -n 1 | awk '{ print $1 }'
  1. Set the quota to 2TB or less from the QNAP SSH console:
zfs set quota=1TB "volume_id_here"

You could also try this one-liner from the SSH console:

CONTAINER="your_valheim_container name/id" \
  docker exec -t "$CONTAINER" df /opt/valheim | tail -n 1 | awk '{ print $1 }' | \
  xargs -I zfs_id sudo zfs set quota=1TB zfs_id

If you have access to a QNAP NAS running ZFS and can reproduce/debug this issue further, please open a new issue with your findings so we can update this section and provide more information here.

OpenMediaVault Help

Permission denied error

If you are running this container in Portainer on a OpenMediaVault NAS and getting the following error

valheim-server /usr/local/bin/valheim-server: line 110: /opt/valheim/server/valheim_server.x86_64: Permission denied

the cause is that the container's filesystem is mounted with the noexec flag. Meaning no files are allowed to be executed on that filesystem.

See this page for detailed information on how to disable noexec for newly created and existing filesystems.

For existing filesystems edit /etc/openmediavault/config.xml and remove the noexec option from the filesystem in question. The file should look something like this

OMV 1

License

Copyright 2021 Lukas Lösche

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Legal disclaimer

This Docker container is not endorsed by, directly affiliated with, maintained, authorized, or sponsored by Iron Gate Studio.
Valheim, Valheim dedicated server and the Valheim Logo are © 2021 Iron Gate Studio.

valheim-server-docker's People

Contributors

a-sala7 avatar adamlmark avatar addyvan avatar ajmwagar avatar armanatz avatar dahlo avatar dani20000 avatar dizeeee avatar fennyfatal avatar greyltc avatar gyran avatar jackthefragger avatar katanacrimson avatar lholst avatar lloesche avatar mmalyska avatar ndragon798 avatar nvllsvm avatar opello avatar roop90 avatar savedbygrace251 avatar schildbach avatar shawak avatar super-cooper avatar supportlik avatar thecatlady avatar thehades avatar wcdanh2 avatar wolveix avatar yostinso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

valheim-server-docker's Issues

Stage update for later reboot

Hello there,

I'm running a server using your container and it's working just fine, with just a minor possible improvement I will explain here:

The server is running 24/7 and I told my friends that every morning at ~05:30 the server will be restarted for maintenance, but I had the server restart itself this morning with the release of 0.146.8 (at 09:50 local time) without any prior warning and people were connected.

I understand that this is the default behaviour, but maybe this could be improved by adding a flag that would just stage the update, but not restart the valheim server, which will be taken care of by the daily restart.

This would help and manage users expectations (of course, if an update is released in the middle of the day, a manual action will be required to allow clients with the updated version to connect, but that's fine for me)

Thanks again for the nice work !

[Updater] Add option to remove "validate" from steamcmd command

I'm trying and experimenting with server binaries to reduce cpu usage while nobody is online, but every update check validates and redownloads modified binaries, but i also want auto update if new version of valheim server is released.
Would be awesome to disable "validate" from steamcmd command (new ENV variable?)

AWS CDK Template to deploy via ECS Fargate

I have thrown together a CDK template that deploys and runs this using ECS Fargate on AWS. I saw the post about the K8s config - any interest in sharing this as well on the readme for AWS users?

Feature Request: configurable restart interval for the game server

Just in case there's an issue with a memory leak or similar in some release of the dedicated server, could we get a configurable restart interval (every X days or something?) to stop & start the game server? obviously a value of 0 (which would be the 'default' if not specified) would not restart the game server ever

Volume Mapping with Docker-Compose

Hello,
I am looking to run up a server using your Container, firstly Kudos for the detailed instructions.
As I am familiar and already run several containers from a docker-compose file, I opted to run the server this way.
However, the volume mounts do not appear to work, and as such there is no persistence of files, and does not pull in my existing world. I am not sure if this is not supported when running this way? I have successfully used multiple services via a similar configuration. Help/input appreciated, and keep up the good work!

Updated to add:
Executing inside the Container shows a different set of files in the Config folder, presumably those that are created by the Server as it starts.

Docker Compose snippet included below.
valheim:
image: lloesche/valheim-server
container_name: valheim-serv
ports:
- 2456-2458:2456-2458/udp
environment:
- SERVER_NAME=[servername]
- WORLD_NAME=[worldname]
- SERVER_PASS=[password]
volumes:
- /valheim/config:/config
- /valheim/backups:/config/backups
- /valheim/worlds:/config/worlds
- /valheim/server:/opt/valheim_dl
restart: unless-stopped

Modify server to alleviate bandwidth throttling

This reddit comment and this response detail changes to the server that can be made to increase server network performance. Hopefully this is soon patched, but it would be nice to have until an update is published.

Implementation would require modifications to files after updates, so this may be out of the scope of this image. I wanted to bring it up as I have been getting experiencing network issues whenever we surpass 4 or 5 players.

password not being set

i have used the SERVER_PASS variable with no luck when spinning this up twice now. even removed special charicters on the password and just used lowercase and numbers and a password with all lower case letters and the server still wont take my password

World not saved on shutdown

When restarting/shutting down the container, valheim server is terminated and not gracefully closed -> world is not saved.
Log:

Shutting down Valheim Server with PID 78
Waiting for Valheim Server shutdown
/usr/local/bin/valheim-server: line 31: /opt/valheim/server_exit.drp: Permission denied
Waiting for Valheim Server shutdown
Waiting for Valheim Server shutdown
2021-02-11 09:37:47,845 INFO waiting for valheim-server to die
Waiting for Valheim Server shutdown
Waiting for Valheim Server shutdown
2021-02-11 09:37:50,850 INFO waiting for valheim-server to die
Waiting for Valheim Server shutdown
Waiting for Valheim Server shutdown
Waiting for Valheim Server shutdown
2021-02-11 09:37:53,854 INFO waiting for valheim-server to die
Waiting for Valheim Server shutdown

After this long waiting, container is terminated.

Possible to run on rPi4?

Hi,
I just tried running this container on an rPi4 and I'm getting the following error in the logs once it starts:
standard_init_linux.go:219: exec user process caused: exec format error

I'm using Portainer with this compose:

version: "2.1"
services:
valheim:
image: lloesche/valheim-server
container_name: myserv
environment:
- SERVER_NAME=myserv
- SERVER_PORT=2456
- WORLD_NAME=myserv
- SERVER_PASS=myserv
- SERVER_PUBLIC=1
- UPDATE_INTERVAL=86400
- BACKUPS_INTERVAL=3600
- BACKUPS_DIRECTORY=/config/backups
- BACKUPS_MAX_AGE=5
volumes:
- $HOME/valheim-server-config:/config
ports:
- 2456-2458:2456-2458/udp
restart: unless-stopped

Am I doing something wrong? Or is this just not intended for ARM/rPi?

Synology App hangs

I have followed the instructions to the letter, using a Synology DS1019+ Running the Latest official release firmware.
It hangs on the

DungeonDB Start 182 | stdout

After that it does another debug step but never continues. I can see it has created the world files, and the start_server.sh file is present as well as the adminlist, bannedlist, and permittedlist, and a prefs file. it just neter continues. even after letting it sit there for 30 minutes.

High CPU usage with no players connected

With no players connected to the server, my Docker container is running at high CPU:

CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
f32ddb31ba13        valheim             107.36%             1.62GiB / 15.34GiB    10.56%              0B / 0B             4.18GB / 10.9MB     46

The CPU is an older one (Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz), but the CPU usage is still too high for a server with no users on it.

I found this thread about high CPU usage, which only makes itself apparent on the Linux dedicated server.

Hopefully, the issue will be resolved in the dedicated server software itself, but I wanted to post the issue here as well, in case it can be solved with a configuration setting. One of the users on the linked thread (Marx) guesses that it may be related to a framerate configuration setting - could that setting be applied in the Docker image?

Mount volume for server files

It might make more sense to mount the volume of the server files as well instead of just the config folder. Currently, any time you have to recreate the container (changing env variables etc), it will redownload all server files.

I mapped this volume right now so I don't have to redownload when recreating the container:
./server:/opt/valheim

Add ddns support

In service of solving situations like #73 (comment)
where a user's server doesn't show up in the list of servers and the user has a dynamic IP address we should add ddns support to the container. It'll help those users tremendously.

Create Unraid Community Application

As per #80 it would be neat if an Unraid user would put in the work to make this available as a community application. I'd be willing to support them if there's any questions about the image or if any modification is required to make it work with Unraid.

Server "crashed" / stays at 1-3% CPU load (~5-10% normal)

Hey folks,

I just experience a strange thing.

I was logged into the game on my own server.
All of a sudden I got disconnected. Trying to reconnect ended up with "Inkompatible Version".
I checked my monitory and noticed the container CPU load droped to almost 0% (pending at 1-3% while its usually at around 10%).
Further I am not able to get the server running again. Restoring backups or even removing the world and get a fresh one does not work. The container start up looks fine. But after the CPU spike for start-up it always drops to 1-3% CPU load (I guess at this state the game is not actually running - leading to "Inkompatible Version".

I've also noticed stange backup size's right before the crash:

4.8M Feb 16 22:50 worlds-20210216-215034.zip
4.8M Feb 16 23:50 worlds-20210216-225034.zip
5.0M Feb 17 00:50 worlds-20210216-235035.zip
5.2M Feb 17 01:50 worlds-20210217-005035.zip
5.4M Feb 17 02:50 worlds-20210217-015036.zip
5.4M Feb 17 03:50 worlds-20210217-025037.zip
5.5M Feb 17 04:50 worlds-20210217-035037.zip
5.5M Feb 17 05:50 worlds-20210217-045038.zip
5.5M Feb 17 06:50 worlds-20210217-055039.zip
5.5M Feb 17 07:50 worlds-20210217-065040.zip
5.5M Feb 17 08:50 worlds-20210217-075040.zip
5.5M Feb 17 09:50 worlds-20210217-085041.zip
5.5M Feb 17 10:50 worlds-20210217-095042.zip
5.5M Feb 17 11:50 worlds-20210217-105043.zip
 11M Feb 17 11:59 worlds-20210217-105901.zip       <===
 164 Feb 17 12:08 worlds-20210217-110804.zip        <===
 164 Feb 17 12:12 worlds-20210217-111214.zip        <===
 11M Feb 17 12:20 worlds-20210217-112000.zip       <===
4.9M Feb 17 12:36 worlds-20210217-113648.zip

Doesn't matter which backup I choose, I end up as described above.

Desync/lag possible improvement

Hi, I am aware that this is more an issue of how Valheim is setup right now, but I do see some adjustments being made on the Steam forums that could help with the network issues and I was wondering if and how we could implement those changes on this image.
As you may be aware, you can adjust the data send rate of the server and clients to a higher value than the hardcoded 60kb/s, however this is done by editing a .dll assembly file of the game itself.
So, if we want to adjust the settings, I have no actual clue on how to do this, as the server is being downloaded on startup and is not statically provided, so we can't make a static change.
We could overwrite the downloaded file with a different prepared file, but this is not guaranteed to work over different versions and may cause other issues.
I do not know if we can edit it in place after it has been downloaded, I know I was able to edit my files locally with dnSpy
So, does anyone see a possibility where we can adjust this value? Preferably dynamically, as the value depends on the available upload bandwith available.

Flag to disable backups

Hi, More of a question than an issue.

Can you advise on a method to disable the automated backups in the container? I am using an externally managed backup solution and it feels redundant to have the container backing up as well as snapshotting the disk

Specify user and group ID

Is it possible to change the owning user and group of the container so root does not own everything?

This helps with mounted volumes not be root access level

Can't update the adminlist.txt

Hi!

Thanks for making this docker image! When I has added my id name on the adminlist.txt file, it's still not work for admin commands e.g /ban, /kick, how can i solve this?..
image

image

Valheim world resumes from fresh world seed.

After about 5 hours the docker server developed odd network connectivity issues and we were forced to stop it and restart it.
Things didn't go as expected as the correct world seed was loaded, but instead we loaded into a fresh world seed (new game).

Checking the world data folder, it contained.
world.db
world.db.backup
world.fwl

The world.db was around 150kb, and the .backup was around 30mb.
Backup files held the same files structure and contained a world.db and a .backup version.

Since I had backups, I removed the world.db and renamed the backup one. to just .db.
This restored the server. Exact same issue occurred with roll back to older versions.

Valheim is early access, I'm a n00b with Docker image experience, those two are combined are prone to cause issues.
Leaving me with the question:
Did I mess up the server configuration? Did I stumble upon a docker bug? Or is this an issues with Valheim game server...

Couldn't create a Convex Mesh from source mesh "RearBig" within the maximum polygons limit (256)

Hi,

I tried to launch the container with docker run -d --name valheim-server -p 2456-2458:2456-2458/udp -p 2456-2458:2456-2458 -v config:/config -e SERVER_NAME="myserver" -e WORLD_NAME="myworld" -e SERVER_PASS="mypassword" lloesche/valheim-server, but the server doesn't show up and at the end of the logs i have this :

2021-02-21 09:28:41,827 INFO spawned: 'valheim-server' with pid 71
Running Valheim Server
Found path: /opt/valheim/valheim_server.x86_64
Mono path[0] = '/opt/valheim/valheim_server_Data/Managed'
Mono config path = '/opt/valheim/valheim_server_Data/MonoBleedingEdge/etc'
Preloaded 'libsteam_api.so'
Initialize engine version: 2019.4.20f1 (6dd1c08eedfa)
[Subsystems] Discovering subsystems at path /opt/valheim/valheim_server_Data/UnitySubsystems
Forcing GfxDevice: Null
GfxDevice: creating device client; threaded=0
NullGfxDevice:
    Version:  NULL 1.0 [1.0]
    Renderer: Null Device
    Vendor:   Unity Technologies
Begin MonoManager ReloadAssembly
- Completed reload, in  0.067 seconds
UnloadTime: 1.641811 ms
02/21/2021 09:28:42: Starting to load scene:start

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

2021-02-21 09:28:43,272 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
valheim-server: ERROR (not running)
valheim-server: started
Couldn't create a Convex Mesh from source mesh "RearBig" within the maximum polygons limit (256). The partial hull will be used. Consider simplifying your mesh.
(Filename:  Line: 91)

How can I fix it?

Azure contianer instance - possible to use same directory for both volumes?

I was playing with deploying this to azure and got it to work (awesome) but apparently it's not possible to mount to a sub-directory of a fileshare on Azure. Question was asked here.

Would it cause a problem if /config and /opt/valheim were mapped to the same directory?

End up with a fileshare that looks like this.
image

My deployment script for reference.

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "variables": {
        "container1name": "valheim-server",
        "container1image": "lloesche/valheim-server"
    },
    "resources": [
        {
            "name": "valheim-server",
            "type": "Microsoft.ContainerInstance/containerGroups",
            "apiVersion": "2019-12-01",
            "location": "[resourceGroup().location]",
            "properties": {
                "containers": [
                    {
                        "name": "[variables('container1name')]",
                        "properties": {
                            "image": "[variables('container1image')]",
                            "resources": {
                                "requests": {
                                    "cpu": 2,
                                    "memoryInGb": 3
                                }
                            },
                            "environmentVariables": [
                                {
                                    "name": "SERVER_NAME",
                                    "value": "servername"
                                },
                                {
                                    "name": "SERVER_PASS",
                                    "value": "password",
                                    "secureValue": "true"
                                }
                            ],
                            "ports": [
                                {
                                    "port": 2456,
                                    "protocol": "UDP"
                                },
                                {
                                    "port": 2457,
                                    "protocol": "UDP"
                                },
                                {
                                    "port": 2458,
                                    "protocol": "UDP"
                                }
                            ],
                            "volumeMounts": [
                                {
                                    "name": "volume1",
                                    "mountPath": "/config"
                                },
                                {
                                    "name": "volume2",
                                    "mountPath": "/opt/valheim"
                                }
                            ]
                        }
                    }
                ],
                "osType": "Linux",
                "ipAddress": {
                    "type": "Public",
                    "ports": [
                        {
                            "port": 2456,
                            "protocol": "UDP"
                        },
                        {
                            "port": 2457,
                            "protocol": "UDP"
                        },
                        {
                            "port": 2458,
                            "protocol": "UDP"
                        }
                    ],
                    "dnsNameLabel": "valheim-dedicated-1"
                },
                "volumes": [
                    {
                        "name": "volume1",
                        "azureFile": {
                            "shareName": "valheimfileshare",
                            "storageAccountName": "gamingserverstorage",
                            "storageAccountKey": "<KEY>"
                        }
                    },
                    {
                        "name": "volume2",
                        "azureFile": {
                            "shareName": "valheimfileshare",
                            "storageAccountName": "gamingserverstorage",
                            "storageAccountKey": "<KEY>"
                        }
                    }
                ]
            }
        }
    ]
}

Stuck after a few hours

Running my server on a windows machine with docker for windows

My game world gets stuck after a few hours of playing and it kicks me off with a disconnect message, Afterwhich I can connect to the server, but it asks for no password (its password protected) and all I see is a black screen, not even the loading icon.

I have to restart the docker container for it to "work". And I say "work" because after the restart, everything I've ever built is gone and I have to grab a backup and use that.

I'm not sure why this is happening, either my world is corrupt or my character is.

Anyone else having this issue?

Stuck in "Valheim Server is not yet downloaded - waiting"

I pulled the Docker image yesterday, and since then the server will not start. It gets stuck with the message "Valheim Server is not yet downloaded - waiting", from which it never continues.

...
Removing backups older than 3 days
Waiting 3600 seconds before next backup run
Redirecting stderr to '/root/Steam/logs/stderr.txt'
[  0%] Checking for available updates...
[----] Verifying installation...
[  0%] Downloading update...
[  0%] Checking for available updates...
[----] Download complete.
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Extracting package...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Installing update...
[----] Cleaning up...
[----] Update complete, launching Steamcmd...
Redirecting stderr to '/root/Steam/logs/stderr.txt'
[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
Loading Steam API...OK.

Connecting anonymously to Steam Public...Logged in OK
Waiting for user info...OK
 Update state (0x3) reconfiguring, progress: 0.00 (0 / 0)
Error! App '896660' state is 0x202 after update job.
.d..t...... ./
Valheim Server is already the latest version
2021-02-24 07:49:12,138 INFO spawned: 'valheim-server' with pid 74
Valheim Server is not yet downloaded - waiting
2021-02-24 07:49:13,151 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
valheim-server: started
Valheim Server is not yet downloaded - waiting
Valheim Server is not yet downloaded - waiting
Valheim Server is not yet downloaded - waiting
Valheim Server is not yet downloaded - waiting
Valheim Server is not yet downloaded - waiting
Valheim Server is not yet downloaded - waiting
...

I don't know if this is caused by the changes in this docker image (when I pulled yesterday, I hadn't done so for a while) or if there is a remote problem.

Server requires 5 character password

I noticed my valheim server would be caught in a startup error loop, if the chosen password is too short.
It took me a while to figure this out. I've opened this issue in case someone else runs into this problem.
Valheim seems to expect at least 5 characters for the server password.

2021-02-10 18:37:58,636 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
WARNING: Shader Unsupported: 'Autodesk Interactive' - All passes removed
WARNING: Shader Did you use #pragma only_renderers and omit this platform?
HDR Render Texture not supported, disabling HDR on reflection probe.
(Filename: Line: 277)

HDR Render Texture not supported, disabling HDR on reflection probe.
(Filename: Line: 277)

Unloading 6 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 6.205986 ms
Only custom filters can be played. Please add a custom filter or an audioclip to the audiosource (Amb_MainMenu).
(Filename: Line: 509)

HDR Render Texture not supported, disabling HDR on reflection probe.
(Filename: Line: 277)

Initializing Google Analytics 0.2.
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/10/2021 18:38:08: Initializing world generator seed: ( 0 ) menu:True worldgen version:1

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/10/2021 18:38:08: Using mountain distance: 1000

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/10/2021 18:38:08: Render threading mode:SingleThreaded

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/10/2021 18:38:08: Get create world Default

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/10/2021 18:38:08: Loaded localization English

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/10/2021 18:38:08: Error bad password:The password is too short

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/10/2021 18:38:08: Missing audio clip in music respawn

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/10/2021 18:38:08: Builder started

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Unloading 16 unused Assets to reduce memory usage. Loaded Objects now: 85928.
Total: 87.753374 ms (FindLiveObjects: 10.197371 ms CreateObjectMapping: 15.702577 ms MarkObjects: 61.427806 ms DeleteObjects: 0.421070 ms)

I've started the container with the following arguments.

docker run -d \ --name valheim-server \ -p 2456-2458:2456-2458/udp \ -v $HOME/valheim/config:/config \ -e SERVER_NAME="My Server" \ -e WORLD_NAME="Default" \ -e SERVER_PASS="test" \ lloesche/valheim-server

Server only discoverable on port 2457

When I rely on the default env var (or manually supply SERVER_PORT: 2456), the server seems to only be discoverable on steam at port 2457. My server isn't showing up in the server lists either, and I suspect the issues are related. This may not be a problem with this image, but I had noticed other users experiencing the same issue:

#26 (comment)

Option to have data volume in a custom location

currently the server data volume seem to be located in dockers volumes. I like to keep container data located in 1 spot. any way we could add an option to have have the data volume customized so I can put it where I want

Saving causes server to disconnect, sometimes lost progress?

Periodically we disconnected after a blinking connection icon in the top left. Sometimes we seem to lose progress in the world.

No clue what it was, did a bit of debugging, now I can manually reproduce the issue by opening the console, manually saving, client disconnects.

Container: latest/49c71d4e4253

See attached logs.

02/22/2021 23:27:06: clone 1018
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/22/2021 23:27:10: Saved 331406 zdos
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/22/2021 23:27:10: World saved ( 4211.948ms )
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

/usr/local/bin/valheim-server: line 28:  2201 Killed                  "$valheim_server" -nographics -batchmode -name "$SERVER_NAME" -port $SERVER_PORT -world "$WORLD_NAME" -password "$SERVER_PASS" -public $SERVER_PUBLIC
2021-02-22 23:27:42,916 INFO exited: valheim-server (exit status 0; expected)
2021-02-22 23:27:43,948 INFO spawned: 'valheim-server' with pid 2372
Running Valheim Server
Found path: /opt/valheim/valheim_server.x86_64
Mono path[0] = '/opt/valheim/valheim_server_Data/Managed'
Mono config path = '/opt/valheim/valheim_server_Data/MonoBleedingEdge/etc'
Preloaded 'libsteam_api.so'
Initialize engine version: 2019.4.20f1 (6dd1c08eedfa)
[Subsystems] Discovering subsystems at path /opt/valheim/valheim_server_Data/UnitySubsystems
Forcing GfxDevice: Null
GfxDevice: creating device client; threaded=0
NullGfxDevice:
    Version:  NULL 1.0 [1.0]
    Renderer: Null Device
    Vendor:   Unity Technologies
Begin MonoManager ReloadAssembly
- Completed reload, in  0.069 seconds
UnloadTime: 1.211916 ms
02/22/2021 23:27:44: Starting to load scene:start
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

Couldn't create a Convex Mesh from source mesh "RearBig" within the maximum polygons limit (256). The partial hull will be used. Consider simplifying your mesh. 
(Filename:  Line: 91)

2021-02-22 23:27:45,455 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
HDR Render Texture not supported, disabling HDR on reflection probe. 
(Filename:  Line: 277)

HDR Render Texture not supported, disabling HDR on reflection probe. 
(Filename:  Line: 277)

Unloading 6 Unused Serialized files (Serialized files now loaded: 0)
UnloadTime: 5.141160 ms
Only custom filters can be played. Please add a custom filter or an audioclip to the audiosource (Amb_MainMenu). 
(Filename:  Line: 509)

HDR Render Texture not supported, disabling HDR on reflection probe. 
(Filename:  Line: 277)

02/22/2021 23:27:54: Initializing world generator seed: ( 0 )   menu:True  worldgen version:1
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/22/2021 23:27:54: Using mountain distance: 1000
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/22/2021 23:27:54: Render threading mode:SingleThreaded
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/22/2021 23:27:54: Get create world xxxxxxxxx
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/22/2021 23:27:54: Using environment steamid 892970
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/22/2021 23:27:54: Using steam APPID:xxxxxxxxx
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

CAppInfoCacheReadFromDiskThread took 3 milliseconds to initialize
CApplicationManagerPopulateThread took 0 milliseconds to initialize (will have waited on CAppInfoCacheReadFromDiskThread)
RecordSteamInterfaceCreation (PID 2373): SteamGameServer012 / GameServer
RecordSteamInterfaceCreation (PID 2373): SteamUtils009 / Utils
Setting breakpad minidump AppID = xxxxxxxxx
RecordSteamInterfaceCreation (PID 2373): SteamGameServer012 / GameServer
RecordSteamInterfaceCreation (PID 2373): SteamUtils009 / Utils
RecordSteamInterfaceCreation (PID 2373): SteamNetworking005 / Networking
RecordSteamInterfaceCreation (PID 2373): SteamGameServerStats001 / GameServerStats
RecordSteamInterfaceCreation (PID 2373): STEAMHTTP_INTERFACE_VERSION002 / HTTP
RecordSteamInterfaceCreation (PID 2373): STEAMINVENTORY_INTERFACE_V002 / Inventory
RecordSteamInterfaceCreation (PID 2373): STEAMUGC_INTERFACE_VERSION010 / UGC
RecordSteamInterfaceCreation (PID 2373): STEAMAPPS_INTERFACE_VERSION008 / Apps
02/22/2021 23:27:54: Server ID 123
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/22/2021 23:27:54: Steam game server initialized
 
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

02/22/2021 23:27:54: Missing audio clip in music respawn

Option to disable updater

Thanks for your work on this, seems to work great for now.

I have a small enhancement request (not realls familar with docker, otherwise I'd submit a PR): Can you add a flag to disable the updater alltogether? From what I understand at the moment it will run once on each start, there is no way to disable it (even if increasing the interval, it will execute once on server start).

Use case: I'd like the server to run with a modified assembly_valheim.dll (which has m_dataPerSec increased to combat the lagging), but the modified dll gets purged by the updater (for obvious reasons) on each start.

Clarify the actual effects of `-nographics -batchmode` from PR #21

In PR #21 we added two CLI options to the server.

Can we have someone knowledgeable in Unity Game development clarify the exact effect of running the server with

-nographics -batchmode

The PR says This leads to 10% less CPU usage and less desync lag on my server. Before merging I tested the option and while I did not see any effect on my CPU usage I also did not see any adverse effect so approved the PR. But I am unclear on what exactly it does from a technical point of view.

My research found the following information: https://docs.unity3d.com/Manual/CommandLineArguments.html

Command Detail
-batchmode Run Unity in batch mode. In batch mode, Unity runs command line arguments without the need for human interaction. It also suppresses pop-up windows that require human interaction (such as the Save Scene window); however, the Unity Editor itself opens as usual. You should always run Unity in batch mode when using command line arguments, because it allows automation to run without interruption. When an exception occurs during execution of the script code, the Asset server updates fail, or other operations fail, Unity immediately exits with return code 1. Note that in batch mode, Unity sends a minimal version of its log output to the console. However, the Log Files still contain the full log information. You cannot open a project in batch mode while the Editor has the same project open; only a single instance of Unity can run at a time. To check whether the Editor or Standalone Player is running in batch mode, use the Application.isBatchMode operator.
-nographics When you run this in batch mode, it does not initialize the graphics device. You can then run automated workflows on machines that don’t have a GPU. Automated workflows only work when you have a window in focus, otherwise you can’t send simulated input commands. -nographics does not allow you to bake GI as Enlighten requires GPU acceleration.

Those however are Unity Engine options not Valheim specific options. So I'd be interested to learn from someone who works with Unity as to what the exact effects - if any - of supplying these options to the Valheim Linux server are.

Server crashes on connect with missing cert error

We just updated to the latest version of Valheim and now the server crashes every time we try to connect with the following error (in the logs):

valheim | src/steamnetworkingsockets/clientlib/steamnetworkingsockets_p2p.cpp (338) : Assertion Failed: GetState() == k_ESteamNetworkingConnectionState_ProblemDetectedLocally
valheim | src/steamnetworkingsockets/clientlib/steamnetworkingsockets_connections.cpp (2473) : Assertion Failed: [#4142063336 P2P steamid:76561197984411869] problem (5002) We don't have cert, and self-signed certs not allowed, but connection already dead (0 5002 We don't have cert, and self-signed certs not allowed)

We're running the docker image within an Azure VM.

sharing k8s config

I made a basic kubernetes config using this docker setup: https://github.com/Addyvan/valheim-k8s

It's currently working great on my homelab!

The setup is currently somewhat specific to my hardware / homelab but could easily be templated to fit with various cluster environments.

I figured I'd reach out and ask if you'd like the repo added to the README as deploying the container to kubernetes adds a later of persistence / safety.

Feature Request: timezone configuration via env variable

With the new scheduled restart, it'd be nice to be able to configure the timezone the server is running in via an environment variable passes to the container (I'm not sure if there is an existing 'standard' ENV all docker containers have like -TZ or if has to be exposed intentionally).

No game listed in steam server list

Hi!

Thanks for making this! When I run the container and wait for the server to be downloaded etc. it does show up in the steam server list but it doesn't list what game it is and in Valheim I don't see the server at all.

Would you maybe know how to fix this?

Force world save before shutdown/restart

We discovered the hard way that restarting the Docker container will cause a rollback of the server world (20 minutes?) because it appears to only save the state on a periodic cadence.

Is there a way to manually force a save before executing a restart? Or, can I otherwise bring down the container in a way that will trigger a save?

A game "cheat" exists to perform a save, but I read that it doesn't work, and cheats allegedly can't be executed on a multiplayer server anyway?

Thanks!

Server is still not visible

Hi, first - thx for this wonderful container! Server is running perfectly for more than 8h now and updates/backups are working fine.

But Ive got a problem to make this server visible in the community browser... also tried to set SERVER_PUBLIC 1 to get sure, but still cant find it in Valheim or Steam Server browser. I saved it via favorite server in Steam and its working this way, but it would be wonderful if I could make it visible directly too... any ideas?!

Thx in advance...
Dahmos

Oder ist das noch dem EA geschuldet?

Server no longer accepts connections after long period of inactivity

I'm running the container on docker for desktop and while it seems to run ok most of the time after a long period of inactivity (computer is left to idle) it will no longer accept connections.

Looking at the container log shows no abnormal output that I can tell.

Attaching a log were server didn't allow connection and was restarted at around 21h18.
_valheim-server_logs.txt

edit: forgot to mention that i've read previous issues that indicated resource starvation could be a cause of problems so monitoring memory and cpu usage on the server.

Env vars DNS_1 and DNS_2 only work for containers started using the systemd unit

The documentation lists DNS_1 and DNS_2 as environment variables used to determine which DNS servers are used by the server inside the container. This currently only works for containers started using the systemd unit file. When running the container on say a Synology NAS or basically any environment other than the one described the variables have no effect.

We should either document this behavior or fix it.

problems running on azure; 15min startup for unlisted instance

Thanks for the docker container here! I played a bunch on a friends hosted machine, he had to go but I wanted to keep playing, this got me thinking it would be nice to host our game on a dedicated machine.

So I'm trying to get it running in an azure container. My config:

name: valheim-group 
apiVersion: '2019-12-01'
properties: 
  osType: Linux
  restartPolicy: Never
  
  containers:
  - name: valheim
    properties: 
      image: lloesche/valheim-server
      ports: 
      - protocol: udp
        port: 2456
      - protocol: udp
        port: 2457
      - protocol: udp
        port: 2458
      - port: 27015 
      resources:
        requests:
          cpu: 1.0
          memoryInGB: 8.0
      volumeMounts:
      - mountPath: /config
        name: valheim-volume
      environmentVariables:
      - name: SERVER_NAME
        value: grooserver
      - name: WORLD_NAME
        value: groorld
      - name: SERVER_PASS
        value: xxxxxxxx

  ipAddress:
    type: Public
    ports:
    - protocol: udp
      port: 2456
    - protocol: udp
      port: 2457
    - protocol: udp
      port: 2458
    - port: 27015 
    dnsNameLabel: groostav-valheim
  
  volumes:
  - name: valheim-volume
    azureFile:
      sharename: groostav-valheim-fs
      storageAccountName: empoweropsstorage
      storageAccountKey: l5xxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx==

an azure container create with the above file yields some fairly promising output:

2021-02-15 07:30:04,517 INFO Set uid to user 0 succeeded
2021-02-15 07:30:04,525 INFO RPC interface 'supervisor' initialized
2021-02-15 07:30:04,525 INFO supervisord started with pid 1
2021-02-15 07:30:05,528 INFO spawned: 'valheim-updater' with pid 10
2021-02-15 07:30:05,530 INFO spawned: 'valheim-backup' with pid 11
Running Valheim Server updater as user root uid 0
Backing up Valheim server worlds to /config/backups/worlds-20210215-073005.zip
Updating/Validating Valheim Server
  adding: worlds/ (stored 0%)
  adding: worlds/groorld.db (deflated 51%)
  adding: worlds/groorld.fwl (deflated 5%)
Removing backups older than 3 days
Waiting 3600 seconds before next backup run
2021-02-15 07:30:06,852 INFO success: valheim-updater entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-02-15 07:30:06,852 INFO success: valheim-backup entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
...
Steam Console Client (c) Valve Corporation
-- type 'quit' to exit --
Loading Steam API...OK.
...
Success! App '896660' fully installed.
>f+++++++++ LinuxPlayer_s.debug
...
Valheim Server was updated - restarting
2021-02-15 07:31:39,588 INFO spawned: 'valheim-server' with pid 78
Running Valheim Server
Found path: /opt/valheim/valheim_server.x86_64
Mono path[0] = '/opt/valheim/valheim_server_Data/Managed'
Mono config path = '/opt/valheim/valheim_server_Data/MonoBleedingEdge/etc'
Preloaded 'libsteam_api.so'
Initialize engine version: 2019.4.16f1 (e05b6e02d63e)
[Subsystems] Discovering subsystems at path /opt/valheim/valheim_server_Data/UnitySubsystems
Forcing GfxDevice: Null
...
2021-02-15 07:31:41,070 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
valheim-server: ERROR (not running)
valheim-server: started
02/15/2021 07:31:50: Initializing world generator seed: ( 0 )   menu:True  worldgen version:1
...
02/15/2021 07:31:52: Remaining mountains:68
...
02/15/2021 07:31:57: Removing 1225882809
02/15/2021 07:31:57: Removing 404029124
02/15/2021 07:31:57: Audioman already exist, destroying self
Unloading 490 unused Assets to reduce memory usage. Loaded Objects now: 86244.
Total: 69.662500 ms (FindLiveObjects: 4.257700 ms CreateObjectMapping: 3.285200 ms MarkObjects: 60.131100 ms  DeleteObjects: 1.984400 ms)
02/15/2021 07:32:01: Zonesystem Start 233
02/15/2021 07:32:01: DungeonDB Start 233
02/15/2021 07:42:02:  Connections 0 ZDOS:81  sent:0 recv:0
...

after which the updater and some steam related daemon continue to occasionally produce output.

But my server is never listed, nor is it anything other than "not responding" from the steam servers list


Some questions:

  1. what exactly appears in the server list? Your readme mentions that you should "filter", but should I simply filter by server name? is the SERVER_NAME environment parameter something that valheim uses in its filter?
  2. why did DungeonDB take 10 minutes to run? Is this normal? Is typical valheim startup time 10-15 minutes?
  3. are there any ports other than 2456-2348 that we need? You can see I opened 27015 when looking at some steam help pages, but that hasn't solved any problems. When I add a server on the steam server page, how does my steam client reach out to that server?

Any help is appreicated

sudden issues with performance

Error seen is constant in the log.

src/steamnetworkingsockets/clientlib/steamnetworkingsockets_lowlevel.cpp (1276) : Assertion Failed: SDR service thread gave up on lock after waiting 55ms. This directly adds to delay of processing of network packets! stdout

started very recently in the last 24 hours id say resulting in major lag and rubber banding along with multiple sudden kicks from server .

Trim Waste information from console log?

Hey folks,

Not sure if its something that can be fixed or filtered out via docker but is it possible to remove the following line from the console log, to make reading logs a little less eye melting ? :) More for just QoL

(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35) Repeated after every console log
image

Server does not display in Valheim server browser

As the title, I've started the server and seen 02/19/2021 01:48:34: Game server connected
I can connect directly via IP, and I can see the server in the Stream server browser, but the server does not appear in the Valheim game server browser.

version: "3.5"

services: 

  valheim: 
    container_name: "game_valheim"
    image: lloesche/valheim-server
    volumes: 
      - ./valheim:/config
    ports: 
      - "2456-2458:2456-2458/udp" 
    environment: 
      SERVER_NAME: "My Server name Here"
      SERVER_PASS: password
      SERVER_PUBLIC: 1
      WORLD_NAME: "WorldName"
      UPDATE_INTERVAL: 1800
      SERVER_PORT: 2456
      DNS_1: 8.8.8.8
      DNS_2: 8.8.4.4

'Valheim Server is not yet downloaded - waiting' Issue

I am stuck in a never ending loop of 'Valheim Server is not yet downloaded - waiting.' I am running the container on a synology NAS, and am wondering if there is something I may be doing wrong. I previously had a server running using this container but have had issues post update.

Valheim Server is already the latest version                                                                             
2021-02-21 17:52:46,055 INFO spawned: 'valheim-server' with pid 54                                                       
Valheim Server is not yet downloaded - waiting                                                                           
2021-02-21 17:52:47,066 INFO success: valheim-server entered RUNNING state, process has stayed up for > than 1 seconds (s
tartsecs)                                                                                                                
valheim-server: started                                                                                                  
Valheim Server is not yet downloaded - waiting 
Valheim Server is not yet downloaded - waiting 

Server auto update didn't detect latest update

I have the server running since yesterday, it's working great; thank you for your work :D.

However this morning there was a Valheim update that didn't get picked up. I checked the containers logs and /root/Steam/logs/stderr.txt but nothing out of the ordinary. The update script just said that it was the latest version. However when a client tried to connect there was a version mismatch.

I worked around this by recreating the container, the new container then went ahead and downloaded the latest version.

Unable to connect to private server

Hey guys,

I am trying to connect to my own Valheim server - unfortunately not working yet.
I am using the docker image of this repository.
Docker start command: docker run -d --name valheim-server -p 2456-2458:2456-2458/udp -p 2456-2458:2456-2458/tcp -v /home/nexlo/valheim-config:/config -e SERVER_NAME="NexloTest" -e WORLD_NAME="Neotopia" -e SERVER_PASS="secret" <image-path>
My server gets listed here: https://southnode.net/steamquery.php
If I start the same image locally, I am able to connect locally. Remote I only get the server listed (via port 2457) but unable to connect.
Host-Native OS is Debian10

Any suggestions? What do I miss? Thanks in advance! :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.