Setting up a Multiplayer Server/de: Difference between revisions
(Created page with "'''2. Mono Installation'''") |
(Updating to match new version of source page) |
||
(17 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<languages/><br> | |||
== Einfache Einrichtung == | == Einfache Einrichtung == | ||
<div class="mw-translate-fuzzy"> | |||
===Lokaler Server=== | ===Lokaler Server=== | ||
Wenn du ein temporäres Multiplayer-Erlebnis haben möchtest, reicht es, eine Einzelspielerwelt zu öffnen und dann im Escape-Menü auf "Open to Lan" zu klicken. Dies ermöglicht es Spielern in Ihrem lokalen Netzwerk, dem Spiel beizutreten. | Wenn du ein temporäres Multiplayer-Erlebnis haben möchtest, reicht es, eine Einzelspielerwelt zu öffnen und dann im Escape-Menü auf "Open to Lan" zu klicken. Dies ermöglicht es Spielern in Ihrem lokalen Netzwerk, dem Spiel beizutreten. | ||
Wenn du Spielern außerhalb deines lokalen Netzwerks den Beitritt ermöglichen willst, kannst du auch auf "Open to Internet" klicken, wodurch versucht wird, eine externe Verbindung zu deinem Server aus dem Internet herzustellen. Dies geschieht über eine Technik namens UPnP, die auf deinem Internet-Router aktiviert sein muss, was oft standardmäßig der Fall ist. Kurz gesagt, wir schätzen, dass die Wahrscheinlichkeit, dass "Open to Internet" sofort und ohne Probleme funktioniert, bei etwa 60 % liegt. Wenn dies nicht der Fall ist, musst du eine so genannte "Portweiterleitung" auf deinem Internet-Router einrichten, was leider manchmal sehr schwierig und frustrierend sein kann. In diesem Fall musst du den TCP-Port 42420 an deinen Computer weiterleiten. (Google 'Portweiterleitung' mit dem Namen oder Modell Ihres Internet-Routers, um Hilfe zu finden.) | Wenn du Spielern außerhalb deines lokalen Netzwerks den Beitritt ermöglichen willst, kannst du auch auf "Open to Internet" klicken, wodurch versucht wird, eine externe Verbindung zu deinem Server aus dem Internet herzustellen. Dies geschieht über eine Technik namens UPnP, die auf deinem Internet-Router aktiviert sein muss, was oft standardmäßig der Fall ist. Kurz gesagt, wir schätzen, dass die Wahrscheinlichkeit, dass "Open to Internet" sofort und ohne Probleme funktioniert, bei etwa 60 % liegt. Wenn dies nicht der Fall ist, musst du eine so genannte "Portweiterleitung" auf deinem Internet-Router einrichten, was leider manchmal sehr schwierig und frustrierend sein kann. In diesem Fall musst du den TCP-Port 42420 an deinen Computer weiterleiten. (Google 'Portweiterleitung' mit dem Namen oder Modell Ihres Internet-Routers, um Hilfe zu finden.) | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
If you want a temporary multiplayer experience it is enough to open a single player world, then click on "Open to Lan" in the escape menu. This will allow players in your local network to join. | |||
If you want to allow players outside of your local network to join, you can then also click "Open to Internet" which will attempt to set up an external connection to join your server from the internet. This is done by a technique called UPnP and has to be enabled on your internet router, which it often is by default. In short, we estimate there's about a 60% success chance that 'Open to Internet' works instantly without issues. If it doesn't you would need to set up a so-called "port forwarding" on your internet router, which can be tricky and frustrating at times, unfortunately. You would need to forward TCP Port 42420 to your computer in that case. (Google 'Port forwarding' with the name or model of your internet router to find help.) | |||
</div> | |||
Damit dieser Server funktioniert, muss deine Einzelspielerwelt geöffnet bleiben. | Damit dieser Server funktioniert, muss deine Einzelspielerwelt geöffnet bleiben. | ||
---- | ---- | ||
<div class="mw-translate-fuzzy"> | |||
===Dedizierter Server=== | ===Dedizierter Server=== | ||
Alternativ wird das Spiel mit einem eigenen Serverprogramm ausgeliefert, das du starten und dauerhaft laufen lassen kannst, ohne dich selbst anmelden zu müssen. | Alternativ wird das Spiel mit einem eigenen Serverprogramm ausgeliefert, das du starten und dauerhaft laufen lassen kannst, ohne dich selbst anmelden zu müssen. | ||
Es gibt mehrere Möglichkeiten, einen dedizierten Server einzurichten und laufen zu lassen. | Es gibt mehrere Möglichkeiten, einen dedizierten Server einzurichten und laufen zu lassen. | ||
---- | ---- | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
As an alternative, the game ships with a dedicated server program that you can start and leave on permanently without needing to log in yourself. | |||
There are several ways to get a dedicated server up and running. | |||
</div> | |||
<div class="mw-translate-fuzzy"> | |||
==== Bezahlte Hosts ==== | ==== Bezahlte Hosts ==== | ||
Einige kommerzielle Hosting-Dienste bieten kostenpflichtiges Server-Hosting an. Derzeit wird das Hosting von Vintage Story von den Entwicklern des Spiels angeboten sowie: [https://pingperfect.com/ PingPerfect], [https://citadelservers.com/ Citadel Server], [https://www.creeperhost.net/ Creeperhost], [https://www.akliz.net/games/vintage-story Akliz] und [https://www.g-portal.com/en/gameserver/rent-a-vintage-story-server GPortal] | Einige kommerzielle Hosting-Dienste bieten kostenpflichtiges Server-Hosting an. Derzeit wird das Hosting von Vintage Story von den Entwicklern des Spiels angeboten sowie: [https://pingperfect.com/ PingPerfect], [https://citadelservers.com/ Citadel Server], [https://www.creeperhost.net/ Creeperhost], [https://www.akliz.net/games/vintage-story Akliz] und [https://www.g-portal.com/en/gameserver/rent-a-vintage-story-server GPortal] | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
See [[List of server hosting providers]] | |||
</div> | |||
<div class="mw-translate-fuzzy"> | |||
==== Dedizierte Server auf Windows ==== | ==== Dedizierte Server auf Windows ==== | ||
* Geben Sie den Anwendungsordner für das Spiel ein, standardmäßig ist das %appdata%/VintageStory | * Geben Sie den Anwendungsordner für das Spiel ein, standardmäßig ist das %appdata%/VintageStory | ||
Line 21: | Line 43: | ||
* Möglicherweise musst du eine Portweiterleitung auf deinem Internet-Router einrichten, wenn der Server von außerhalb deines lokalen Netzwerks (Internet) erreichbar sein soll. | * Möglicherweise musst du eine Portweiterleitung auf deinem Internet-Router einrichten, wenn der Server von außerhalb deines lokalen Netzwerks (Internet) erreichbar sein soll. | ||
---- | ---- | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
To keep your multiplayer server's settings from interfering with your single-player settings, use a custom --dataPath argument. | |||
</div> | |||
==== | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
'''Shortcut method:''' | |||
# Navigate to the location where you will store the server's data, such as a new VintagestoryServer folder created in <code>C:\Users\YourUsername\AppData\Roaming</code> | |||
# Create a folder for the server's data and give it a clear name, such as VSserverData | |||
# Open that folder and copy the entire path from the address bar of File Explorer. (example: <code>C:\Users\YourUsername\AppData\Roaming\VintagestoryServer\VSserverData</code>) | |||
# Open the game's application folder, it is <code>%appdata%/VintageStory</code> by default. | |||
# Create a shortcut of <code>VintagestoryServer.exe</code>. This can usually be accomplished through the right-click menu; google instructions specific to your operating system version if needed. | |||
# Open the Properties of the new shortcut. This can usually be accomplished through the right-click menu. | |||
# Click in the Target field of the shortcut's Properties, then go to the very end of what's written there. Add one space, then <code>--dataPath=</code>, then Paste the folder path you copied earlier, in quotes. The entire contents of the Target field should now be something like this: <code>"C:\Users\YourUsername\AppData\Roaming\Vintagestory\VintagestoryServer.exe" --dataPath="C:\Users\YourUsername\AppData\Roaming\VintagestoryServer\VSserverData"</code> | |||
* Optional: you can move/copy the shortcut, to your desktop and/or your new VintagestoryServer folder | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
'''Batch script method''' (functionally equivalent to the shortcut method above): | |||
# To create a batch script, simply create a blank text document and rename it with the .bat file extension. | |||
# You can edit it by right clicking and selecting edit. Then just type <code>%appdata%/Vintagestory/VintagestoryServer.exe --dataPath "[PATH]"</code> replacing [PATH] with the desired path for the server's data, then save and close. | |||
Running the script will run the server with the alternate datapath, and will generate its own collection of config files there. This is functionally equivalent to the modified link. | |||
</div> | |||
=== | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
' | Next: | ||
* Run the ''shortcut you made'' of <code>VintagestoryServer.exe</code> or the batch script. | |||
* If Windows Firewall asks for permission, grant any necessary access. | |||
* You might need to forward port 42420 on your internet router if you want the server to be accessible from outside of your local network (for example, anyone who isn't on the same WiFi as you). The process for this varies significantly; google instructions for your specific router model. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
===== Using Windows on a virtual machine ===== | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
There are some reports that LAN connection to a Vintage Story server running inside a Windows virtual machine (VM) can be slow, even when internet (WAN) connections have normal performance. This may depend on VM solution and network drivers. If this affects you, a suggested workaround is to use the Paravirtualized network adapter (virtio-net) for network adapters. The drivers are located [https://docs.oracle.com/en/virtualization/virtualbox/6.0/user/nichardware.html here]. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
---- | ---- | ||
</div> | |||
===== | <div class="mw-translate-fuzzy"> | ||
==== Dedizierte Server auf Linux ==== | |||
Hier wird beschrieben, wie du den Server als Dienst auf Linux-Systemen einrichtest. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
This describes how to set up the server as a service on Linux systems.<br> | |||
<span style="color:#E16100">Note: ''This section only works for x64 processors; if using ARM, please refer to the following section.''</span><br> | |||
</div> | |||
''' | <div class="mw-translate-fuzzy"> | ||
===== Voraussetzungen für CentOS 7 (RHEL, Fedora, ...) ===== | |||
'''1. EPEL/screen/wget/curl Installation''' | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
* [https://dotnet.microsoft.com/en-us/download/dotnet/7.0 .NET Runtime 7.0] This should be all needed to run a Vintagestory server. Everything else is just for convenience to start and manage it. | |||
* install <code>pgrep</code>, <code>screen</code> and <code>wget</code> using your systems package manager. | |||
</div> | |||
-- | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
===== Setup the server ===== | |||
</div> | |||
'''3. | <div class="mw-translate-fuzzy"> | ||
'''3. Lade das Spiel herunter''' | |||
</div> | |||
<span style="color:#E16100">Advice: '' | <div class="mw-translate-fuzzy"> | ||
<span style="color:#E16100">Advice: ''Erstelle ein separates Verzeichnis für Vintage Story, da die tar.gz-Datei keine Unterordner enthält.''</span> | |||
mkdir server && cd server | mkdir server && cd server | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Goto http://account.vintagestory.at/downloads<br> | Goto http://account.vintagestory.at/downloads<br> | ||
Copy the link of the newest " | Copy the link of the newest "vs_server_linux-x64_*.*.*.tar.gz" package ('''Linux Server (.tar.gz)''' under '''Show other available downloads of Vintage Story''')<br> | ||
Download with "wget" via console (''Vintage Story version 1. | Download with "wget" via console (''Vintage Story version 1.18.8 in this example''). | ||
</div> | |||
wget https://cdn.vintagestory.at/gamefiles/stable/ | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
wget https://cdn.vintagestory.at/gamefiles/stable/vs_server_linux-x64_1.18.8.tar.gz | |||
</div> | |||
''' | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
'''2. Extract tar.gz package''' | |||
</div> | |||
tar xzf | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
tar xzf vs_server_linux-x64_*.*.*.tar.gz | |||
</div> | |||
''' | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
'''3. Make server.sh script executable''' | |||
</div> | |||
chmod +x server.sh | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
chmod +x server.sh | |||
</div> | |||
''' | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
'''4. Edit server.sh file''' | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
For security reasons you should not run the server as root user, so by default USERNAME is set to vintagestory. | For security reasons you should not run the server as root user, so by default USERNAME is set to vintagestory. | ||
On most linux operating systems you can create a user with the command adduser. | On most linux operating systems you can create a user with the command adduser. | ||
</div> | |||
adduser vintagestory | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
adduser vintagestory | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Then change these options for your needs: | Then change these options for your needs: | ||
</div> | |||
USERNAME='<your-vs-server-username>' | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
USERNAME='<your-vs-server-username>' | |||
VSPATH='<your-vs-directory>' | VSPATH='<your-vs-directory>' | ||
</div> | |||
''' | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
'''5. Open the port at the firewall (if needed)''' | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
firewalld | firewalld | ||
firewall-cmd --permanent --zone=public --add-port=42420/tcp | firewall-cmd --permanent --zone=public --add-port=42420/tcp | ||
Line 94: | Line 178: | ||
iptables | iptables | ||
iptables -A INPUT -p tcp -m tcp --dport 42420 -j ACCEPT | iptables -A INPUT -p tcp -m tcp --dport 42420 -j ACCEPT | ||
</div> | |||
''' | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
'''6. Server start and first steps''' | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
./server.sh start | ./server.sh start | ||
Wait for the startup to finish, then you can give yourself OP with | Wait for the startup to finish, then you can give yourself OP with | ||
./server.sh command "/op <youusername>" | ./server.sh command "/op <youusername>" | ||
</div> | |||
''' | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
'''7. Connect to your IP/Domain and have fun''' | |||
---- | ---- | ||
</div> | |||
===== | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
==== Dedicated Servers on ARM64==== | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
<span style="color:#E16100">Note: ''Please note the ARM64 version is EXPERIMENTAL please report any issues to the [https://discord.com/channels/302152934249070593/1128220205181587516 discord ]''. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Currently (in game version 1.19.3 - 1.19.4, February 2024) no ARM64 .NET7 version of the '''Harmony''' patching library is available. Therefore coded mods which use Harmony will not work on an ARM64 server. If a beta of the Harmony library becomes available in future, server owners can try installing it for themselves.</span> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
The ARM64 version is available on [https://github.com/anegostudios/VintagestoryServerArm64 GitHub ] | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
I recommend using the install script located on the GitHub. The following is a step by step guide on how to use the script on a Debian based system (Ubuntu, Debian, Rasbian, etc). | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
1. Install the required dependencies to use this script by doing <code>apt -y install curl jq</code> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
2. Create a new file named <code>arminstall.sh</code> by running <code>vim arminstall.sh</code> or <code>nano arminstall.sh</code> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
3. Copy the contents of the <code>arminstall.sh</code> file from GitHub to your newly created file and save it by using <code>:wq</code> with Vim or <code>Ctrl + X</code>, then <code>Y</code>, then <code>Enter</code> with Nano. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
4. Make the script executable by running <code>chmod +x arminstall.sh</code> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
5. Run the script by doing <code>./arminstall.sh</code> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
6. Start the server by using <code>./VintagestoryServer</code> or <code>dotnet VintagestoryServer.dll</code> | |||
</div> | |||
to | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
This will download the latest version of Vintagestory to the current working directory, then replace the needed files to work with ARM. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
If at any time you want to update to the latest version of Vintage Story, simply run the script again. | |||
---- | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== Simple Server start command ==== | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
If you want to use a custom script or just manually start your server you can run | |||
dotnet VintagestoryServer.dll --dataPath /path/to/data | |||
Or | |||
./VintagestoryServer --dataPath /path/to/data | |||
if you have the <code>DOTNET_ROOT</code> environment variable set. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== Updating Servers ==== | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
If you want to install a newer version, remove all installation files first, or you'll get unforseeable behavior. If you chose a data folder inside the installation folder, make sure to not delete that one, or you'll loose your save games, settings and player data. | |||
Download the "Tar.gz Archive/Linux (server only)" file and extract it. If you have a remote installation and only a FTP connection to your server, you will have to unpack it locally and upload each file. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
== Basic Configuration == | == Basic Configuration == | ||
</div> | |||
Once your server is up and running you might want to look over some of the following configuration options. You can configure the server while its running through commands or by editing the serverconfig.json, for which the server needs to be stopped. | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
Once your server is up and running you might want to look over some of the following configuration options. You can configure the server while its running through commands or by editing the {{ll|Server Config|serverconfig.json}}, for which the server needs to be stopped first. | |||
On windows, by default this file is located at '''%appdata%/VintageStoryData/serverconfig.json'''. | On windows, by default this file is located at '''%appdata%/VintageStoryData/serverconfig.json'''. | ||
On Linux it's located at '''./data/serverconfig.json''' of your server directory (e.g. ''/home/vintagestory/server/data/serverconfig.json'' if setup like described here) | On Linux it's located at '''./data/serverconfig.json''' of your server directory (e.g. ''/home/vintagestory/server/data/serverconfig.json'' if setup like described here) | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
{{Protip|The easiest way to get a world configured to your wishes is to first create it in Single Player, using the advanced world creating options - and then upload it to use as your server world.}} | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
''Explanation of values in serverconfig.json you can find here: [[Server Config]]'' | ''Explanation of values in serverconfig.json you can find here: [[Server Config]]'' | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Here are some of the configurations set by commands, that you'd typically want to set. | Here are some of the configurations set by commands, that you'd typically want to set. | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
* <code>/serverconfig upnp [0|1]</code><br>If set to one, the game server will attempt to set up port forwarding for you | * <code>/serverconfig upnp [0|1]</code><br>If set to one, the game server will attempt to set up port forwarding for you | ||
* <code>/serverconfig name Peaceful PvE Server</code><br>Set up the server name, visible in the public server listing | * <code>/serverconfig name Peaceful PvE Server</code><br>Set up the server name, visible in the public server listing | ||
Line 160: | Line 299: | ||
* <code>/serverconfig password asdaf</code><br>Require a password for players to log in, if desired. Use <code>/serverconfig nopassword</code> to remove again. | * <code>/serverconfig password asdaf</code><br>Require a password for players to log in, if desired. Use <code>/serverconfig nopassword</code> to remove again. | ||
* <code>/serverconfig advertise (1|0)</code><br>Whether or not add this server to the public server listing | * <code>/serverconfig advertise (1|0)</code><br>Whether or not add this server to the public server listing | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Lastly, you can configure a server that was created with the 'Open to Lan' method in the same way as you do for dedicated ones, be aware though, in that case a few of the configurations are overridden by the client, such as the save file location. | Lastly, you can configure a server that was created with the 'Open to Lan' method in the same way as you do for dedicated ones, be aware though, in that case a few of the configurations are overridden by the client, such as the save file location. | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
===Acquiring server admin rights=== | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
If you have access to the server console, type <code>/op playername</code>. If not, open up the serverconfig.json and replace | |||
<code>"StartupCommands": null,</code> | |||
with | |||
<code>"StartupCommands": "/op playername",</code> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
In both instances you should replace <code>playername</code> with your actual player name. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
== Advanced Dedicated Server == | == Advanced Dedicated Server == | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
===Debian with systemd service and rsyslog=== | ===Debian with systemd service and rsyslog=== | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
If you prefer using systemd instead of screen to run your VS Server, you can follow these Instructions.<br> | If you prefer using systemd instead of screen to run your VS Server, you can follow these Instructions.<br> | ||
We also will setup rsyslog to split all logs into separate files.<br> | We also will setup rsyslog to split all logs into separate files.<br> | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== Installation ==== | ==== Installation ==== | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
'''1. create a user''' | |||
''' | |||
adduser --shell /bin/bash --disabled-password gameserver | adduser --shell /bin/bash --disabled-password gameserver | ||
</div> | |||
''' | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
'''2. create directories''' | |||
mkdir -p /srv/gameserver/vintagestory | mkdir -p /srv/gameserver/vintagestory | ||
mkdir -p /srv/gameserver/data/vs | mkdir -p /srv/gameserver/data/vs | ||
mkdir -p /usr/lib/systemd/system | mkdir -p /usr/lib/systemd/system | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
'''3. Download the game''' | '''3. Download the game''' | ||
cd /srv/gameserver/vintagestory | cd /srv/gameserver/vintagestory | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Goto http://account.vintagestory.at/downloads<br> | Goto http://account.vintagestory.at/downloads<br> | ||
Copy the link of the newest " | Copy the link of the newest "vs_server_linux-x64_*.*.*.tar.gz" package ('''Linux Server (.tar.gz)''' under '''Show other available downloads of Vintage Story''')<br> | ||
Download with "wget" via console (''Vintage Story version 1. | Download with "wget" via console (''Vintage Story version 1.18.8 in this example''). | ||
</div> | |||
wget https://cdn.vintagestory.at/gamefiles/stable/ | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
wget https://cdn.vintagestory.at/gamefiles/stable/vs_server_linux-x64_1.18.8.tar.gz | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
'''4. Extract tar.gz package''' | '''4. Extract tar.gz package''' | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
tar xzf vs_server_linux-x64_1.18.8.tar.gz | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
'''5. Change owner''' | '''5. Change owner''' | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
You have to set the owner of your gameserver directory to avoid write permission errors | You have to set the owner of your gameserver directory to avoid write permission errors | ||
chown -R gameserver:gameserver /srv/gameserver | chown -R gameserver:gameserver /srv/gameserver | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
'''6. Create systemd service unit file''' | '''6. Create systemd service unit file''' | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Use your favourite tool to create a service unit file (this example uses nano) | Use your favourite tool to create a service unit file (this example uses nano) | ||
nano /usr/lib/systemd/system/vintagestoryserver.service | nano /usr/lib/systemd/system/vintagestoryserver.service | ||
Line 217: | Line 395: | ||
[Service] | [Service] | ||
WorkingDirectory=/srv/gameserver/vintagestory | WorkingDirectory=/srv/gameserver/vintagestory | ||
ExecStart= | ExecStart=dotnet VintagestoryServer.dll --dataPath /srv/gameserver/data/vs | ||
Restart=always | Restart=always | ||
RestartSec=30 | RestartSec=30 | ||
Line 228: | Line 406: | ||
[Install] | [Install] | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Make sure the new user has access to the <code>dotnet</code> command or replace the command with the full path to where you installed the dotnet runtime (if you picked a custom install). Or you can also use <code>ExecStart=VintagestoryServer --dataPath /srv/gameserver/data/vs</code> if you have the <code>DOTNET_ROOT</code> environment variable set. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
'''7. Create config file for rsyslog''' | '''7. Create config file for rsyslog''' | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Use your favourite tool to create a rsyslog config file (this example uses nano) | Use your favourite tool to create a rsyslog config file (this example uses nano) | ||
nano /etc/rsyslog.d/vintagestoryserver.conf | nano /etc/rsyslog.d/vintagestoryserver.conf | ||
Line 255: | Line 441: | ||
# Discard | # Discard | ||
if $programname == 'VSSRV' then ~ | if $programname == 'VSSRV' then ~ | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
'''8. restart rsyslog / enable service''' | '''8. restart rsyslog / enable service''' | ||
To activate rsyslog and your vintagestory server type these commands | To activate rsyslog and your vintagestory server type these commands | ||
Line 260: | Line 449: | ||
systemctl enable vintagestoryserver.service | systemctl enable vintagestoryserver.service | ||
systemctl start vintagestoryserver.service | systemctl start vintagestoryserver.service | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
---- | ---- | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== Stop, Start, Disable Server ==== | ==== Stop, Start, Disable Server ==== | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
To manually stop your VS Server use this command | To manually stop your VS Server use this command | ||
systemctl stop vintagestoryserver.service | systemctl stop vintagestoryserver.service | ||
Line 271: | Line 466: | ||
To disable the service use | To disable the service use | ||
systemctl disable vintagestoryserver.service | systemctl disable vintagestoryserver.service | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== Config ==== | ==== Config ==== | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
to change your servers configuration, stop the server and edit | to change your servers configuration, stop the server and edit | ||
nano /srv/gameserver/data/vs/serverconfig.json | nano /srv/gameserver/data/vs/serverconfig.json | ||
After you saved your changes, start server again. | After you saved your changes, start server again. | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== Restart schedule ==== | ==== Restart schedule ==== | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
If you want your server to restart every day, you can setup a cronjob for this | If you want your server to restart every day, you can setup a cronjob for this | ||
crontab -e | crontab -e | ||
Line 288: | Line 491: | ||
If you just want to restart the server this line instead of the other two should be fine | If you just want to restart the server this line instead of the other two should be fine | ||
30 4 * * * systemctl restart vintagestoryserver.service | 30 4 * * * systemctl restart vintagestoryserver.service | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== Logging ==== | ==== Logging ==== | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
The rsyslog config splits the output logs into seperate files that you can watch with tail command<br> | The rsyslog config splits the output logs into seperate files that you can watch with tail command<br> | ||
For Login/Logout see | For Login/Logout see | ||
Line 306: | Line 513: | ||
For all other messages see | For all other messages see | ||
tail -f /var/log/vintagestory-server/other.log | tail -f /var/log/vintagestory-server/other.log | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==== Multiple Server Instances ==== | ==== Multiple Server Instances ==== | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
If you want to run multiple instances on the same machine you just have to redo some of the steps above. This is just an example for a second instance: | If you want to run multiple instances on the same machine you just have to redo some of the steps above. This is just an example for a second instance: | ||
</div> | |||
mkdir -p /srv/gameserver/data/vs2 | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
mkdir -p /srv/gameserver/data/vs2 | |||
nano /usr/lib/systemd/system/vintagestoryserver2.service | nano /usr/lib/systemd/system/vintagestoryserver2.service | ||
Copy from step 6 and change these lines: | Copy from step 6 and change these lines: | ||
Description=Vintage Story Server 2 Unit | Description=Vintage Story Server 2 Unit | ||
ExecStart= | ExecStart=dotnet VintagestoryServer.dll --dataPath /srv/gameserver/data/vs2 | ||
SyslogIdentifier=VSSRV2 | SyslogIdentifier=VSSRV2 | ||
Create rsyslog file and copy code from step 7 | Create rsyslog file and copy code from step 7 | ||
Line 331: | Line 544: | ||
Insert | Insert | ||
30 4 * * * systemctl restart vintagestoryserver2.service | 30 4 * * * systemctl restart vintagestoryserver2.service | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Have Fun! | Have Fun! | ||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
==Advanced setup== | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
===Using an SRV Record to point a domain to your server=== | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
In some cases, you may not able to get a server with the default port (Multiple instances on the same server, paid hosts...), and you will have to add the port at the end of the server's address in order to connect to it.<br> | |||
But you might want to avoid the need to specify the port (Easier to remember, look cleaner). | |||
There is a way to point a domain to your server and avoid the need to add the port : SRV Records<br> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
SRV Records allow you to point a domain/subdomain to your instance, while letting the game know the port to use.<br> | |||
How to set up an SRV Records will depend on your domain provider, and you should check on their documentation before making any changes. However, the idea and values remain the same for every provider.<br> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Let's take a server with the following details : | |||
* Address : <code>play.example.com</code> | |||
* Port : <code>50030</code> | |||
* Owned domain : <code>mydomain.com</code> | |||
* Desired subdomain : <code>vintagestory.mydomain.com</code> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Your raw SRV Records should look something like this : | |||
_vintagestory._tcp.vintagestory.mydomain.com. IN SRV 10 10 50030 server.example.com. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
The underscores and trailing dots are important! Here are some details : | |||
* <code>_vintagestory</code> define the service, in our case, Vintage Story<br> | |||
* <code>_tcp</code> define the protocol, Vintage Story use TCP<br> | |||
* <code>vintagestory.mydomain.com.</code> is the subdomain we want to use. The trailing dot is important!<br> | |||
* <code>IN SRV</code> Define the record type, don't change this<br> | |||
* <code>10 10</code> are in order the priority and the weight of our record, in our case those are not important, as you are probably not going to load balance a Vintage Story server<br> | |||
* <code>50030</code> is the port our instance is listening on<br> | |||
* <code>server.example.com.</code> is the target, where the server is located. The trailing dot is mandatory as the target server is not on the same domain as us. If it was the case, you would only need to add the subdomain of the target without the trailing dot<br> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
If you wanted to have your record pointing to your domain directly, you would have <code>mydomain.com.</code> instead of <code>vintagestory.mydomain.com.</code> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Here is how to do it for OVH and Hetzner (Don't forget to edit the values to suit your setup !) : | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
====OVH==== | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
You will need to go to your DNS zone and add an entry, select the SRV Record type : | |||
* Sub-domain : <code>_vintagestory._tcp.vintagestory</code> You don't need to add your domain, as their form do it for you. | |||
* TTL : No need to change this | |||
* Priority : <code>10</code> | |||
* Weight : <code>10</code> | |||
* Port : <code>50030</code> | |||
* Target : <code>server.example.com.</code> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
====Hetzner==== | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
You will need to create a record from their DNS Console : | |||
* Type : <code>SRV</code> | |||
* Name : <code>_vintagestory._tcp.vintagestory.mydomain.com.</code> | |||
Click on the Value field to enter the details : | |||
* Priority : <code>10</code> | |||
* Weight : <code>10</code> | |||
* Port : <code>50030</code> | |||
* Target : <code>server.example.com.</code> | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
Wait a few minutes for your record to propagate and then try to use it to connect to the server, using <code>vintagestory.mydomain.com</code> as the address. | |||
</div> | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | |||
You are now all set up to share your server with your custom domain. | |||
</div> | |||
{{Game navbox}} |
Latest revision as of 16:46, 9 July 2024
Einfache Einrichtung
Lokaler Server
Wenn du ein temporäres Multiplayer-Erlebnis haben möchtest, reicht es, eine Einzelspielerwelt zu öffnen und dann im Escape-Menü auf "Open to Lan" zu klicken. Dies ermöglicht es Spielern in Ihrem lokalen Netzwerk, dem Spiel beizutreten. Wenn du Spielern außerhalb deines lokalen Netzwerks den Beitritt ermöglichen willst, kannst du auch auf "Open to Internet" klicken, wodurch versucht wird, eine externe Verbindung zu deinem Server aus dem Internet herzustellen. Dies geschieht über eine Technik namens UPnP, die auf deinem Internet-Router aktiviert sein muss, was oft standardmäßig der Fall ist. Kurz gesagt, wir schätzen, dass die Wahrscheinlichkeit, dass "Open to Internet" sofort und ohne Probleme funktioniert, bei etwa 60 % liegt. Wenn dies nicht der Fall ist, musst du eine so genannte "Portweiterleitung" auf deinem Internet-Router einrichten, was leider manchmal sehr schwierig und frustrierend sein kann. In diesem Fall musst du den TCP-Port 42420 an deinen Computer weiterleiten. (Google 'Portweiterleitung' mit dem Namen oder Modell Ihres Internet-Routers, um Hilfe zu finden.)
If you want a temporary multiplayer experience it is enough to open a single player world, then click on "Open to Lan" in the escape menu. This will allow players in your local network to join. If you want to allow players outside of your local network to join, you can then also click "Open to Internet" which will attempt to set up an external connection to join your server from the internet. This is done by a technique called UPnP and has to be enabled on your internet router, which it often is by default. In short, we estimate there's about a 60% success chance that 'Open to Internet' works instantly without issues. If it doesn't you would need to set up a so-called "port forwarding" on your internet router, which can be tricky and frustrating at times, unfortunately. You would need to forward TCP Port 42420 to your computer in that case. (Google 'Port forwarding' with the name or model of your internet router to find help.)
Damit dieser Server funktioniert, muss deine Einzelspielerwelt geöffnet bleiben.
Dedizierter Server
Alternativ wird das Spiel mit einem eigenen Serverprogramm ausgeliefert, das du starten und dauerhaft laufen lassen kannst, ohne dich selbst anmelden zu müssen. Es gibt mehrere Möglichkeiten, einen dedizierten Server einzurichten und laufen zu lassen.
As an alternative, the game ships with a dedicated server program that you can start and leave on permanently without needing to log in yourself. There are several ways to get a dedicated server up and running.
Bezahlte Hosts
Einige kommerzielle Hosting-Dienste bieten kostenpflichtiges Server-Hosting an. Derzeit wird das Hosting von Vintage Story von den Entwicklern des Spiels angeboten sowie: PingPerfect, Citadel Server, Creeperhost, Akliz und GPortal
Dedizierte Server auf Windows
- Geben Sie den Anwendungsordner für das Spiel ein, standardmäßig ist das %appdata%/VintageStory
- Starte VintagestoryServer.exe
- Möglicherweise musst du eine Portweiterleitung auf deinem Internet-Router einrichten, wenn der Server von außerhalb deines lokalen Netzwerks (Internet) erreichbar sein soll.
To keep your multiplayer server's settings from interfering with your single-player settings, use a custom --dataPath argument.
Shortcut method:
- Navigate to the location where you will store the server's data, such as a new VintagestoryServer folder created in
C:\Users\YourUsername\AppData\Roaming
- Create a folder for the server's data and give it a clear name, such as VSserverData
- Open that folder and copy the entire path from the address bar of File Explorer. (example:
C:\Users\YourUsername\AppData\Roaming\VintagestoryServer\VSserverData
) - Open the game's application folder, it is
%appdata%/VintageStory
by default. - Create a shortcut of
VintagestoryServer.exe
. This can usually be accomplished through the right-click menu; google instructions specific to your operating system version if needed. - Open the Properties of the new shortcut. This can usually be accomplished through the right-click menu.
- Click in the Target field of the shortcut's Properties, then go to the very end of what's written there. Add one space, then
--dataPath=
, then Paste the folder path you copied earlier, in quotes. The entire contents of the Target field should now be something like this:"C:\Users\YourUsername\AppData\Roaming\Vintagestory\VintagestoryServer.exe" --dataPath="C:\Users\YourUsername\AppData\Roaming\VintagestoryServer\VSserverData"
- Optional: you can move/copy the shortcut, to your desktop and/or your new VintagestoryServer folder
Batch script method (functionally equivalent to the shortcut method above):
- To create a batch script, simply create a blank text document and rename it with the .bat file extension.
- You can edit it by right clicking and selecting edit. Then just type
%appdata%/Vintagestory/VintagestoryServer.exe --dataPath "[PATH]"
replacing [PATH] with the desired path for the server's data, then save and close.
Running the script will run the server with the alternate datapath, and will generate its own collection of config files there. This is functionally equivalent to the modified link.
Next:
- Run the shortcut you made of
VintagestoryServer.exe
or the batch script. - If Windows Firewall asks for permission, grant any necessary access.
- You might need to forward port 42420 on your internet router if you want the server to be accessible from outside of your local network (for example, anyone who isn't on the same WiFi as you). The process for this varies significantly; google instructions for your specific router model.
Using Windows on a virtual machine
There are some reports that LAN connection to a Vintage Story server running inside a Windows virtual machine (VM) can be slow, even when internet (WAN) connections have normal performance. This may depend on VM solution and network drivers. If this affects you, a suggested workaround is to use the Paravirtualized network adapter (virtio-net) for network adapters. The drivers are located here.
Dedizierte Server auf Linux
Hier wird beschrieben, wie du den Server als Dienst auf Linux-Systemen einrichtest.
This describes how to set up the server as a service on Linux systems.
Note: This section only works for x64 processors; if using ARM, please refer to the following section.
Voraussetzungen für CentOS 7 (RHEL, Fedora, ...)
1. EPEL/screen/wget/curl Installation
- .NET Runtime 7.0 This should be all needed to run a Vintagestory server. Everything else is just for convenience to start and manage it.
- install
pgrep
,screen
andwget
using your systems package manager.
Setup the server
3. Lade das Spiel herunter
Advice: Erstelle ein separates Verzeichnis für Vintage Story, da die tar.gz-Datei keine Unterordner enthält.
mkdir server && cd server
Goto http://account.vintagestory.at/downloads
Copy the link of the newest "vs_server_linux-x64_*.*.*.tar.gz" package (Linux Server (.tar.gz) under Show other available downloads of Vintage Story)
Download with "wget" via console (Vintage Story version 1.18.8 in this example).
2. Extract tar.gz package
tar xzf vs_server_linux-x64_*.*.*.tar.gz
3. Make server.sh script executable
chmod +x server.sh
4. Edit server.sh file
For security reasons you should not run the server as root user, so by default USERNAME is set to vintagestory. On most linux operating systems you can create a user with the command adduser.
adduser vintagestory
Then change these options for your needs:
USERNAME='<your-vs-server-username>'
VSPATH='<your-vs-directory>'
5. Open the port at the firewall (if needed)
firewalld
firewall-cmd --permanent --zone=public --add-port=42420/tcp firewall-cmd --reload
iptables
iptables -A INPUT -p tcp -m tcp --dport 42420 -j ACCEPT
6. Server start and first steps
./server.sh start Wait for the startup to finish, then you can give yourself OP with ./server.sh command "/op <youusername>"
7. Connect to your IP/Domain and have fun
Dedicated Servers on ARM64
Note: Please note the ARM64 version is EXPERIMENTAL please report any issues to the discord .
Currently (in game version 1.19.3 - 1.19.4, February 2024) no ARM64 .NET7 version of the Harmony patching library is available. Therefore coded mods which use Harmony will not work on an ARM64 server. If a beta of the Harmony library becomes available in future, server owners can try installing it for themselves.
The ARM64 version is available on GitHub
I recommend using the install script located on the GitHub. The following is a step by step guide on how to use the script on a Debian based system (Ubuntu, Debian, Rasbian, etc).
1. Install the required dependencies to use this script by doing apt -y install curl jq
2. Create a new file named arminstall.sh
by running vim arminstall.sh
or nano arminstall.sh
3. Copy the contents of the arminstall.sh
file from GitHub to your newly created file and save it by using :wq
with Vim or Ctrl + X
, then Y
, then Enter
with Nano.
4. Make the script executable by running chmod +x arminstall.sh
5. Run the script by doing ./arminstall.sh
6. Start the server by using ./VintagestoryServer
or dotnet VintagestoryServer.dll
This will download the latest version of Vintagestory to the current working directory, then replace the needed files to work with ARM.
If at any time you want to update to the latest version of Vintage Story, simply run the script again.
Simple Server start command
If you want to use a custom script or just manually start your server you can run
dotnet VintagestoryServer.dll --dataPath /path/to/data
Or
./VintagestoryServer --dataPath /path/to/data
if you have the DOTNET_ROOT
environment variable set.
Updating Servers
If you want to install a newer version, remove all installation files first, or you'll get unforseeable behavior. If you chose a data folder inside the installation folder, make sure to not delete that one, or you'll loose your save games, settings and player data. Download the "Tar.gz Archive/Linux (server only)" file and extract it. If you have a remote installation and only a FTP connection to your server, you will have to unpack it locally and upload each file.
Basic Configuration
Once your server is up and running you might want to look over some of the following configuration options. You can configure the server while its running through commands or by editing the serverconfig.json , for which the server needs to be stopped first. On windows, by default this file is located at %appdata%/VintageStoryData/serverconfig.json. On Linux it's located at ./data/serverconfig.json of your server directory (e.g. /home/vintagestory/server/data/serverconfig.json if setup like described here)
Protip:
The easiest way to get a world configured to your wishes is to first create it in Single Player, using the advanced world creating options - and then upload it to use as your server world. |
Explanation of values in serverconfig.json you can find here: Server Config
Here are some of the configurations set by commands, that you'd typically want to set.
/serverconfig upnp [0|1]
If set to one, the game server will attempt to set up port forwarding for you/serverconfig name Peaceful PvE Server
Set up the server name, visible in the public server listing/serverconfig description This is a medieval survival server, PvE only, everyone welcome! <3
Set up the servers description, visible in the public server listing/serverconfig motd Hi {playername}! Please remember to follow the rules!
The message shown to players when they join/serverconfig password asdaf
Require a password for players to log in, if desired. Use/serverconfig nopassword
to remove again./serverconfig advertise (1|0)
Whether or not add this server to the public server listing
Lastly, you can configure a server that was created with the 'Open to Lan' method in the same way as you do for dedicated ones, be aware though, in that case a few of the configurations are overridden by the client, such as the save file location.
Acquiring server admin rights
If you have access to the server console, type /op playername
. If not, open up the serverconfig.json and replace
"StartupCommands": null,
with
"StartupCommands": "/op playername",
In both instances you should replace playername
with your actual player name.
Advanced Dedicated Server
Debian with systemd service and rsyslog
If you prefer using systemd instead of screen to run your VS Server, you can follow these Instructions.
We also will setup rsyslog to split all logs into separate files.
Installation
1. create a user
adduser --shell /bin/bash --disabled-password gameserver
2. create directories
mkdir -p /srv/gameserver/vintagestory mkdir -p /srv/gameserver/data/vs mkdir -p /usr/lib/systemd/system
3. Download the game
cd /srv/gameserver/vintagestory
Goto http://account.vintagestory.at/downloads
Copy the link of the newest "vs_server_linux-x64_*.*.*.tar.gz" package (Linux Server (.tar.gz) under Show other available downloads of Vintage Story)
Download with "wget" via console (Vintage Story version 1.18.8 in this example).
4. Extract tar.gz package
tar xzf vs_server_linux-x64_1.18.8.tar.gz
5. Change owner
You have to set the owner of your gameserver directory to avoid write permission errors
chown -R gameserver:gameserver /srv/gameserver
6. Create systemd service unit file
Use your favourite tool to create a service unit file (this example uses nano)
nano /usr/lib/systemd/system/vintagestoryserver.service
Insert the following content
[Unit] Description=Vintage Story Server Unit After=network.target [Service] WorkingDirectory=/srv/gameserver/vintagestory ExecStart=dotnet VintagestoryServer.dll --dataPath /srv/gameserver/data/vs Restart=always RestartSec=30 StandardOutput=syslog StandardError=syslog SyslogIdentifier=VSSRV User=gameserver Group=gameserver [Install] WantedBy=multi-user.target
Make sure the new user has access to the dotnet
command or replace the command with the full path to where you installed the dotnet runtime (if you picked a custom install). Or you can also use ExecStart=VintagestoryServer --dataPath /srv/gameserver/data/vs
if you have the DOTNET_ROOT
environment variable set.
7. Create config file for rsyslog
Use your favourite tool to create a rsyslog config file (this example uses nano)
nano /etc/rsyslog.d/vintagestoryserver.conf
Insert the following content
if $programname == 'VSSRV' then { if($msg contains "Chat") then { action(type="omfile" dirCreateMode="0755" FileCreateMode="0644" File="/var/log/vintagestory-server/chat.log") } else if($msg contains "verließ") then { action(type="omfile" dirCreateMode="0755" FileCreateMode="0644" File="/var/log/vintagestory-server/login.log") } else if($msg contains "join") then { action(type="omfile" dirCreateMode="0755" FileCreateMode="0644" File="/var/log/vintagestory-server/login.log") } else if($msg contains "Server Warning") then { action(type="omfile" dirCreateMode="0755" FileCreateMode="0644" File="/var/log/vintagestory-server/warn.log") } else if($msg contains "Server Notification") then { action(type="omfile" dirCreateMode="0755" FileCreateMode="0644" File="/var/log/vintagestory-server/info.log") } else if($msg contains "Server Debug") then { action(type="omfile" dirCreateMode="0755" FileCreateMode="0644" File="/var/log/vintagestory-server/debug.log") } else if($msg contains "Server Event") then { action(type="omfile" dirCreateMode="0755" FileCreateMode="0644" File="/var/log/vintagestory-server/event.log") } else { action(type="omfile" dirCreateMode="0755" FileCreateMode="0644" File="/var/log/vintagestory-server/other.log") } } # Discard if $programname == 'VSSRV' then ~
8. restart rsyslog / enable service To activate rsyslog and your vintagestory server type these commands
systemctl restart rsyslog.service; systemctl enable vintagestoryserver.service systemctl start vintagestoryserver.service
Stop, Start, Disable Server
To manually stop your VS Server use this command
systemctl stop vintagestoryserver.service
To manually start your VS Server again type
systemctl start vintagestoryserver.service
To disable the service use
systemctl disable vintagestoryserver.service
Config
to change your servers configuration, stop the server and edit
nano /srv/gameserver/data/vs/serverconfig.json
After you saved your changes, start server again.
Restart schedule
If you want your server to restart every day, you can setup a cronjob for this
crontab -e
insert this line to stop the server at 04:30
30 4 * * * systemctl stop vintagestoryserver.service
you could now ececute backup tasks and then start it again with the next line at 04:32 (if you run a backup task plan some more time here)
32 4 * * * systemctl start vintagestoryserver
If you just want to restart the server this line instead of the other two should be fine
30 4 * * * systemctl restart vintagestoryserver.service
Logging
The rsyslog config splits the output logs into seperate files that you can watch with tail command
For Login/Logout see
tail -f /var/log/vintagestory-server/login.log
For all chat messages see
tail -f /var/log/vintagestory-server/chat.log
For all messages containing [Server Warning] see
tail -f /var/log/vintagestory-server/warn.log
For all messages containing [Server Notification] see
tail -f /var/log/vintagestory-server/info.log
For all messages containing [Server Debug] see
tail -f /var/log/vintagestory-server/debug.log
For all messages containing [Server Event] see
tail -f /var/log/vintagestory-server/event.log
For all other messages see
tail -f /var/log/vintagestory-server/other.log
Multiple Server Instances
If you want to run multiple instances on the same machine you just have to redo some of the steps above. This is just an example for a second instance:
mkdir -p /srv/gameserver/data/vs2
nano /usr/lib/systemd/system/vintagestoryserver2.service
Copy from step 6 and change these lines:
Description=Vintage Story Server 2 Unit ExecStart=dotnet VintagestoryServer.dll --dataPath /srv/gameserver/data/vs2 SyslogIdentifier=VSSRV2
Create rsyslog file and copy code from step 7
nano /etc/rsyslog.d/vintagestoryserver2.conf
Change VSSRV
to VSSRV2
and /var/log/vintagestory-server
to /var/log/vintagestory-server2
Before you proceed make a copy of your first server configuration and edit it for your needs (change port!!!)
cp /srv/gameserver/data/vs/serverconfig.json /srv/gameserver/data/vs2/ nano /srv/gameserver/data/vs2/serverconfig.json
Now start the service
systemctl restart rsyslog.service; systemctl enable vintagestoryserver2.service systemctl start vintagestoryserver2.service
Install cronjob
crontab -e
Insert
30 4 * * * systemctl restart vintagestoryserver2.service
Have Fun!
Advanced setup
Using an SRV Record to point a domain to your server
In some cases, you may not able to get a server with the default port (Multiple instances on the same server, paid hosts...), and you will have to add the port at the end of the server's address in order to connect to it.
But you might want to avoid the need to specify the port (Easier to remember, look cleaner).
There is a way to point a domain to your server and avoid the need to add the port : SRV Records
SRV Records allow you to point a domain/subdomain to your instance, while letting the game know the port to use.
How to set up an SRV Records will depend on your domain provider, and you should check on their documentation before making any changes. However, the idea and values remain the same for every provider.
Let's take a server with the following details :
- Address :
play.example.com
- Port :
50030
- Owned domain :
mydomain.com
- Desired subdomain :
vintagestory.mydomain.com
Your raw SRV Records should look something like this :
_vintagestory._tcp.vintagestory.mydomain.com. IN SRV 10 10 50030 server.example.com.
The underscores and trailing dots are important! Here are some details :
_vintagestory
define the service, in our case, Vintage Story_tcp
define the protocol, Vintage Story use TCPvintagestory.mydomain.com.
is the subdomain we want to use. The trailing dot is important!IN SRV
Define the record type, don't change this10 10
are in order the priority and the weight of our record, in our case those are not important, as you are probably not going to load balance a Vintage Story server50030
is the port our instance is listening onserver.example.com.
is the target, where the server is located. The trailing dot is mandatory as the target server is not on the same domain as us. If it was the case, you would only need to add the subdomain of the target without the trailing dot
If you wanted to have your record pointing to your domain directly, you would have mydomain.com.
instead of vintagestory.mydomain.com.
Here is how to do it for OVH and Hetzner (Don't forget to edit the values to suit your setup !) :
OVH
You will need to go to your DNS zone and add an entry, select the SRV Record type :
- Sub-domain :
_vintagestory._tcp.vintagestory
You don't need to add your domain, as their form do it for you. - TTL : No need to change this
- Priority :
10
- Weight :
10
- Port :
50030
- Target :
server.example.com.
Hetzner
You will need to create a record from their DNS Console :
- Type :
SRV
- Name :
_vintagestory._tcp.vintagestory.mydomain.com.
Click on the Value field to enter the details :
- Priority :
10
- Weight :
10
- Port :
50030
- Target :
server.example.com.
Wait a few minutes for your record to propagate and then try to use it to connect to the server, using vintagestory.mydomain.com
as the address.
You are now all set up to share your server with your custom domain.
Wiki Navigation | |
---|---|
Vintage Story | Guides • Frequently Asked Questions • Soundtrack • Versions • Controls |
Game systems | Crafting • Knapping • Clay forming • Smithing • Cooking • Temperature • Hunger • Mining • Temporal stability • Mechanical power • Trading • Farming • Animal husbandry |
World | World generation • Biomes • Weather • Temporal storms |
Items | Tools • Weapons • Armor • Clothing • Bags • Materials • Food |
Blocks | Terrain • Plants • Decorative • Lighting • Functional • Ore |
Entities | Hostile entities • Animals • NPCs • Players |
Miscellaneous | List of client commands • List of server commands • Creative Starter Guide • Bot System • WorldEdit • Cinematic Camera • Adjustable FPS Video Recording • ServerBlockTicking |