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+

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!

You May Also Like


Created by zerobandwidth



17 Comments

  1. 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.

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

    :/

  3. not working for me 🙁
    [email protected]:/opt/Dedicated_Valheim_Server_Script# sudo systemctl stop valheim.service
    Failed to stop valheim.service: Unit valheim.service not loaded.
    [email protected]:/opt/Dedicated_Valheim_Server_Script# sudo systemctl status valheim.service
    ● valheim.service
    Loaded: not-found (Reason: No such file or directory)
    Active: inactive (dead)
    [email protected]:/opt/Dedicated_Valheim_Server_Script# sudo systemctl start valheim.service
    Failed to start valheim.service: Unit valheim.service not found.
    [email protected]:/opt/Dedicated_Valheim_Server_Script# systemctl start valheim.service
    Failed to start valheim.service: Unit valheim.service not found.
    [email protected]:/opt/Dedicated_Valheim_Server_Script#

    • Did you use the script from PUTTY and not a CLI GUI interface that is provided by most server companies?

      Visit my GITHUB and come to my DISCORD. I can help you out.

  4. 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)

  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. 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 / )

    🙁

  7. 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

  8. 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.

Leave a Reply

Your email address will not be published.


*