Valheim – Dedicated Server in Linux for Ubuntu (Auto Installer)

This guide will help you setting up a dedicated server or you can click the link below to order your own game server!

Single installation script for setting up Valheim on a dedicated Linux server with steamcmd.

  • Tested on: AWS, Azure and DigitalOcean
  • OS – Ubuntu 18.06 LTS 64bit and Ubuntu 20.04 LTS
  • Recommended server settings: CPU: 4 (2 will work but meh) RAM: 8GB+ Harddrive: 250GB+

How to Host Your Own Server (Rental Service Provider)

You can host a server at game server hosting provider:

Note: Every gaming server goes online immediately! A welcome email including your connection information (guide) will be sent to you when your gaming server is created.

Install Walkthrough

Never run any script on a production server, unless you know what you are doing.

Run as root (if brave enough) or sudo current user

1. Install GIT to pull down script.

  • sudo apt-get install -y git net-tools

2. Change to OPT Dir.

  • cd /opt

3. Clone GIT from Nimdy (Zero Bandwidth).

4. Change dir to Dedicated_Valheim_Server_Script.

  • cd Dedicated_Valheim_Server_Script/

5. Allow script to execute.

  • sudo chmod +x build_dedicated_valheim_server.sh

6. Change PASSWORDS and CHANGE ME AREAS before launching.

  • sudo vi build_dedicated_valheim_server.sh

#There are 4 things you need to change!
#Note: Minimum password length is 5 characters & Password cant be in the server name.

  • userpassword=”user_password” <—password for the new Linux User it creates
  • password=”passw0rd” <—password for the Valheim Server Access
  • displayname=”server display name” <—Public display name for server
  • worldname=”111111111″ <—local inside world name

#Save the file

7. Execute installation file.

  • sudo ./build_dedicated_valheim_server.sh

8. A new version of /boot/grub/menu.lst promotx2 or DHCP – Accept Default (No).

  • Select keep the local version currently installed

9. Agree to Steam License Agreement

  • Select Ok
  • Select I Agree
  • Press Enter

10. Allow ports 2456,2457,2458 on your server.

  • sudo ufw allow 2456:2458/tcp (Not required but whatever)
  • sudo ufw allow 2456:2458/udp (REQUIRED)

11. Stop Valheim service.

  • sudo systemctl stop valheimserver.service

12. Reboot Server for the lawls!

  • sudo reboot

13. Once your server comes back online wait 2-5 mins and check Valheim service

  • sudo systemctl status valheimserver.service

Congratz! You did it, now get out there and start exploring with your friends!

Helena Stamatina
About Helena Stamatina 1520 Articles
I love two things in life, games and sports. Although sports were my earliest interest, it was video games that got me completely addicted (in a good way). My first game was Crash Bandicoot (PS1) from the legendary studio Naughty Dog back in 1996. I turned my passion for gaming into a job back in 2019 when I transformed my geek blog (Re-actor) into the gaming website it is today.

17 Comments

  1. Hmm, I’m stuck on step 5. I get this error.

    “chmod: cannot access ‘build_dedicated_valheim_server.sh’: No such file or directory”
    and when I look in that directory, this is all that’s in there…
    “advancemenu.sh CODE_OF_CONDUCT.md LICENSE menu.sh README.md

  2. Not getting any connectivity. This VM also (until v recently) hosted a Minecraft server, so I know it’s connectable and how to set these things up… UFW has been configured and even disabled. The service appears to be running but just getting nothing on the client side at all, no indication that any game server is running.

  3. Hello everyone,
    it all went well so far. But when I try to copy our existing world it says no permission on /home/steam/.config/unity3d/IronGate/Valheim/Worlds as I am not the owner. When I try to log in into Ubuntu with steam and the password I’ve edited in the script file it doesn’t let me log in. I am new to linux, sorry

    • You could make another user and upload it to this users home directory (via sftp or whatever you like)

      Step 1: Upload file.
      Step 2: (As sudo) Move file to /home/steam/.config/unity3d/IronGate/Valheim/Worlds/
      Step 3: (As sudo) Change the ownership of the file to steam:steam with ->
      sudo chown steam:steam filepath

  4. When executing the install script and steamcmd is being run in the process of the script execution I get the following steamcmd error:

    “ERROR! Failed to install app ‘896660’ (Disk write failure)”

    (Yes, there’s more than enough free disk space on / )

    🙁

  5. I think that

    sudo systemctl stop valheim.service

    should read

    sudo systemctl stop valheimserver.service

    Otherwise you get “Failed to stop valheim.service: Unit valheim.service not loaded.”

  6. Looks like I’ve got the server up and running in an EC2, but it’s failing to place items….

    Feb 11 21:46:43 ip-172-31-71-74 start_valheim.sh[3923]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    Feb 11 21:46:48 ip-172-31-71-74 start_valheim.sh[3923]: 02/11/2021 21:46:48: Failed to place all Runestone_Mountains, placed 95 out of 100
    Feb 11 21:46:48 ip-172-31-71-74 start_valheim.sh[3923]:
    Feb 11 21:46:48 ip-172-31-71-74 start_valheim.sh[3923]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    Feb 11 21:46:48 ip-172-31-71-74 start_valheim.sh[3923]: 02/11/2021 21:46:48: Done generating locations, duration:45948.148 ms
    Feb 11 21:46:48 ip-172-31-71-74 start_valheim.sh[3923]:
    Feb 11 21:46:48 ip-172-31-71-74 start_valheim.sh[3923]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    Feb 11 21:46:48 ip-172-31-71-74 start_valheim.sh[3923]: 02/11/2021 21:46:48: DungeonDB Start 269
    Feb 11 21:46:48 ip-172-31-71-74 start_valheim.sh[3923]:
    Feb 11 21:46:48 ip-172-31-71-74 start_valheim.sh[3923]: (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

  7. not working for me 🙁
    root@instance-1:/opt/Dedicated_Valheim_Server_Script# sudo systemctl stop valheim.service
    Failed to stop valheim.service: Unit valheim.service not loaded.
    root@instance-1:/opt/Dedicated_Valheim_Server_Script# sudo systemctl status valheim.service
    ● valheim.service
    Loaded: not-found (Reason: No such file or directory)
    Active: inactive (dead)
    root@instance-1:/opt/Dedicated_Valheim_Server_Script# sudo systemctl start valheim.service
    Failed to start valheim.service: Unit valheim.service not found.
    root@instance-1:/opt/Dedicated_Valheim_Server_Script# systemctl start valheim.service
    Failed to start valheim.service: Unit valheim.service not found.
    root@instance-1:/opt/Dedicated_Valheim_Server_Script#

  8. valheimserver.service: Service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.

    :/

  9. everything worked fine, but my server is not showing up in steam (local or by external ip) what went wrong and what can i doo to see my server in the gameclient or steam-serverbrowser??

    • you must use a launch modifier until STEAM and Valheim fix whatever server listing system they have.

      use the following +connect IPADRESSofyourserver:PORT
      You do this by right clicking the Valheim game icon within Steam, select properties and type your server information. close it and launch the game.

Leave a Reply

Your email address will not be published.


*