Valheim is a game that’s taking the world by storm! It’s a video game that may not look like much at first glance, but it can become quite addictive. First released on 2nd February 2021, the game became a huge success by selling at least 5 million copies after the first month and hundreds of thousands of concurrent players on Steam.
The game itself has five simple rules to follow. The goal is to collect as many orbs as possible before time runs out. There are power-ups to help you along the way, but make sure you don’t collect any negative ones because they will slow you down, deplete your life meter, or even kill you! It’s all too easy to play Valheim for hours on end without realizing it because of how addicting it can be.
Even though you can play this game solo and still have a good time, playing with friends is the real deal! And here is where the Raspberry Pi comes in. Like the previous post on Setting up a Minecraft Server on a Raspberry Pi, this article will give you a step-by-step guide on setting up a Valheim Server on the Raspberry Pi. However, the method will be slightly different because of the two main challenges discussed below.
Challenges of running a Valheim dedicated server on Raspberry Pi
- The Valheim server is 64 bit. That shouldn’t be a challenge if you use a newer Raspberry Pi board like Raspberry Pi 4, which supports 64 bit operating systems and applications. Therefore, this tutorial won’t work for you if you own a 32-bit Raspberry Pi board. Some boards which support 64-bit OS include Pi 3, Pi 4, Pi Zero 2.
- Valheim Server is x86, while the Pi is ARM. That is one of the biggest challenges we will tackle in this post. Today, two significant architectures power most of the world’s computers: x86 and ARM. x86 is the more familiar architecture created by Intel, and it powers PCs and laptops. ARM processors were initially designed for mobile phones and tablets. It might sound impossible to run an x86 application on ARM architecture – but it’s not. Please read on.
Requirements
- A Raspberry Pi Board with support for a 64-bit operating system
- Micro SD Card
- A reliable power supply
- An active internet connection (we highly recommend using ethernet)
Set up your Raspberry Pi for Valheim Server
Before diving into the technical part, there are a few things that we need to set up.
- Install the official Raspberry Pi OS.
- We highly recommend running the Pi headless (without a monitor) for maximum resource utilization. To do so, you need to set up SSH access. Please take a look at our step-by-step guide on setting up SSH on your Raspberry Pi.
After doing everything detailed above, you can now dive into setting up Valheim Server on your Raspberry Pi.
Install x86 and x64 emulators
To install Valheim Server on our Pi, we will use a utility known as SteamCMD. SteamCMD is a command-line version of Steam, and it is used for installing and updating games on servers. It only works with servers that have been authorized, meaning you need to log in with a Steam account before it works.
SteamCMD requires us to install “box86” on our Raspberry Pi. Box86 is an emulator that enables users to run x86 packages on an ARM device like the Raspberry Pi. Follow the instructions below.
Install Box6 on Raspberry Pi
1. Update your system by running the commands below.
sudo apt update sudo apt upgrade
2. Next, we need to install the necessary packages for compiling and building the box86 app. We will also install git, which will enable us to clone the box86 GitHub repository. Execute the command below to install cmake and build-essentials.
sudo apt install git build-essential cmake

Install Build-essentials
3. To clone the box86 GitHub repository, execute the command below.
git clone --branch "v0.2.2" https://github.com/ptitSeb/box86

Clone Box86 Repository
4. Since we are running a 64-bit operating system, we need to install the 32-bit ARM (armhf) and the required packages to run a multi-arch system. Execute the commands below.
sudo dpkg --add-architecture armhf sudo apt update sudo apt install gcc-arm-linux-gnueabihf libc6:armhf libncurses5:armhf libstdc++6:armhf

Install armhf packages
5. Up to this point, we are now ready to compile the box86 emulator. To get started, navigate into the cloned repository and create a new directory to put our x86 builds. Use the commands below.
cd box86 mkdir build cd build
6. Execute the CMAKE command inside the build directory to start the building process.
– (For Raspberry Pi 4 64-Bit)
cmake .. -DRPI4ARM64=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo

Compile box86
– (For Raspberry Pi 3)
cmake .. -DRPI3=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
– (For Raspberry Pi 2)
cmake .. -DRPI2=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo
7. The above process might take a while to complete. When done, execute the command below to start the compilation process. Execute the command below.
make -j$(nproc)

Make Command
8. When done, execute the command below to install the box86 emulator.
cd

Install Box86
9. To finalize the setup, restart the systemd-binfmt service and reboot the system. That enables the system to know of the newly added binary formats. Execute the command below.
sudo systemctl restart systemd-binfmt sudo reboot now
Restart the binfmt service
Install Box64 On Raspberry Pi
After successfully installing the box86 for SteamCMD, we need to install box64 required to run the Valheim server on the Raspberry Pi. Follow the steps below.
1. Install the necessary packages for compiling and building the box86 app. We will also install git, which will enable us to clone the box86 GitHub repository. Then, execute the command below to install cmake and build-essentials.
sudo apt install git build-essential cmake

Install Build-essentials
2. Next, clone the Box64 repository with the command below.
git clone https://github.com/ptitSeb/box64.git
3. To start the building process, navigate to the newly created box64 directory and create a new folder called build to hold our build files. Execute the commands below.
cd box64 mkdir build cd build cmake .. -DRPI4ARM64=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo

Build box64
4. When done, execute the make command below to compile and install the box64 package
make -j4 sudo make install
After successfully installing Box64 and Box86 on your Pi, we can now install the Valheim server.
Set up SteamCMD on Raspberry Pi
As stated above, we will use SteamCMD to set up and install Valheim on our system. To get started, create a directory to store the SteamCMD package, and we will call it “SteamCMD” for this particular post. Execute the commands below.
cd ~ mkdir SteamCMD cd SteamCMD

Setup Steam
Now that we have created our SteamCMD directory, we can download the SteamCMD package. We will use the wget command as shown below.
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
After a successful download, you will notice that the SteamCMD package is compressed in a tar.gz format. To extract it, execute the command below.
tar -xzvf steamcmd_linux.tar.gz

Download SteamCMD
When you run the ls command after extracting the files, you will see a new file called “steamcmd.sh.” Execute this script as shown below to verify whether the SteamCMD package is working correctly.
chmod +x steamcmd.sh ./steamcmd.sh
The SteamCMD package will update and install any additional dependencies.

Verify SteamCMD
Note: If you come across like “steamcmd.sh: line 37: /opt/steamcmd/linux32/steamcmd: cannot execute binary file: Exec format error,” you need to check your Box86 installation. As of writing this post, the latest release of Box86 master version code has some issues running on Raspberry Pi 4. We highly recommend cloning an earlier version from a different branch, as we did for this post.
Install Valheim Dedicated Server
Up to this point, you are all set and ready to install the Valheim server on your Raspberry Pi. Next, we will use the SteamCMD tool to download the Valheim server from the Steam library. Follow the steps below.
1. Navigate to the directory where you downloaded the Steam package. If you followed this post to the latter, that should be the “SteamCMD” directory we created on our home directory.
cd /home/pi/SteamCMD/
2. Execute the command below to download the Valheim server using the SteamCMD tool.
./steamcmd.sh +@sSteamCmdForcePlatformType linux +login anonymous +force_install_dir /home/pi/valheim_server +app_update 896660 validate +quit

Download Valheim Server
Let’s go through all the arguments in this command:
-
./steamcmd.sh: Here, we are invoking the SteamCMD tool that we will use to download Valhei from the Steam library.+@sSteamCmdForcePlatformType linux: Even though this parameter looks confusing, it simply means we are downloading a package that will run on Linux and not other operating systems like Windows or macOS.+login anonymous: This parameter allows us to login into the Steam library without as an anonymous user. Therefore, we don’t need to provide a password or username.+force_install_dir /home/pi/valheim_server: Here, we specify the directory where we want to install the Valheim server. In our case, it’s the/home/pi/valheim_serverfolder.+app_update 896660: This parameter enables us to select the right package to download from the Steam library. In our case, the Valheim server has an App ID of 896660.
Running Valheim Dedicated Server
You could now set up and run the Valheim server if the download was successful. To get started, navigate to the /home/pi/valheim_server directory where we download the file. When you run the ls command, you will see the file with the name start_server.sh. We need to edit one particular line in this file that determines how we run the Valheim server.
Open the file using the nano editor (sudo nano start_server.sh) and look for the line below.
./valheim_server.x86_64 -name "My server" -port 2456 -world "Dedicated" -password "secret"
Replace the line with the one below.
./valheim_server.x86_64 -nographics -batchmode -port 5656 -public 0 -name "My Valheim Server" -world "MyFirstWorld" -password "MySecretPassword" -savedir "/home/pi/valheim_data"
Before saving the file, there are some arguments that you can change on this line. Let’s look at some of them.
-port 5656: Here, you can specify a different port number, say 5555, 8088, and so on. Ensure you don’t put a number greater than 65535.-name "My Valheim Server": Here, you can give a different name for your server. Don’t add any extensions like .db or .fwl to the name.-world "MyFirstWorld": Here, you can set a different name for your world.-password "Password123": Here, set a password that users will use to access the server. Ensure the password is more than five characters. However, you can also decide not to set a password by omitting this parameter./home/pi/valheim_data: This argument specifies the path where you want to save the Valheim world data.
When done, save the file (Ctrl + S) and exit (Ctrl + X).
To start the server, execute the command below.
.start_server.sh
The startup process might take a few minutes since the game needs to generate the game world, locations, etc. When done, launch the game on your PC and type the IP address of your PI under the “Join by IP” option. Click Connect. If you don’t know the IP address of the PI, execute the command below on the Terminal.
hostname -I

Valheim Game Play
Conclusion
That’s it! You have successfully set up Valheim Server on your Raspberry Pi. Even though the Pi might not have enough resources to carry out resource-intensive tasks, it can support the Valheim Server pretty well without any glitches. If you encounter any issues during the setup process, please do not hesitate to hit the comments below.