43,146
edits
(Updating to match new version of source page) |
(Updating to match new version of source page) |
||
Line 2: | Line 2: | ||
== Basic Setup == | == Basic Setup == | ||
===Ad-hoc Server=== | === Ad-hoc Server === | ||
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 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.) | 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.) | ||
Line 9: | Line 9: | ||
---- | ---- | ||
===Dedicated Server=== | === Dedicated Server === | ||
Alternatively the game ships with a dedicated server program that you can start and leave on permanently without needing to log in yourself. | Alternatively 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. | There are several ways to get a dedicated server up and running. | ||
Line 22: | Line 22: | ||
---- | ---- | ||
=== Dedicated Servers on Linux === | ==== Dedicated Servers on Linux ==== | ||
This describes how to set up the server as a service on Linux systems. | This describes how to set up the server as a service on Linux systems. | ||
===== Requirements | ===== Requirements ===== | ||
* [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. | |||
===== Setup the server ===== | |||
===== | |||
''' | '''1. Download the game''' | ||
<span style="color:#E16100">Advice: ''Create a separate directory for Vintage Story as the tar.gz does not contain a subfolder.''</span> | |||
<span style="color:#E16100">Advice: ''Create a | |||
mkdir server && cd server | mkdir server && cd server | ||
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''). | ||
wget https://cdn.vintagestory.at/gamefiles/stable/ | wget https://cdn.vintagestory.at/gamefiles/stable/vs_server_linux-x64_1.18.8.tar.gz | ||
''' | '''2. Extract tar.gz package''' | ||
tar xzf | tar xzf vs_server_linux-x64_*.*.*.tar.gz | ||
''' | '''3. Make server.sh script executable''' | ||
chmod +x server.sh | 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. | For security reasons you should not run the server as root user, so by default USERNAME is set to vintagestory. | ||
Line 87: | Line 64: | ||
VSPATH='<your-vs-directory>' | VSPATH='<your-vs-directory>' | ||
''' | '''5. Open the port at the firewall (if needed)''' | ||
firewalld | firewalld | ||
Line 95: | Line 72: | ||
iptables -A INPUT -p tcp -m tcp --dport 42420 -j ACCEPT | 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 | Wait for the startup to finish, then you can give yourself OP with | ||
./server.sh command "/op <youusername>" | ./server.sh command "/op <youusername>" | ||
''' | '''8. Connect to your IP/Domain and have fun''' | ||
---- | ---- | ||
==== | ==== 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 <code>DOTNET_ROOT</code> environment variable set. | |||
==== Updating Servers ==== | ==== Updating Servers ==== | ||
Line 187: | Line 132: | ||
==== Installation ==== | ==== Installation ==== | ||
''' | '''1. create a user''' | ||
adduser --shell /bin/bash --disabled-password gameserver | adduser --shell /bin/bash --disabled-password gameserver | ||
Line 205: | Line 141: | ||
mkdir -p /usr/lib/systemd/system | mkdir -p /usr/lib/systemd/system | ||
''' | '''2. Download the game''' | ||
cd /srv/gameserver/vintagestory | cd /srv/gameserver/vintagestory | ||
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''). | ||
wget https://cdn.vintagestory.at/gamefiles/stable/ | wget https://cdn.vintagestory.at/gamefiles/stable/vs_server_linux-x64_1.18.8.tar.gz | ||
''' | '''3. Extract tar.gz package''' | ||
tar xzf | tar xzf vs_server_linux-x64_1.18.8.tar.gz | ||
''' | |||
'''4. Change owner''' | |||
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 | ||
''' | '''5. Create systemd service unit file''' | ||
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) | ||
Line 233: | Line 170: | ||
[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 245: | Line 182: | ||
WantedBy=multi-user.target | WantedBy=multi-user.target | ||
''' | 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. | ||
'''6. Create config file for rsyslog''' | |||
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) | ||
Line 271: | Line 210: | ||
# Discard | # Discard | ||
if $programname == 'VSSRV' then ~ | if $programname == 'VSSRV' then ~ | ||
''' | '''7. restart rsyslog / enable service''' | ||
To activate rsyslog and your vintagestory server type these commands | To activate rsyslog and your vintagestory server type these commands | ||
systemctl restart rsyslog.service; | systemctl restart rsyslog.service; | ||
Line 331: | Line 270: | ||
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 |