콘텐츠로 건너뛰기
라이엇 비트

라이엇 비트

  • 집
  • 소식
  • 가이드
  • 비디오 가이드
  • 패치 노트
  • 남용 신고
  • 검색 양식 전환
발하임

발하임 – 전용 서버를 설정하는 방법 (리눅스)

에 게시됨 10/15/202110/15/2021 에 의해 aidalgol 코멘트 없음 ~에 발하임 – 전용 서버를 설정하는 방법 (리눅스)
  • 제목: 발하임
  • 출시일: 2월 2, 2021
  • 개발자: 아이언 게이트 AB
  • 발행자: 커피 얼룩 출판

All the guides I have found on setting up a dedicated Valheim server on Linux had gaps in one place or another, so I decided to document my own setup for the benefit of others. This guide is aimed at users wanting to set up the Valheim Dedicated Server on a headless Linux server. If you simply want to run this on an always-on desktop with a graphical login, this guide may not be as useful to you.

This guide is written for Debian 11 (bullseye), but much if not all of it will also apply to Ubuntu, as it is based on Debian. Credit has to go to the Hosting Servers guide on the Valheim Fandom wiki for basic information on how to invoke the server executable, which ports need to be exposed to the outside world, and configuration options.

Install the game via SteamCMD

SteamCMD is basically headless Steam for headless servers. We need it to download the Valheim Dedicated Server.

Set Up Multiarch

SteamCMD is provided by Debian, but as an i386 (32-bit x86) package, so you will need to add the i386 architecture to dpkg on your system to install i386 packages. (자세한 내용은 다음을 참조하세요. MultiArch/HOWTO on the Debian wiki.) 이를 수행하려면, run the following commands.

$ sudo dpkg --add-architecture
$ sudo apt-get update

Install SteamCMD

Now install SteamCMD itself.

$ sudo apt-get install steamcmd

Set up a Separate User and Group for Steam

It is always best to run services as a dedicated user and group from everything else on your system, so that if a service is compromised, an attacker can only access that service’s files. (We will further harden the Valheim system service later.) Normally you would create a “체계” user for system services, but Steam, even the headless SteamCMD, does not seem to behave properly unless it is run in a normal user environment. (See the man page adduser(8) for details on how a system user is different from a normal user.)

Create the steam user with the “adduser” 명령, disabling logins as we are only going to use this account via “sudo”.

$ sudo adduser --disabled-login steam

Run SteamCMD

슬프게도, SteamCMD does not have a very good interface, so this next part will be a bit awkward for those of you already familiar with the Linux command line. Run the commands as follows (command output is omitted.)

$ sudo -iu steam  # Opens a login shell as the "증기" 사용자.  See the man page sudo(8).
$ steamcmd
Steam>login anonymous
Steam>force_install_dir ./valheim/
# The Valheim server has a different appID from the client. 이것을 확인하십시오 링크.
증기>app_update 896660
증기>quit
^C

만약 “quit” command just leaves the program hanging with no prompt, type Ctrl+C to completely quit. This appears to be a bug in SteamCMD.

Now that you have the Valheim Dedicated Server installed, it’s time to set up the service to run it.

Run the Valheim Server via Systemd

The Valheim Dedicated Server comes with a wrapper script to run the server, but we are going to run the server executable directly for our systemd service unit.

The Systemd Unit

Write the following code to the file “/usr/local/lib/systemd/system/valheim.service”.

[단위]
Description=Valheim Dedicated Server
After=network-online.target

[서비스]
Type=exec
User=steam
Group=steam
Environment="LD_LIBRARY_PATH=/home/steam/valheim/linux64" "SteamAppId=892970"
ExecStart=/home/steam/valheim/valheim_server.x86_64 -name "I forgot to name my server" -세계 "Midgard" -포트 2456 -비밀번호 "비밀"

# Security settings
LockPersonality=true
NoNewPrivileges=true
RestrictRealtime=true
RestrictNamespaces=true
SystemCallArchitectures=native
SystemCallFilter=~@obsolete @clock @debug @module @mount @privileged @reboot @setuid @cpu-emulation
CapabilityBoundingSet=
RestrictAddressFamilies=AF_INET AF_INET6
RestrictSUIDSGID=true
PrivateDevices=true
PrivateTmp=true
PrivateMounts=true
PrivateUsers=true
ProtectControlGroups=true
ProtectHome=tmpfs
BindPaths=/home/steam
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectSystem=full
ProtectClock=true
ProtectKernelLogs=true
ProtectProc=invisible
ProtectHostname=true
RemoveIPC=true
InaccessiblePaths=/srv/

A full explanation of the systemd directives used in this unit is beyond the scope of this guide, but for those interested, the relevant man pages are as follows.

  • systemd.unit(5)
  • systemd.service(5)
  • systemd.exec(5)
  • systemd.resource-control(5)

Specifying a World

그만큼 “-세계” argument is optional; if you leave it out, the server will generate a world for you from a random seed on the first run.

그렇지 않으면, it specifies the name of a world to use, which must exist in the directory “/home/steam/.config/unity3d/IronGate/Valheim/worlds/”. In the systemd unit above, we specify the world named “Midgard”, so there must exist a file named “/home/steam/.config/unity3d/IronGate/Valheim/worlds/Midgard.fwl”. This lets you use a world copied from elsewhere.

If you want to use an existing world from your PC, keeping your progress, you must also copy the corresponding “.db” file to the same location as the “.fwl” 파일.

If you want to use a new world but with a specific seed, you must create the world with the game client, as the server provides no way of specifying a seed for the initial world creation.

Enabling the Service

That defines the service, but systemd does not know about it until it reloads units. Do this by running

$ sudo systemctl daemon-reload

Then enable it with

$ sudo systemctl enable valheim.service

Now the Valheim server will automatically start on boot, but not until the network is up (that’s what the line “After=network-online.target” does.) To start it now without rebooting, 달리다

$ sudo systemctl start valheim.service

이것이 오늘 우리가 공유하는 모든 것입니다. 발하임 가이드. 이 가이드는 원래 작성자가 작성하고 작성했습니다. aidalgol. 이 가이드를 업데이트하지 못한 경우, 다음을 수행하여 최신 업데이트를 찾을 수 있습니다. 링크.

이 사이트의 콘텐츠가 귀하의 권리를 침해한다고 생각하는 경우, 귀하의 지적 재산권을 포함하여, 문의 양식을 사용하여 즉시 문의하십시오..
가이드 태그:발하임

탐색 후

이전 게시물: Far Cry 6 – How to Get P226 Pistol
다음 게시물: 개가 성취 가이드를 잡아 당깁니다

답장을 남겨주세요 답장 취소

귀하의 이메일 주소는 공개되지 않습니다. 필수 입력란이 표시되어 있습니다 *

  • 제목: 발하임
  • 출시일: 2월 2, 2021
  • 개발자: 아이언 게이트 AB
  • 발행자: 커피 얼룩 출판

부인 성명

인용된 모든 콘텐츠는 해당 소스에서 파생됩니다.. 귀하의 콘텐츠를 허가 없이 사용했다고 생각되는 경우, 우리에게 연락하면 진지하게 받아 들일 것입니다..
  • 회사 소개
  • 문의하기
  • 개인 정보 정책
  • 서비스 약관

저작권 © 2025 라이엇 비트.

에 의해 구동 프레스북 뉴스 WordPress 테마