Knowledgebase

Setting Up a Valheim Server on Ubuntu 20.04 Print

  • valheim, game server, installation
  • 0

Step 1: Update Your System

First, always make sure your system is up-to-date by running the following commands:

sudo apt update sudo apt upgrade

Step 2: Install Required Dependencies

Valheim requires some software to run properly. Install these by running:

sudo apt install software-properties-common wget -y

Step 3: Add Multiverse Repositories

Some packages may require multiverse repositories, so let's add them:

sudo add-apt-repository multiverse sudo apt update

Step 4: Install SteamCMD

SteamCMD is the command-line version of the Steam client. It's necessary to install the Valheim server. Run:

sudo apt install steamcmd -y

Step 5: Create a New Directory for Valheim

Now, let's create a directory to store the Valheim server files:

mkdir ~/valheim_server cd ~/valheim_server

Step 6: Download Valheim Server Files

Use SteamCMD to download the Valheim server:

steamcmd +login anonymous +force_install_dir ~/valheim_server +app_update 896660 validate +exit

Step 7: Create a Start Script

To easily start the Valheim server, create a start script:

  1. Create a new file called start_valheim.sh:
nano start_valheim.sh
  1. Paste the following content:
#!/bin/bash cd ~/valheim_server ./valheim_server.x86_64 -name "Your Server Name" -port 2456 -world "Dedicated" -password "YourPassword"
  1. Save the file and exit.

  2. Make the script executable:

chmod +x start_valheim.sh

Step 8: Running the Server

To run the server, simply execute the start script:

./start_valheim.sh

Step 9: Optional: Setting Up a Systemd Service

If you want the server to run in the background or start automatically on boot, you can create a systemd service.

  1. Create a new systemd service file:
sudo nano /etc/systemd/system/valheim.service
  1. Paste the following content:
[Unit] Description=Valheim Server After=network.target [Service] User=your_username WorkingDirectory=/home/your_username/valheim_server ExecStart=/home/your_username/valheim_server/start_valheim.sh Restart=always [Install] WantedBy=multi-user.target
  1. Save the file and exit.

  2. Reload the systemd daemon:

sudo systemctl daemon-reload
  1. Enable and start the service:
sudo systemctl enable valheim sudo systemctl start valheim

And there you have it! You've successfully set up a Valheim server on Ubuntu 20.04. To join the server, you'll need to give out your server's IP address and the password you set up.


Was this answer helpful?
Back