Valheim Dedicated Server
-
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/
-
@brutalbirdie I just check out Valheim and was thinking about hosting a server. And here you are with a cloudron package! +1 for this
-
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. -
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.
-
@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.
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/
-
@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?
-
@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. -
I probably missed it but why can't we run the installer script in the Dockerfile?
-
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 fileunity3d/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. -
@brutalbirdie hmm, then you probably want nightly restarts unless you're ok doing it manually.
-
@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 -
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
-
. . .
Hotfix
[0.0.13]
- -savedir path was wrong resulting in new world generation, no
/app/data
effected by this.
- -savedir path was wrong resulting in new world generation, no
-
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 -
Update 0.0.15
- Fixed typo
- Better unzip
-
@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.
-
@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.
-
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. -
@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.
-
@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?