Valheim on a Linux install (Ubuntu)

Post Reply
User avatar
hiimcody1
Staff
Staff
Posts: 1451
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Wed Dec 28, 2011 4:59 pm

Valheim on a Linux install (Ubuntu)

Post by hiimcody1 »

Valheim is still in early access and is somewhat buggy as a result. Public server listing is unreliable, it is best to add your server to your Steam Server Browser's Favorites tab. To do this, enter your server IP and your port+1. For example if your server is running on 127.0.0.1:2456, you'd enter 127.0.0.1:2457 into the Steam Browser when adding it.

For the dedicated server to run, you will need at least 2GB of RAM available, preferably 3GB.

Before starting, ensure you are logged in as root on your VDS.

1. Enable 32-bit application installs within dpkg

Code: Select all

dpkg --add-architecture i386
2. Update apt

Code: Select all

apt update
3. Install SteamCMD

Code: Select all

apt install steamcmd -y
As part of installing, you will have to agree to Valve's Steam License Agreement
4. Add a steam user to run your server under. You should never run a server as root.

Code: Select all

adduser steam --disabled-password
The steam user won't be able to log in over ssh, but that's fine for our purposes here.
5. Switch to the steam user

Code: Select all

su steam
6. Make an install directory for Valheim

Code: Select all

mkdir ~/valheim
7. Install the Valheim Dedicated Server Files

Code: Select all

steamcmd +login Anonymous +force_install_dir ~/valheim +app_update 896660 validate +quit
8. Create a launch file for your server based off the template included with the files

Code: Select all

cp ~/valheim/start_server.sh ~/valheim/my_start_server.sh
9. Edit your launch file to fill in your own desired settings

Code: Select all

nano ~/valheim/my_start_server.sh
Be sure to change your password before starting. If you want your server to be public, add "-public 1" after your password.

An example start line:

Code: Select all

./valheim_server.x86_64 -name "NFOServers.com: New Server" -port 2456 -world "Dedicated" -password "ChangeMe" -public 1
When you have yours edited as desired, press CTRL+O on your keyboard to save the file then press CTRL+X to exit the editor.

10. Start your server

Code: Select all

cd ~/valheim
screen -S Valheim ./my_start_server.sh
This will load your server up in a "screen" session nammed "Valheim", which will allow you to have it running without staying logged into SSH.

Your server should now be running and online.

---

Some additional tidbits:

To stop the server, press CTRL+C on your keyboard to send a terminate command to it. You will need to be attached to the screen session in order to do this.

If you need to get back into that screen session at a later time (such as to stop the server), you can re-attach by running this command:

Code: Select all

screen -R Valheim
You should now be able to connect to your server using the Steam Browser or by directly entering the IP address in-game. The in-game server browser is somewhat bugged right now and not all servers will show.
Post Reply