Post
Valheim Dedicated Server 24/7 Always Online Perfect GuideWant to set up the perfect multiplayer environment with friends before Valheim's 1.0 release? This guide provides a detailed walkthrough of setting up a dedicated Valheim server that's accessible 24/7 using a VPS. Don't worry if you're not familiar with the terminal; you can create your own server by following these step-by-step instructions.
1. 🎮 Valheim Dedicated Server Setup: Why Is It Necessary?
· Valheim is still considered one of the best survival games, and its native Linux build works well.
· It's a great time to play with friends before the 1.0 release.
· A dedicated server is essential to ensure your multiplayer world continues to grow and your friends can connect.
· This tutorial will show you how to set up a Valheim server using a Virtual Private Server (VPS).
· We'll provide detailed instructions so you can follow along even if you're not familiar with the terminal.
· It's a great time to play with friends before the 1.0 release.
· A dedicated server is essential to ensure your multiplayer world continues to grow and your friends can connect.
· This tutorial will show you how to set up a Valheim server using a Virtual Private Server (VPS).
· We'll provide detailed instructions so you can follow along even if you're not familiar with the terminal.
00:01 - 01:05
1. 🎮 Valheim Dedicated Server Setup: Why Is It Necessary?
· Valheim is still considered one of the best survival games, and its native Linux build works well.
· It's a great time to play with friends before the 1.0 release.
· A dedicated server is essential to ensure your multiplayer world continues to grow and your friends can connect.
· This tutorial will show you how to set up a Valheim server using a Virtual Private Server (VPS).
· We'll provide detailed instructions so you can follow along even if you're not familiar with the terminal.
· It's a great time to play with friends before the 1.0 release.
· A dedicated server is essential to ensure your multiplayer world continues to grow and your friends can connect.
· This tutorial will show you how to set up a Valheim server using a Virtual Private Server (VPS).
· We'll provide detailed instructions so you can follow along even if you're not familiar with the terminal.
01:06 - 02:38
2. 💻 Hostinger VPS Setup and Firewall Configuration
· We'll be hosting the Valheim server using Hostinger's KVM 2 plan.
· You can get a 10% discount by using the code 'superuser' when purchasing an annual plan or higher.
· We'll select Ubuntu 24.04 LTS as the operating system, which is stable and commonly used for servers.
· After purchasing the VPS, you need to open firewall ports in the Hostinger panel. Valheim uses UDP ports 2456 through 2458.
· In the firewall settings, specify the 'Valheim' name, UDP protocol, and port range 2456:2458, then enable the rule.
· You can get a 10% discount by using the code 'superuser' when purchasing an annual plan or higher.
· We'll select Ubuntu 24.04 LTS as the operating system, which is stable and commonly used for servers.
· After purchasing the VPS, you need to open firewall ports in the Hostinger panel. Valheim uses UDP ports 2456 through 2458.
· In the firewall settings, specify the 'Valheim' name, UDP protocol, and port range 2456:2458, then enable the rule.
02:39 - 05:29
3. 🖥️ Ubuntu Server Preparation: System Update and User Creation
· Open the terminal in the Hostinger panel to connect to your server.
· First, update the system: `sudo apt update && sudo apt upgrade`
· For security, create a new user named 'Steam' instead of using the root user: `sudo useradd -m steam`
· Set a password for the Steam user: `sudo passwd steam`
· Add the Steam user to the sudoers file to grant administrator privileges: `sudo usermod -aG sudo steam`
· Switch to the Steam user: `sudo -u steam -s`
· Navigate to the Steam user's home directory: `cd /home/steam`
· Type `clear` to clean up the screen.
· First, update the system: `sudo apt update && sudo apt upgrade`
· For security, create a new user named 'Steam' instead of using the root user: `sudo useradd -m steam`
· Set a password for the Steam user: `sudo passwd steam`
· Add the Steam user to the sudoers file to grant administrator privileges: `sudo usermod -aG sudo steam`
· Switch to the Steam user: `sudo -u steam -s`
· Navigate to the Steam user's home directory: `cd /home/steam`
· Type `clear` to clean up the screen.
05:30 - 09:20
4. 🚀 Install SteamCMD and Download Valheim Server Files
· Add the repository for Steam installation: `sudo add-apt-repository multiverse`
· Add 32-bit libraries: `sudo dpkg --add-architecture i386`
· Update the repository again: `sudo apt update`
· Install SteamCMD: `sudo apt install steamcmd`
· Agree to the user license agreement during installation.
· Run SteamCMD: `/usr/games/steamcmd`
· Set the game installation directory: `force_install_dir /home/steam/.steam/steamapps/common/valheim`
· Log in anonymously: `login anonymous`
· Download and validate Valheim server files: `app_update 896660 validate`
· Once the installation is complete, exit SteamCMD with the `exit` command.
· Add 32-bit libraries: `sudo dpkg --add-architecture i386`
· Update the repository again: `sudo apt update`
· Install SteamCMD: `sudo apt install steamcmd`
· Agree to the user license agreement during installation.
· Run SteamCMD: `/usr/games/steamcmd`
· Set the game installation directory: `force_install_dir /home/steam/.steam/steamapps/common/valheim`
· Log in anonymously: `login anonymous`
· Download and validate Valheim server files: `app_update 896660 validate`
· Once the installation is complete, exit SteamCMD with the `exit` command.
09:21 - 13:48
5. ⚙️ Modify Valheim Server Configuration Files and Backup
· Navigate to the Valheim installation directory: `cd /home/steam/.steam/steamapps/common/valheim`
· Open the `start_server.sh` file with the nano editor: `nano start_server.sh`
· Configure settings such as server name, password, public status (`-public 1`), save interval (`-saveinterval 1800`), and difficulty preset (`-preset normal`).
· After making changes, save with `Ctrl+O` and exit with `Ctrl+X`.
· Create a backup copy of the configuration file: `cp start_server.sh start_server_cp.sh`
· Use the `ls` command to verify that the file was copied correctly.
· Open the `start_server.sh` file with the nano editor: `nano start_server.sh`
· Configure settings such as server name, password, public status (`-public 1`), save interval (`-saveinterval 1800`), and difficulty preset (`-preset normal`).
· After making changes, save with `Ctrl+O` and exit with `Ctrl+X`.
· Create a backup copy of the configuration file: `cp start_server.sh start_server_cp.sh`
· Use the `ls` command to verify that the file was copied correctly.
13:49 - 15:53
6. 🛠️ Create Systemd Service and Configure Automatic Server Startup
· Create a systemd service file to ensure the server automatically starts on reboot.
· Open the service file with the nano editor: `sudo nano /etc/systemd/system/valheimserver.service`
· Paste the service configuration content, save (`Ctrl+O`, Enter), and exit (`Ctrl+X`).
· Enable the created service to start automatically on boot: `sudo systemctl enable valheimserver.service`
· Start the service immediately: `sudo systemctl start valheimserver.service`
· Check the service status to confirm it's running correctly: `sudo systemctl status valheimserver.service`
· Open the service file with the nano editor: `sudo nano /etc/systemd/system/valheimserver.service`
· Paste the service configuration content, save (`Ctrl+O`, Enter), and exit (`Ctrl+X`).
· Enable the created service to start automatically on boot: `sudo systemctl enable valheimserver.service`
· Start the service immediately: `sudo systemctl start valheimserver.service`
· Check the service status to confirm it's running correctly: `sudo systemctl status valheimserver.service`
15:54 - 17:08
7. 🎮 How to Connect to the Server and Invite Friends In-Game
· Wait about 5 minutes for the server to be fully ready.
· Launch Valheim, select your character, and choose 'Join Game'.
· Find the server you just created in the server browser and connect.
· Enter the server password to join the game.
· To allow friends to join, they can search for the server by name or you can share the 'Join Code' displayed at the top of the game screen.
· Now you can have a great time with your friends on your own 24/7 Valheim server.
· Launch Valheim, select your character, and choose 'Join Game'.
· Find the server you just created in the server browser and connect.
· Enter the server password to join the game.
· To allow friends to join, they can search for the server by name or you can share the 'Join Code' displayed at the top of the game screen.
· Now you can have a great time with your friends on your own 24/7 Valheim server.
