Valheim is an online multiplayer survival game that has taken the gaming world by storm. If you’re a fan of the game and want to host your own Valheim server on Ubuntu, this article will guide you through the installation process.

sail_viking

Prerequisites

Before we begin, you will need the following:

  • A server running Ubuntu 18.04 or higher
  • A non-root user with sudo privileges
  • Basic knowledge of the Linux command line

Step 1 - Install Dependencies

To run a Valheim server on Ubuntu, you will need to install the following dependencies:

sudo apt update
sudo apt install -y curl unzip screen lib32gcc1

valheim_monster

Step 2 - Download and Install SteamCMD

Valheim is available on Steam, so we need to download and install SteamCMD, a command-line version of the Steam client, to manage our server.

mkdir ~/steamcmd && cd ~/steamcmd
curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -

Step 3 - Install and Configure the Valheim Server

Once SteamCMD is installed, we can use it to install and configure the Valheim server.

cd ~/steamcmd
./steamcmd.sh +login anonymous +force_install_dir ~/valheim +app_update 896660 validate +exit

This command will download and install the Valheim server to the ~/valheim directory.

Step 4 - Configure the Server

Now that the Valheim server is installed, we need to configure it by creating a new start_server.sh script. This script will start the Valheim server with the desired settings.

nano ~/valheim/start_server.sh

Copy and paste the following script into the file:

#!/bin/bash

export templdpath=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH
export SteamAppId=892970

./valheim_server.x86_64 -name "My server" -port 2456 -world "Dedicated" -password "mypassword" -savedir "/home/username/valheim/saves"
export LD_LIBRARY_PATH=$templdpath

Make sure to replace My server, mypassword, and username with your desired server name, password, and username respectively.

Save and close the file by pressing Ctrl+X, then Y, then Enter.

Step 5 - Start the Server

Now that the server is configured, we can start it using the following command:

cd ~/valheim && ./start_server.sh

This command will start the Valheim server with the settings specified in the start_server.sh script.

Step 6 - Connect to the Server

Once the server is running, you can connect to it from the Valheim game client. In the game menu, select “Join Game” and enter the server IP address followed by the port number, separated by a colon.

For example: 192.168.1.100:2456

Conclusion

Congratulations! You now have a Valheim server up and running on your Ubuntu server. With this guide, you can easily install and configure your own Valheim server to enjoy the game with your friends. Remember to keep the server updated and secure by regularly installing updates and setting up firewalls. Happy gaming!

valheim_world