[Guide] How to set up a server #713
minhngoc25a
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Installing prerequisites
MongoDB
Step 1: Go to the MongoDB Community download page and then download it. You'd want to download that edition because others are for business or premium users. So choose the correct one for your distribution.
Windows
Step 2: Installation for Windows should be straightforward. From here, choose the Complete setup type.
Although this is an image for an older version of MongoDB, the installation steps should remain the same.
Step 3: Install MongoDB as a service, and run it as a Network Service user. If your C drive has enough space, keep the default data and log directory. If your Grasscutter installation would generate a lot of data, you should consider storing those on a different drive other than C (if drive C doesn't have enough space).
Step 4: Also install MongoDB Compass. It is a very excellent graphical user interface made by MongoDB developers to manage data more straightforwardly. It would take time for MongoDB Compass to install, as it's not a local install. You need an active internet connection for the installer to download it.
MacOS
Step 1: The easiest way to install MongoDB on macOS is by using the Homebrew package manager. Get started on the Homebrew homepage to get the instructions on installing it.
Step 2: After you've installed Homebrew, let's start by launching the terminal. Execute
brew tap mongodb/brew
to add the related third-party repository. Then usebrew install mongodb-community
to download and install it.Step 3: If you need MongoDB to launch at every startup (what you'd want if you run Grasscutter), execute
brew services start mongodb/brew/mongodb-community
.Step 4: Download and install MongoDB Compass for OSX. I have explained the use of this in the Windows installation steps. The installation steps for the
.dmg
file should be relatively easy.Linux
There is a binary for each Linux distribution on the MongoDB Community homepage. For example, the package for Debian/Ubuntu should be
.deb
, and Fedora should be.rpm
. For other Linux distributions, you can compile it for yourself, or you can research if your distribution is based on any of the popular ones. If it does, then it should support that distribution's binary package. Also, install the MongoDB Compass GUI for Linux.Java
We'll use Java 17 in this tutorial and the development build. You should uninstall other Java versions for the easiness if you don't know much about environment variables and PATH. Having multiple versions installed can cause another version's binary to overlap with Java 17 when using the command line or running a script.
Download page: https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html
Download
.msi
for Windows,.dmg
for macOS,.rpm
for Fedora,.deb
for Debian or Ubuntu.Git
Git makes installation fast and easy. It can also help you update to a newer repository commit.
For Windows: https://git-scm.com/
For Mac, execute:
brew install git
For Linux: https://git-scm.com/download/linux
Setting up Grasscutter
Step 1: Open any terminal, change the directory to where you want to put the server root directory, and clone the dev branch:
The resulting folder will be generated.
How would this work?
For example, you are at E:\ in Windows Explorer, and you right-click while holding Shift and choose Open Powershell window here. A Powershell window will pop up with that same working directory. After you run the clone command, a folder named
Grasscutter
will be created and its directory path is E:\Grasscutter. So, E:\Grasscutter is the server root directory, because it's the top-level directory of the hierarchy of the server repo.Step 2: Download Grasscutter resources as
.zip
. Extract and copy it to theresources
folder of the server root directory. It should look like this:Step 3: In the terminal,
cd
to your server root directory, then executegradlew jar
to build the server jar. This process will take a while. On Powershell, macOS, or Linux, you'll have to add an extra./
before the command to execute the command from the current directory.Step 4: Create a start script for your server (for Windows,
.bat
file, for Linux,.sh
file) in the server root directory. Whatever your OS is, this should work if you've set up everything correctly:Step 5: Launch the start script. When the server console shows up, use
account create <New username here> <New UID here>
to create an account andhelp
for a list of commands. For more insights, you can refer to the README.md.FAQ
cd
to your server root directory, then executegit pull
. Next, build the server jar again. You might need to edit your start script if the jar version changes.443
if you leave everything unchanged by default.wrong keystore password
?config.json
to123456
.More guides
How to join any hosted server in the most painless way (not for hosting and setting up a server)
Beta Was this translation helpful? Give feedback.
All reactions