Setting Up a Valheim Server: A PineRiver Guide

Setting Up a Valheim Server: A PineRiver Guide

Home/Blog/Setting Up a Valheim Server: A PineRiver Guide

Published on February 16, 2025 by PineRiver

Why Choose a Dedicated Valheim Server?

Hosting a Valheim server offers several benefits:

PineRiver offers powerful dedicated Valheim servers optimized for gaming with Ryzen processors and low latency.


Requirements for a Valheim Server

Before setting up your server, ensure that your hardware and software meet the minimum requirements:

Minimum Hardware Requirements:

Software Requirements:


Step-by-Step Guide: Setting Up a Valheim Server

1. Rent a Valheim Server from PineRiver

For the easiest setup, you can rent a Valheim VPS from PineRiver, where everything is optimized for gaming. If you prefer to set up the server yourself, follow the steps below.

2. Install SteamCMD

SteamCMD is used to download and update Valheim server files.

Ubuntu/Linux:

sudo apt update && sudo apt install steamcmd -y

Windows:

  1. Download SteamCMD from Steam’s official website.
  2. Extract and run steamcmd.exe.

3. Download and Install the Valheim Server

Launch SteamCMD and run the following commands:

steamcmd +login anonymous +force_install_dir /valheim +app_update 896660 validate +quit

This downloads the necessary server files.

4. Configure Server Settings

Locate start_server.sh (Linux) or start_server.bat (Windows) in your Valheim directory and edit it:

./valheim_server.x86_64 -name "MyServer" -port 2456 -world "MyWorld" -password "secretcode" -public 1

Replace MyServer, MyWorld, and secretcode as desired.

5. Open Ports in Firewall

To allow players to connect to your server, open the required ports.

Linux (UFW):

sudo ufw allow 2456/udp
sudo ufw allow 2457/udp
sudo ufw allow 2458/udp

Windows Firewall:

  1. Search for "Windows Defender Firewall."
  2. Add a new rule for UDP ports 2456-2458.

6. Start the Server

Linux:

cd /valheim && ./start_server.sh

Windows:
Double-click start_server.bat.

The server will now start, and you can connect via Valheim -> Community Servers or directly by IP.


Optimizing Valheim Server Performance

To ensure smooth gameplay, optimize the server as follows:

1. Use a More Powerful VPS or Dedicated Server

At PineRiver, we offer Ryzen-based VPS solutions, providing better performance than cheaper server options.

2. Automatic Server Restart

Restarting the server every 24 hours can prevent lag.

Linux cron job:

0 4 * * * /valheim/start_server.sh restart

This restarts the server at 04:00 daily.

3. Optimize Network Settings

Modify sysctl to reduce latency:

echo "net.core.rmem_max=2500000" >> /etc/sysctl.conf
sudo sysctl -p

4. Reduce Server Lag with More Players

Use the valheim_plus modification to adjust server settings and reduce lag.

5. Active Monitoring and Troubleshooting

Set up log monitoring with a system like logwatch to detect errors and quickly resolve issues.

6. Automate Backup Solutions

Use a script to perform daily backups:

tar -czvf /backup/valheim_$(date +%F).tar.gz /valheim/worlds

Conclusion

Setting up a Valheim server requires some technical work, but it offers a much better gaming experience for you and your friends. If you prefer to avoid the hassle, you can rent a pre-configured Valheim server from PineRiver, ensuring optimal performance and stability.

Have questions or need help? Contact us at PineRiver – we are experts in gaming hosting!

Create Your Own ServerAre you ready to begin?

Start your server today and we'll give you a 25% discount on your first server. Use code NEW25 at checkout.