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


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Cloudron Forum

Apps | Demo | Docs | Install

Valheim Dedicated Server

Scheduled Pinned Locked Moved Solved App Wishlist
22 Posts 5 Posters 1.5k Views
    • 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.
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    wrote on last edited by
    #1

    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/

    Like my work? Consider donating a drink drink. Cheers!

    ? BrutalBirdieB 3 Replies Last reply
    7
  • ? Offline
    ? Offline
    A Former User
    replied to BrutalBirdie on last edited by
    #2

    @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
    2
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to BrutalBirdie on last edited by
    #3

    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.

    Like my work? Consider donating a drink drink. Cheers!

    1 Reply Last reply
    1
  • nebulonN Offline
    nebulonN Offline
    nebulon Staff
    wrote on last edited by
    #4

    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.

    BrutalBirdieB 1 Reply Last reply
    0
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to nebulon on last edited by
    #5

    @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/

    Like my work? Consider donating a drink drink. Cheers!

    nebulonN 1 Reply Last reply
    0
  • nebulonN Offline
    nebulonN Offline
    nebulon Staff
    replied to BrutalBirdie on last edited by
    #6

    @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?

    BrutalBirdieB 1 Reply Last reply
    1
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to nebulon on last edited by
    #7

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

    Like my work? Consider donating a drink drink. Cheers!

    1 Reply Last reply
    1
  • girishG Offline
    girishG Offline
    girish Staff
    wrote on last edited by
    #8

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

    BrutalBirdieB 1 Reply Last reply
    1
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to girish on last edited by BrutalBirdie
    #9

    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.

    Like my work? Consider donating a drink drink. Cheers!

    robiR 1 Reply Last reply
    1
  • robiR Offline
    robiR Offline
    robi
    replied to BrutalBirdie on last edited by
    #10

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

    Life of sky tech

    BrutalBirdieB 1 Reply Last reply
    0
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to robi on last edited by
    #11

    @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 🙂

    Like my work? Consider donating a drink drink. Cheers!

    1 Reply Last reply
    2
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to BrutalBirdie on last edited by BrutalBirdie
    #12

    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

    Like my work? Consider donating a drink drink. Cheers!

    BrutalBirdieB 1 Reply Last reply
    2
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to BrutalBirdie on last edited by
    #13

    . . .

    Hotfix

    [0.0.13]

    • -savedir path was wrong resulting in new world generation, no /app/data effected by this.

    Like my work? Consider donating a drink drink. Cheers!

    BrutalBirdieB 1 Reply Last reply
    2
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to BrutalBirdie on last edited by
    #14

    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

    Like my work? Consider donating a drink drink. Cheers!

    BrutalBirdieB 1 Reply Last reply
    1
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to BrutalBirdie on last edited by
    #15

    Update 0.0.15

    • Fixed typo
    • Better unzip

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

    Like my work? Consider donating a drink drink. Cheers!

    ? 1 Reply Last reply
    0
  • ? Offline
    ? Offline
    A Former User
    replied to BrutalBirdie on last edited by
    #16

    @brutalbirdie not that I didn’t believe you but just to add a vouch for this: I put up a server and a friend was able to connect. I’ll give it a shot after work and see if I notice any issues.

    BrutalBirdieB 1 Reply Last reply
    0
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to A Former User on last edited by
    #17

    @atrilahiji I know that @nebulon is running the Valheim App and playing with his friends 😉

    Still I don't know if's OK for the app store.

    Like my work? Consider donating a drink drink. Cheers!

    1 Reply Last reply
    0
  • nebulonN Offline
    nebulonN Offline
    nebulon Staff
    wrote on last edited by
    #18

    I think it would be nice to get into the store...I can confirm that it is pretty stable.
    Still I am not sure if it makes sense to rely on downloading the server binary on every app restart. This makes it heavily dependent on upstream server download location.
    Also when a valheim update is out, I essentially have no means with the current package to roll back if the new version has issues.

    BrutalBirdieB 1 Reply Last reply
    0
  • BrutalBirdieB Offline
    BrutalBirdieB Offline
    BrutalBirdie Staff
    replied to nebulon on last edited by
    #19

    @nebulon is there even an option to rollback the client?
    Because if client and server are out of sync from versions, you simply can't connect.

    As far as I know Valheim is only sold on Steam which does not provide version selection. 😕

    Like my work? Consider donating a drink drink. Cheers!

    nebulonN 1 Reply Last reply
    0
  • nebulonN Offline
    nebulonN Offline
    nebulon Staff
    replied to BrutalBirdie on last edited by
    #20

    @brutalbirdie you are the expert on this 🙂

    Then I guess the main outstanding issue is the always-on downloading during app start.
    This might be similar to the minecraft packages, where it might makes sense to stash the binaries in /app/data/ to both achieve an evergreen state as well as avoiding downloading and installing on every restart.

    Question I guess is, how we can determine when an update is needed or not, do you think there is some way besides manually triggering that through some sort of UI?

    BrutalBirdieB 1 Reply Last reply
    0

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Login

  • Don't have an account? Register

  • Login or register to search.