Package Details: valheim-server 0.212.7-1

Git Clone URL: https://aur.archlinux.org/valheim-server.git (read-only, click to copy)
Package Base: valheim-server
Description: Dedicated server for the Valheim PC game
Upstream URL: https://www.valheimgame.com/
Keywords: game server valheim
Licenses: custom:IronGateLicense
Submitter: Splork
Maintainer: Splork
Last Packager: Splork
Votes: 8
Popularity: 0.000411
First Submitted: 2021-04-12 14:21 (UTC)
Last Updated: 2022-12-24 11:43 (UTC)

Latest Comments

i1138 commented on 2025-02-02 20:20 (UTC)

Thanks for the quick response! Yeah, /var/opt/valheim/ seems reasonable. /opt/valheim-server just had the advantage of already existing and matching what https://wiki.archlinux.org/title/Valheim suggests the save location is.

Splork commented on 2025-02-02 19:56 (UTC) (edited on 2025-02-02 19:56 (UTC) by Splork)

Turns out since the time I packaged this, they have made some changes to how the server operates. I'll take a look at it this weel.

Though, I think /var/opt/valheim would be a better place for savegames than /opt/valheim-server

i1138 commented on 2025-02-02 19:51 (UTC) (edited on 2025-02-02 20:06 (UTC) by i1138)

It looks like I found the issue. (or at least one issue) Valheim expects to store saves in $HOME/.config/.... The valheim user does not have a home directory, and systemd does not set $HOME. To fix, create .config under /opt/valheim-server/, make it owned by valheim, and add HOME=/opt/valheim-server to the Environment in the systemd service.

I assume this explains why it runs via start_server.sh without issue, as users probably aren't using the service account (that you can't log in to) to run start_server.sh and thus have $HOME set in their environment already.

NOTE: !!! This likely changes the save folder location if you had a working setup. If you have saves already, make sure the end up in the right place under /opt/valheim-server/.config/... otherwise valheim will generate new worlds with the same name. (which you will have to replace with the correct worlds from the old save directory)

Pillgar commented on 2024-02-08 14:07 (UTC)

I'm seeing the same issue: service is running, doesn't appear in server list, can't connect with ip, while start_server.sh works. It appears the service might be the culprit.

Sisco88 commented on 2023-09-17 11:22 (UTC) (edited on 2023-09-17 11:34 (UTC) by Sisco88)

I cant seem to get this to run, i have enabled and started the service. But the server does not show up in the server list. When i add the server via ip it shows up but am unable to connect.

When running the server shell script by hand it works fine:

sudo ./start_server.sh

Splork commented on 2023-01-27 15:03 (UTC)

Oh, I was not aware of that.

I will look into it when I find some time. Alternatively, if you whip up something, you can send me a patch to the mail address in the PKGBUILD, and I would happily apply it.

roukoswarf commented on 2023-01-26 19:03 (UTC)

FYI the following line in the valheim-server.service does not work as intended, as bash substitutions will not work in a service file, and results in a broken path. While this does not prevent the server from starting, it does result in few extra logged warnings.

Environment="LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH"

It might be simplest to wrap the server executable in a shell script which does this, or any cleaner solution that could be made.

alanking commented on 2022-12-20 10:47 (UTC) (edited on 2022-12-20 10:55 (UTC) by alanking)

i did a manual update in the meantime using sudo steamcmd +force_install_dir "/opt/valheim-server/" +login anonymous +app_update 896660 validate +quit

thanks