Setting Up Your Own Valheim Server: A Step-by-Step Guide
Ubuntu | Linux | Valheim | Self Hosted

Hello, my name is Jonathan, and I work as a Cybersecurity Engineer. My expertise includes defending against threats, establishing security controls, and utilizing threat intelligence to gather TTPs (Tactics, Techniques, and Procedures), which I then use to construct custom detections. I am passionate about developing security programs, implementing them, and ensuring that organizations are safeguarded with a comprehensive overview of all resources.
I have a particular specialization in Azure Cloud, along with some experience in AWS. My qualifications include the CCSP, CCSK, various Azure Certifications, CompTIA Sec+/Cloud+, among others.
Valheim, the Viking-themed survival game, has taken the gaming world by storm. If you’re looking to host your own server for a more personalized and controlled gaming experience, this guide will walk you through the process from start to finish.
1. Server Requirements:
Before diving into the setup, ensure your system meets the following requirements:
Operating System: Ubuntu 20.04 or later
Hardware:
CPU: 2-4 cores (minimum)
RAM: 4GB (minimum), 8GB+ recommended
SSD Storage: 1GB+ for Valheim files
Network Bandwidth: Sufficient for the expected player count
2. Server Setup:
Install Ubuntu Server:
Download Ubuntu Server from the official website.
Create a bootable USB drive or set up a virtual machine.
Follow the installation wizard to complete the setup.
Update Packages:
sudo apt update
sudo apt upgrade
Install SteamCMD:
sudo apt install steamcmd
3. Create Valheim User:
sudo adduser valheim
4. Download Valheim Server Files:
Switch to the Valheim user and download the server files:
su valheim
steamcmd +login anonymous +force_install_dir /home/valheim/valheimserver +app_update 896660 validate +quit
5. Configure Server:
Navigate to the server directory and create a configuration file:
cd /home/valheim/valheimserver
nano start_server.sh
Paste the following content into start_server.sh, adjusting values as needed: (Please don't use the default password & name for your actual setup!)
#!/bin/sh
./valheim_server.x86_64 -name "My Valheim Server" -port 2456 -password "secret" -world "Dedicated"
Make the script executable:
chmod +x start_server.sh
6. Open Firewall Ports:
Allow the necessary ports for Valheim:
sudo ufw allow 2456/udp
sudo ufw allow 2457/udp
sudo ufw allow 2458/udp
7. Start the Server:
Execute the start script:
./start_server.sh
8. Connect to the Server:
On your client machine, run Valheim, click “Join Game,” and enter your server’s IP address or hostname. If you’ve set a password, provide it when prompted.
9. Additional Tips:
Consider using a tool like LinuxGSM for easier server management.
Set up a systemd service for automatic server startup and management.
Keep the server files and plugins updated.
Regularly back up server data.
Monitor server resources and adjust settings as needed for optimal performance.
Hosting your own Valheim server can be a rewarding experience, giving you the freedom to customize and control your Viking adventure. With this guide, you’re well on your way to setting sail in the world of Valheim with friends and fellow warriors. Happy gaming!






