Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Navigation

    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Valheim Dedicated Server

    App Wishlist
    5
    14
    289
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • BrutalBirdie
      BrutalBirdie App Dev last edited by

      https://store.steampowered.com/app/892970/Valheim/

      This game got recently released on steam and hit quite the trend.

      https://steamdb.info/app/892970/graphs/

      Having this server as an app would be nice.

      And the work is already done! 😁

      https://git.cloudron.io/BrutalBirdie/valheim-gameserver-app

      Needs some fine work with doc, screenshots and all.

      But it's live and running at https://valheim.deadsec.net/

      atrilahiji BrutalBirdie 3 Replies Last reply Reply Quote 6
      • atrilahiji
        atrilahiji App Dev @BrutalBirdie last edited by

        @brutalbirdie I just check out Valheim and was thinking about hosting a server. And here you are with a cloudron package! +1 for this

        1 Reply Last reply Reply Quote 2
        • BrutalBirdie
          BrutalBirdie App Dev @BrutalBirdie last edited by

          btw. if you put +connect your_server_ip:your_game_port in the game launch options when you hit play you instantly connect to the server.

          1 Reply Last reply Reply Quote 2
          • nebulon
            nebulon Staff last edited by

            I actually had no way to test this app after getting the game on steam. I essentially have no GPU which is capable of running that in a way I manage to traverse the UI to the point to connect to a server...not sure how we should proceed here, we probably need a few more people taking this for a test run.

            BrutalBirdie 1 Reply Last reply Reply Quote 0
            • BrutalBirdie
              BrutalBirdie App Dev @nebulon last edited by

              @nebulon also we need to talk about my packaging since it's not quite like the cloudron standard.

              aka. I get the server binary dynamically at runtime.

              https://git.cloudron.io/BrutalBirdie/valheim-gameserver-app/-/blob/master/docker/app/code/start.sh#L19

              echo "=> Create Valheim Server"
              mkdir -p /run/steamcmd && \
              cd /run/steamcmd/ && \
              curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - && \
              ./steamcmd.sh +login anonymous +force_install_dir /run/vhserver-steam/ +app_update 896660 +quit
              

              This kinda bypasses the cloudron app version, since the game server will always be up2date with every restart of the app.

              I am waiting for feedback from one of the Devs since it's kinda unclear where the binarys does write so I could put it all in /app/code/

              nebulon 1 Reply Last reply Reply Quote 0
              • nebulon
                nebulon Staff @BrutalBirdie last edited by

                @brutalbirdie I have used your app package now for a bit with friends and it works already really well.

                I also already saw the server component being updated at least once, this appeared to have worked. So I guess it very much depends on what the upstream strategy is. You seem to have more insight into how they push out updates from the chat conversation we had, so if they have an evergreen approach, maybe it is ok to have the package to not lock down the version, anyways it might cause issues with game clients also being always up-to-date through steam.

                If we would keep the evergreen approach, I guess it would make sense though to keep a copy of the server code installed into /app/data instead of run, would that work?

                BrutalBirdie 1 Reply Last reply Reply Quote 1
                • BrutalBirdie
                  BrutalBirdie App Dev @nebulon last edited by

                  @nebulon The question I asked myself was, do I really want the binary game server in /app/data and in the backup strategy?
                  If this would be in /app/code it would also not be backuped and that is where it should be (if not for the evergreen strategy).

                  As far as I know from the dev the next big milestone will be a complete redesign of their netcode for multiplayer and some other stuff like occlusion culling improving fps for built bases.

                  I would let the data stay in /run since it's not backup worthy.

                  When time comes and mods are supported on linux for servers... hmm
                  Even then I would work with /run and automated install of mods on runtime before the server starts.

                  1 Reply Last reply Reply Quote 1
                  • girish
                    girish Staff last edited by

                    I probably missed it but why can't we run the installer script in the Dockerfile?

                    BrutalBirdie 1 Reply Last reply Reply Quote 1
                    • BrutalBirdie
                      BrutalBirdie App Dev @girish last edited by BrutalBirdie

                      Moin Moin @girish

                      The Valheim server binary does read/write on kinda unknown locations. I am still waiting for a proper devs statement from Iron Gate

                      For example unity wanted to write some stuff to /root or /home/cloudron while runtime (depended on which user started the server).
                      Symlinking /root or /home/cloudron to /app/data for what?
                      A binary created file unity3d/IronGate/Valheim/prefs with this generated content:

                      # cat unity3d/IronGate/Valheim/prefs 
                      <unity_prefs version_major="1" version_minor="1">
                              <pref name="unity.player_session_count" type="string">NA==</pref>
                              <pref name="unity.player_sessionid" type="string">NDEyNTk2MDkwODkxMTc3NDM4Mw==</pref>
                      </unity_prefs>
                      

                      this is not backup worthy.

                      Another thing, I wanted to minimize is the docker image size.
                      I played around with a local .tar file of the server and copying that into the container.
                      NO FUN! A build context of 1GB and more, ain't no body got time for that!
                      Yes I could decrease the build context with installing the server in the Dockerfile, but then again the image would end up with the 1GB+ of the server. This would be ok.

                      But then I got thinking. Game servers depend on being up to date with the upstream.
                      Steam also has no option (at the moment) for downgrading the version of Valheim.
                      Since the client is forced on the new version and servers on the old version are incompatible with the new version.
                      I've decided to get the server while runtime:
                      https://git.cloudron.io/BrutalBirdie/valheim-gameserver-app/-/blob/master/docker/app/code/start.sh

                      #!/bin/bash
                      
                      set -eu
                      
                      echo "=> Create /app/data/"
                      mkdir -p /app/data/
                      
                      echo "=> Create nginx dirs"
                      mkdir -p /run/nginx/log /run/nginx/lib
                      
                      echo "=> Creating unity3d dir"
                      mkdir -p /run/unity3d/
                      
                      echo "=> Copy .env"
                      if [[ ! -f /app/data/.env ]]; then
                          cp -v /app/code/.env /app/data/.env
                      fi
                      
                      echo "=> Create Valheim Server"
                      mkdir -p /run/steamcmd && \
                      cd /run/steamcmd/ && \
                      curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf - && \
                      ./steamcmd.sh +login anonymous +force_install_dir /run/vhserver-steam/ +app_update 896660 +quit
                      
                      echo "=> Start Server"
                      exec /usr/bin/supervisord --configuration /etc/supervisor/supervisord.conf --nodaemon
                      

                      This way with every restart of the app the server is up to date and is not backuped in /app/data since who needs the server binary, I just want my user data in the backup.

                      robi 1 Reply Last reply Reply Quote 1
                      • robi
                        robi @BrutalBirdie last edited by

                        @brutalbirdie hmm, then you probably want nightly restarts unless you're ok doing it manually.

                        BrutalBirdie 1 Reply Last reply Reply Quote 0
                        • BrutalBirdie
                          BrutalBirdie App Dev @robi last edited by

                          @robi said in Valheim Dedicated Server:

                          @brutalbirdie hmm, then you probably want nightly restarts unless you're ok doing it manually.

                          Hmm adding a cronjob inside the app the restart that service from supervisord?
                          Should be doable.


                          Also I just deployed another Valheim server on a different port and can report this works as well.
                          So hosting multible valheim apps can be checked 🙂

                          1 Reply Last reply Reply Quote 2
                          • BrutalBirdie
                            BrutalBirdie App Dev @BrutalBirdie last edited by BrutalBirdie

                            Update

                            https://git.cloudron.io/BrutalBirdie/valheim-gameserver-app

                            [0.0.11]
                            * Updated Server Parameters
                            * Fixed spelling mistake for supervisord
                            * Updated App icon
                            * Fixed Output of Server to display paramters of `/app/data/.env`
                            
                            [0.0.12]
                            * Better readable output of server start
                            * Updated README
                            

                            Diff:
                            https://git.cloudron.io/BrutalBirdie/valheim-gameserver-app/-/commit/b5a39e7e8e599b4668edd1b20f1b2f54f6e7a038

                            BrutalBirdie 1 Reply Last reply Reply Quote 3
                            • BrutalBirdie
                              BrutalBirdie App Dev @BrutalBirdie last edited by

                              . . .

                              Hotfix

                              [0.0.13]

                              • -savedir path was wrong resulting in new world generation, no /app/data effected by this.
                              BrutalBirdie 1 Reply Last reply Reply Quote 2
                              • BrutalBirdie
                                BrutalBirdie App Dev @BrutalBirdie last edited by

                                Update 0.0.14

                                • Added BepInEx Mod Support

                                Git Diff to 0.0.13
                                https://git.cloudron.io/BrutalBirdie/valheim-gameserver-app/-/commit/b8852be63a5c7b44d49a4602d7ea95773d1e1213


                                Have fun and happy modding

                                Cheers 🍻
                                ~BrutalBirdie

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post