Server Setup: Difference between revisions

Content deleted Content added
Embri (talk | contribs)
added versions
m justify the text for a better readability
Line 1: Line 1:
__TOC__
__TOC__
<div align="justify">
A '''server''' is a way of running Minecraft that separates the game into two parts. The ''server'' simulates the world, while a ''client'' displays and handles input/output from each player. The two communicate constantly to create the game. Running GT:NH as a separate server is required for more than one player to access the same world. A Minecraft license is not required for the server, but each player connecting must have a valid Minecraft account. Servers need to be online to authenticate joining players.
A '''server''' is a way of running Minecraft that separates the game into two parts. The ''server'' simulates the world, while a ''client'' displays and handles input/output from each player. The two communicate constantly to create the game. Running GT:NH as a separate server is required for more than one player to access the same world. A Minecraft license is not required for the server, but each player connecting must have a valid Minecraft account. Servers need to be online to authenticate joining players.
</div>


==== Pros/Cons ====
==== Pros/Cons ====
<div align="justify">
Servers enable multiplayer fun, can improve TPS even in a single player (SP) world on the same machine, allow chunk-loaded areas to run 24/7 for passive resource production, and supports party progress in the [[Quest Book]]. They also have some downsides; while running a server/client split can improve performance for SP, it's more prone to bugs and stability issues. Having machines running constantly can cause breakdowns if [[maintenance]] isn't automated or something unforeseen happens. Servers are more complicated to set up than a SP instance of GT:NH and require regular technical support (restarts, backups, updates, lag-busting, etc.)
Servers enable multiplayer fun, can improve TPS even in a single player (SP) world on the same machine, allow chunk-loaded areas to run 24/7 for passive resource production, and supports party progress in the [[Quest Book]]. They also have some downsides; while running a server/client split can improve performance for SP, it's more prone to bugs and stability issues. Having machines running constantly can cause breakdowns if [[maintenance]] isn't automated or something unforeseen happens. Servers are more complicated to set up than a SP instance of GT:NH and require regular technical support (restarts, backups, updates, lag-busting, etc.)
</div>


==== Versions ====
==== Versions ====
<div align="justify">
Servers can run either the Java8 or Java17+ build of GT:NH. '''Java17+ is strongly recommended''' unless a hybrid Thermos, Crucible or Ultramine server software setup is being deployed. Players connecting to the server can run either Java8 or Java17+ with their own launcher; it doesn't have to match the server, nor do all players need to use the same launcher to play. The ''version'' of GTNH (ex. 2.4.0) must match exactly between all clients and the server. If the server updates to a different version, all players will have to update as well to join again.
Servers can run either the Java8 or Java17+ build of GT:NH. '''Java17+ is strongly recommended''' unless a hybrid Thermos, Crucible or Ultramine server software setup is being deployed. Players connecting to the server can run either Java8 or Java17+ with their own launcher; it doesn't have to match the server, nor do all players need to use the same launcher to play. The ''version'' of GTNH (ex. 2.4.0) must match exactly between all clients and the server. If the server updates to a different version, all players will have to update as well to join again.
</div>


==Server update (All Platforms)==
==Server update (All Platforms)==
<div align="justify">
# Check in [[Dev Release Stability]] that the version you want to update to is stable enough. Note that versions ending with `.0` are generally considered stable, e.g., `2.3.0`.
# Check in [[Dev Release Stability]] that the version you want to update to is stable enough. Note that versions ending with `.0` are generally considered stable, e.g., `2.3.0`.
# [http://downloads.gtnewhorizons.com/ServerPacks/ Download] a new server version of GTNH.
# [http://downloads.gtnewhorizons.com/ServerPacks/ Download] a new server version of GTNH.
Line 23: Line 30:
{{ombox|type= content|text= '''Servers on newer Java versions (17+)'''<div>Java 17+ servers should be fully configured as downloaded. For additional instructions consult https://github.com/GTNewHorizons/lwjgl3ify#server
{{ombox|type= content|text= '''Servers on newer Java versions (17+)'''<div>Java 17+ servers should be fully configured as downloaded. For additional instructions consult https://github.com/GTNewHorizons/lwjgl3ify#server
}}
}}
</div>


== Server setup for Windows ==
== Server setup for Windows ==


=== Warnings ===
=== Warnings ===
<div align="justify">
This part of the guide was last revised in December 2023 with version 2.4.0. The download links are compatible with each other.
This part of the guide was last revised in December 2023 with version 2.4.0. The download links are compatible with each other.


If you follow this guide and try to connect, your launcher may have downloaded the latest client instead.
If you follow this guide and try to connect, your launcher may have downloaded the latest client instead.
</div>


===Introduction===
===Introduction===
<div align="justify">
This structure of this guide is as follows:
This structure of this guide is as follows:


Line 39: Line 50:
*Server Backups
*Server Backups
*FAQ (Frequently Asked Questions)
*FAQ (Frequently Asked Questions)
</div>


===Download files===
===Download files===
<div align="justify">
While our pack is hosted on many launchers we also maintain a repository of all of our releases. For the purpose of this guide we will be utilizing our hosted repositories as well as the Prism launcher.
While our pack is hosted on many launchers we also maintain a repository of all of our releases. For the purpose of this guide we will be utilizing our hosted repositories as well as the Prism launcher.


Line 51: Line 64:


''Note: Please reference this guide on how to setup and install our pack in Prism (this guide will only cover the server portion.): [[Installing and Migrating]]''
''Note: Please reference this guide on how to setup and install our pack in Prism (this guide will only cover the server portion.): [[Installing and Migrating]]''
</div>

===Server setup===
===Server setup===
====Extract server files====
====Extract server files====
<div align="justify">

[[File:Extract Server Files.png|alt=Extract Server Files Image|none|thumb|Right click on the server files ZIP archive and choose "Extract All..."]]
[[File:Extract Server Files.png|alt=Extract Server Files Image|none|thumb|Right click on the server files ZIP archive and choose "Extract All..."]]
[[File:Extraction Destination.png|alt=Extraction Destination Image|none|thumb|Once you've chosen your name for the folder you can hit extract. Whether or not you uncheck the "Show extracted files when complete" checkbox is up to you.''Note: It is highly recommended to save the server files somewhere that is NOT on OneDrive (so, not the desktop but something like C:\GTNH or similar).'']]
[[File:Extraction Destination.png|alt=Extraction Destination Image|none|thumb|Once you've chosen your name for the folder you can hit extract. Whether or not you uncheck the "Show extracted files when complete" checkbox is up to you.''Note: It is highly recommended to save the server files somewhere that is NOT on OneDrive (so, not the desktop but something like C:\GTNH or similar).'']]
</div>


====Agree to EULA====
====Agree to EULA====
<div align="justify">
[[File:EULA.txt File Content.png|alt=File Content|none|thumb|Open the eula.txt file and change "false" to "true"]]
[[File:EULA.txt File Content.png|alt=File Content|none|thumb|Open the eula.txt file and change "false" to "true"]]
By setting the text of the EULA.txt file to true you are agreeing to the [https://account.mojang.com/documents/minecraft_eula following] EULA.
By setting the text of the EULA.txt file to true you are agreeing to the [https://account.mojang.com/documents/minecraft_eula following] EULA.


You can edit the <code>startserver-java9.bat</code> file if you want to change the memory usage from the default 6G (six gigabytes) - change both cases of "6G" to whatever memory amount you want. GT:NH will not run with less than 4G, and 6G should be a fine default until later.
You can edit the <code>startserver-java9.bat</code> file if you want to change the memory usage from the default 6G (six gigabytes) - change both cases of "6G" to whatever memory amount you want. GT:NH will not run with less than 4G, and 6G should be a fine default until later.
</div>


====Run the server====
====Run the server====
<div align="justify">

Starting the server at this point is very straight forward. Simply double click:<syntaxhighlight lang="text">
Starting the server at this point is very straight forward. Simply double click:<syntaxhighlight lang="text">
startserver-java9.bat
startserver-java9.bat
Line 79: Line 97:


DO NOT just close the command window instead of using stop. Doing so may corrupt your world data and your world will become unplayable.
DO NOT just close the command window instead of using stop. Doing so may corrupt your world data and your world will become unplayable.
</div>


====Whitelist players====
====Whitelist players====
<div align="justify">

In order to connect to the server yourself or allow other players to connect you must add them to the whitelist. To do this use the following command inside the server console window:<syntaxhighlight lang="text">
In order to connect to the server yourself or allow other players to connect you must add them to the whitelist. To do this use the following command inside the server console window:<syntaxhighlight lang="text">
Syntax: whitelist add <playername>
Syntax: whitelist add <playername>
Line 87: Line 106:
Example: whitelist add shawnbyday
Example: whitelist add shawnbyday
</syntaxhighlight>
</syntaxhighlight>
</div>

===Server backups===
===Server backups===
<div align="justify">
Go ahead and follow the above procedure to stop the server.
Go ahead and follow the above procedure to stop the server.


Line 95: Line 115:


At this point you can go ahead and start your server again. By default Server Utilities will backup your server every 30 minutes. You can change this in the <code>serverutilities.cfg</code> configuration file which will be located in: C:\<GTNH Install Directory>\serverutilites\ folder. Modifying configuration files is outside of the scope of this guide, however, it is recommended to set the backup interval to be equal to or less the amount of work you are willing to lose. The default rotation keeps the last 12 backups - so the last 6 hours of play. '''''Make sure you have enough space for the world and all its backups! If you run out of space you could corrupt your world save!'''''
At this point you can go ahead and start your server again. By default Server Utilities will backup your server every 30 minutes. You can change this in the <code>serverutilities.cfg</code> configuration file which will be located in: C:\<GTNH Install Directory>\serverutilites\ folder. Modifying configuration files is outside of the scope of this guide, however, it is recommended to set the backup interval to be equal to or less the amount of work you are willing to lose. The default rotation keeps the last 12 backups - so the last 6 hours of play. '''''Make sure you have enough space for the world and all its backups! If you run out of space you could corrupt your world save!'''''
</div>


==Server setup for Linux (Oracle Cloud)==
==Server setup for Linux (Oracle Cloud)==
<div align="justify">
The general setup for Linux is - get a server. Get SSH access to the server. Make sure Java 17+ is installed. Download the latest server pack from https://downloads.gtnewhorizons.com/ServerPacks/ (Use the Java_17-20.zip version, which will work with Java 21. Unzip the server pack and run ''startserver.sh''.
The general setup for Linux is - get a server. Get SSH access to the server. Make sure Java 17+ is installed. Download the latest server pack from https://downloads.gtnewhorizons.com/ServerPacks/ (Use the Java_17-20.zip version, which will work with Java 21. Unzip the server pack and run ''startserver.sh''.


The instructions below are specific for Oracle Cloud but may help with generic Linux installs.
The instructions below are specific for Oracle Cloud but may help with generic Linux installs.
</div>


===Warnings===
===Warnings===
<div align="justify">
* In less than half a year, Oracle has changed the terms of the Always Free tier from 4 TPU cores and 24 GB ram to 3k OCPU hours and 18k GB RAM hours. They can change the rules again in the future. Be wary.
* In less than half a year, Oracle has changed the terms of the Always Free tier from 4 TPU cores and 24 GB ram to 3k OCPU hours and 18k GB RAM hours. They can change the rules again in the future. Be wary.
* Your Oracle account will be terminated if you connect to the instance through VPN, so don't.
* Your Oracle account will be terminated if you connect to the instance through VPN, so don't.
* Backup your server periodically to a non-Oracle platform, so you don't suddenly discover that your account was terminated along with all data.
* Backup your server periodically to a non-Oracle platform, so you don't suddenly discover that your account was terminated along with all data.
</div>


===Introduction===
===Introduction===
<div align="justify">
This Linux setup uses an Oracle [https://blogs.oracle.com/developers/post/how-to-set-up-and-run-a-really-powerful-free-minecraft-server-in-the-cloud blogpost] about how to set up a server on their platform.
This Linux setup uses an Oracle [https://blogs.oracle.com/developers/post/how-to-set-up-and-run-a-really-powerful-free-minecraft-server-in-the-cloud blogpost] about how to set up a server on their platform.


Line 124: Line 150:


You might encounter the "Out of capacity" error when you request an instance in some of the available regions. In that case if you really need an instance in this region, please try again after a while. Due to the popularity of the service, it can take up to two months until you are able to create an instance in this region.
You might encounter the "Out of capacity" error when you request an instance in some of the available regions. In that case if you really need an instance in this region, please try again after a while. Due to the popularity of the service, it can take up to two months until you are able to create an instance in this region.
</div>


===Set up an instance===
===Set up an instance===
====Create an instance====
====Create an instance====
<div align="justify">

This step is taken from the Oracle's [https://blogs.oracle.com/developers/post/how-to-set-up-and-run-a-really-powerful-free-minecraft-server-in-the-cloud manual], so check it out if you need more info. A concise version of it is given in this guide.
This step is taken from the Oracle's [https://blogs.oracle.com/developers/post/how-to-set-up-and-run-a-really-powerful-free-minecraft-server-in-the-cloud manual], so check it out if you need more info. A concise version of it is given in this guide.


Line 155: Line 182:


You will see the yellow sign on the left that says "Provisioning". After a minute, it will change to green "Running". It means you can connect to the instance. Note the fields Username and Public IP Address -- you will need them.
You will see the yellow sign on the left that says "Provisioning". After a minute, it will change to green "Running". It means you can connect to the instance. Note the fields Username and Public IP Address -- you will need them.
</div>


====Set up network rules====
====Set up network rules====
<div align="justify">
When your Instance Details turns green and Running, click on the Subnet link in the Primary VNIC section. Then in Security Lists click on the only one that is there, the default one, then click on Add Ingress Rules.
When your Instance Details turns green and Running, click on the Subnet link in the Primary VNIC section. Then in Security Lists click on the only one that is there, the default one, then click on Add Ingress Rules.


Line 168: Line 197:


When you filled out the two rules, press Add Ingress Rules.
When you filled out the two rules, press Add Ingress Rules.
</div>


====Tweak the instance====
====Tweak the instance====
<div align="justify">
In order to connect to the instance, you need a "shell" program. If you're on Windows, this guide suggests to install [https://git-scm.com/downloads Git Bash] for that.
In order to connect to the instance, you need a "shell" program. If you're on Windows, this guide suggests to install [https://git-scm.com/downloads Git Bash] for that.


Line 219: Line 250:
sudo firewall-cmd --reload
sudo firewall-cmd --reload
</syntaxhighlight>
</syntaxhighlight>
</div>


===Set up a GTNH server===
===Set up a GTNH server===
<div align="justify">

1. Download the server zip from here: http://downloads.gtnewhorizons.com/ServerPacks/
1. Download the server zip from here: http://downloads.gtnewhorizons.com/ServerPacks/
<syntaxhighlight lang="shell">
<syntaxhighlight lang="shell">
Line 272: Line 304:
</syntaxhighlight>
</syntaxhighlight>
After shutting down, it will begin the countdown to reboot, so press Ctrl+C to stop it completely.
After shutting down, it will begin the countdown to reboot, so press Ctrl+C to stop it completely.
</div>


===Install a mod for backups===
===Install a mod for backups===
<div align="justify">
Two mods are needed to back up your server: FTB-Utilities and FTB-Library.
Two mods are needed to back up your server: FTB-Utilities and FTB-Library.
*FTB-Utilities is located here: https://github.com/GTNewHorizons/FTB-Utilities/releases/latest/
*FTB-Utilities is located here: https://github.com/GTNewHorizons/FTB-Utilities/releases/latest/
Line 344: Line 378:


If you want to use a different mod for backups, like AromaBackup, please refer to the page [[Backups and Recovery]].
If you want to use a different mod for backups, like AromaBackup, please refer to the page [[Backups and Recovery]].
</div>


===Run the server===
===Run the server===
<div align="justify">
So, you can launch the server, but when you leave the ssh connection, the server closes. That happens because together your ssh connection keeps things running.
So, you can launch the server, but when you leave the ssh connection, the server closes. That happens because together your ssh connection keeps things running.


Line 373: Line 409:


There are more options that you can use with this command, such as multiple named screens. You can check [https://linuxize.com/post/how-to-use-linux-screen/ this] manual for the instructions. or run the command <code>man screen</code>.
There are more options that you can use with this command, such as multiple named screens. You can check [https://linuxize.com/post/how-to-use-linux-screen/ this] manual for the instructions. or run the command <code>man screen</code>.
</div>

===Improvements===
===Improvements===
====More space====
====More space====
<div align="justify">
It's very likely that 50GB will not be enough for a lategame server. You will need more storage space.
It's very likely that 50GB will not be enough for a lategame server. You will need more storage space.


Line 390: Line 427:
#Either move the whole server to the new block-volume or move only backups. Better to move the whole server in order to reduce the chance of error.
#Either move the whole server to the new block-volume or move only backups. Better to move the whole server in order to reduce the chance of error.
# Optionally, you can make the block-volume to mount automatically when the instance launches. Use [https://docs.oracle.com/en-us/iaas/Content/Block/References/fstaboptionsconsistentdevicepaths.htm#fstab_Options_for_Block_Volumes_Using_Consistent_Device_Paths this] manual. However, be very careful on this step. As written at the bottom of the manual, you can brick your instance if you make a mistake and would have to use the site-console to revert changes. However, the result is well worth it -- you won't have to remember how to mount a block-volume if you need to restart the instance.
# Optionally, you can make the block-volume to mount automatically when the instance launches. Use [https://docs.oracle.com/en-us/iaas/Content/Block/References/fstaboptionsconsistentdevicepaths.htm#fstab_Options_for_Block_Volumes_Using_Consistent_Device_Paths this] manual. However, be very careful on this step. As written at the bottom of the manual, you can brick your instance if you make a mistake and would have to use the site-console to revert changes. However, the result is well worth it -- you won't have to remember how to mount a block-volume if you need to restart the instance.
</div>


====Chunk-loading====
====Chunk-loading====
<div align="justify">
The 16x16 pieces of the world are called chunks. When a player loads into the world, the server starts to simulate the chunks around them -- it loads these chunks. You want some chunks to remain loaded when you're away. For example, for the machines to continue working, or for the crops to grow.
The 16x16 pieces of the world are called chunks. When a player loads into the world, the server starts to simulate the chunks around them -- it loads these chunks. You want some chunks to remain loaded when you're away. For example, for the machines to continue working, or for the crops to grow.


Line 401: Line 440:


If the described way to load chunks is not fitting, the Windows part of the manual describes the alternatives.
If the described way to load chunks is not fitting, the Windows part of the manual describes the alternatives.
</div>


===FAQ (Frequently Asked Questions)===
===FAQ (Frequently Asked Questions)===
<div align="justify">

#How do I connect to my server?
#How do I connect to my server?
##On the Multiplayer Game you need to add a server and the server address can be (note by default the server is set to use the default Minecraft port which is 25565):
##On the Multiplayer Game you need to add a server and the server address can be (note by default the server is set to use the default Minecraft port which is 25565):
Line 411: Line 451:
##You will need to find out what your external IP address is (you can find this using Google).
##You will need to find out what your external IP address is (you can find this using Google).
##You then need to setup port forwarding on your modem/router (this is outside the scope of this guide and requires special attention to detail for privacy and security reasons - again Google is your friend here).
##You then need to setup port forwarding on your modem/router (this is outside the scope of this guide and requires special attention to detail for privacy and security reasons - again Google is your friend here).
</div>


{{Template:Navbar GTNH}}
{{Template:Navbar GTNH}}