Server Setup (Windows, Local Host)

From GT New Horizons
Revision as of 22:16, 12 December 2023 by Embri (talk | contribs) (Beginning split of Server Setup, please stand by.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This guide focuses on setting up a local server on the same machine as the client running Windows OS. Return to Server Setup for other operating systems and configurations. Prism is used as the server software, running Java 17+.

Latest Revision: December 2023 version 2.4.0

Downloading Files

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. 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.

  1. Download the server pack from here: http://downloads.gtnewhorizons.com/ServerPacks/
  2. Download Prism from here: https://prismlauncher.org/download/
  3. Download the client pack from here: http://downloads.gtnewhorizons.com/Multi_mc_downloads/

There are two versions of the pack, both for server and client. Unless you have a reason not to, you should use the Java 17+ version as it has better garbage collection. The only major reason not to use J17+ for a server is for Thermos compatibility - and if you know what Thermos is, you know how to setup your own server likely.

You can find and install the latest version of Java here: https://adoptium.net/ - any Java build of 17 or later should work, and you may already have one installed.

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

Server Setup

Extract Server Files

Extract Server Files Image
Right click on the server files ZIP archive and choose "Extract All..."
Extraction Destination Image
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).

Agree to EULA

File Content
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 following EULA.

You can edit the startserver-java9.bat 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.

Run the Server

Starting the server at this point is very straight forward. Simply double click:
startserver-java9.bat
Note: If you are using the Java 8 version it will be startserver.bat
Firewall Prompt
If you get the following prompt while the server is starting you can hit Allow Access. It is recommended making sure you're only allowing access on Private Networks (this doesn't impact if you want to open your modem/router for friends to join but is just best practice).

Note: It may take quite some time for the server to startup.

If at this point you get an error like "Error: Could not find or load main class @java9args.txt" and it immediately exits, your default Java version is probably Java 8. You can either change the default system Java, or edit startserver9.bat and replace java with the full path to the correct Java in quotes, something like "C:\Program Files\Java\jdk-17.0.6\bin\java.exe" - if you can't find it, Prism or MultiMC may be able to find the list of installed Javas (edit a client instance, select Settings, click Auto-Detect).

Console Window Image
When your server is ready you will typically see what is boxed in by red at the bottom. At this point your server is running and you can connect to it!
In order to stop the server simply type "stop" and press Enter:
stop
The server will scroll some information by and then the window will close when it shuts down entirely.


edit 

Danger!

Never close the command window instead of using stop. Doing so can corrupt your world making it unplayable.


Next Steps

The server should now be functional, but there's still some things to set up. These next steps are universal regardless of platform or launcher, so head back to Server Setup. It's vital to choose and install a backup mod, because unlike SP the server pack does not ship with one included.