Skip to content

experimental Docker file to run a Valheim server on an ARM Architecture

Notifications You must be signed in to change notification settings

C0nvert/arm_valheim

 
 

Repository files navigation

ARM Valheim

Experimental Docker file to run a Valheim server on ARM

The valheim.Dockerfile is based on the stardart repositories of box86 and box64.

Compiled image:

You can find in the docker hub the image to run directly: https://hub.docker.com/repository/docker/tranko/pi4valheim

Requeriments:

Raspberry Pi4: I only tested on a 8GB of RAM with the next requirements:

  • RaspianOs 64 Bits updated.
  • Upgrade the distribution to Debian BullsEye (change the repositories to):
deb http://deb.debian.org/debian           bullseye          main contrib non-free
deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb http://deb.debian.org/debian           bullseye-updates  main contrib non-free

Then run the typical upgrade of Debian:

sudo apt update & sudo apt upgrade & sudo apt dist-upgrade
  • Install Podman v3.3.1 (The version that is in the Debian repository is old (3.0.1) and it does not work correctly in my case).
  • Install Docker (Tested on version 20.10.9)

Create the image (it will take around 1-2 hours)

If you have a Raspberry Pi4

If you use podman:

podman build -f valheim.Dockerfile
podman image tag c44a18e4e67d valheim-base:v1

If you use docker:

docker build --no-cache --tag valheim-base -f Valheim.dockerfile .

if you have a ODROID N2/N2+

If you use podman:

podman build -f valheim.dodroidn2.Dockerfile
podman image tag c44a18e4e67d valheim-base:v1

If you use docker:

docker build --no-cache --tag valheim-base -f valheim.dodroidn2.Dockerfile .

Execute the container

First step configure the env.world file:

This values don't be changed. Only if they change in the future:

STEAMAPPID=892970
BOX64_LD_LIBRARY_PATH=./linux64:/root/steam/linux32:$BOX64_LD_LIBRARY_PATH
BOX64_LOG=1
BOX64_TRACE_FILE=/root/valheim_data/output.log
BOX64_TRACE=1

This values are the real ones for yoru server:

PUBLIC=0                        # 0 private / 1 public
PORT=2456                       # Don't change if don't know what are you doing. 
NAME=YourServerName             # Your amazing name of your server.
WORLD=YourWorldName             # Your unique name of your world.
SAVEDIR=/root/valheim_data      # Where to save your data.
PASSWORD=YourUniquePassw0rd     # You can leave blank and it will not have password
                                # NOT recommended for public servers.

Second step, run the container (example with Docker):

docker run --rm --name valheim -p 2456-2457:2456-2457/udp -v /valheim_data:/root/valheim_data:rw --env-file env.world valheim-base

Patch Steamworks:

  1. Open assembly_valheim in "..\valheim_server_Data\Managed"
  2. Find Class (inside {}) "SteamManager"
  3. Find Row 93 and insert "Enviroment.SetEnviromentVariable("SteamAppId", "480")"

Considerations:

Pi4 has a limited hardware, it this is emulating x86_64 over arm64, so don't expect so high performance. It works, I didn't have any problems playing some hours. When the game saves it freeze all connections during some seconds, take it into account!!!!! Several times it does not start correctly and fail (the emulator is not yet finished and it does not work all the times). In that cases, you need to stop the process killing the process.

This experiment has been able to be done thanks to the following open source projects:

About

experimental Docker file to run a Valheim server on an ARM Architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 57.3%
  • Dockerfile 42.7%