MC Server

Brief overview of how I host, configure, and manage Minecraft Servers on my own machines

Project Details

I like to create my Minecraft servers headless, which is quite simple.

Description

A headless dedicated Minecraft server is a very simple task, however, it is a difficult concept to grasp for beginners as it takes a little comfortability navigating through the linux filesystem using a command line. This is understandable, so for those still learning I recommend installing a desktop environment and using the provided shell to navigate the filesystem while visually observing the directories you traverse. Now, installing Linux is not the only option. You can run a server on virtually any operating system, however, the reason I run my servers headless with Linux is to reduce as much overhead and bloat as possible since I am dedicating a whole machine to Minecraft servers. I typically mod my Minecraft servers as well since they can sometimes enhance the experience. This, in turn, requires more RAM and is more demanding on the server's internal components.

Step 1 ) Download an operating system, create live USB:

For headless servers I like to use the Ubuntu Server operating system. This is because it is relatively simple to set up, comes with a nice suite of tools, and has proven to be stable in my experiences. To create a live USB to install Ubuntu server, you will need to have a flashdrive, you will need to disable secure boot in your computer's BIOS settings, and then you will need to configure your system to boot from the USB. This is not a hard process and there are plenty of tutorials that explain how to do so. After disabling secure boot, navigate to ubuntu's main website and download Ubuntu server LTS. Then, use either Rufus or BalenaEtcher to flash the image onto your flashdrive. Once you have done that, shutdown your server, plug in the flashdrive, boot from USB using your computer's boot menu, and continue with installing ubuntu server.

Step 2 ) Acquire Java, SDKman, and a Minecraft Server:

You need to have Java installed in order to play or host Minecraft servers. The problem with this is that different modpacks/servers/worlds all require differnet versions of Java to be installed. This is why I like to use SDKman to manage different Java versions. It is very simple to install SDKMAN, all you need to do is navigate to sdkman.io/install and follow the directions provided. Now that we have sdkman, we will need to download the server and find out what version of Java is needed.

For Modded servers: The way I like to run modded servers is by creating a server pack from the modpacks listed on curseforge. To do this I use the serverpackcreator software as it has proven to work sufficiently. All you need to do is download the modpack on another computer, then extract the modpack from curseforge and use it in serverpackcreator to make a server pack. Then, send the zip archive to your server (I do this using scp) and ssh into your server to extract the zip archive into a folder on your server.

For Vanilla servers: all you need to do is download the official server pack from the Minecraft official website. Then you just need to google which version works with the server version you selected.

Step 3 ) Configure server.properties and Java arguments: Once the archive is unzipped, locate the file "server.properties" and edit it. Some key variables I like to change are: Max tick time: -1; MOTD: [whatever]; enforce-whitelist: true; Then, you will most likely find a text file containing your java arguments called "arguments.txt" or "java-args.txt" or something similar. You want to edit this file and change the -Xmx and -Xms arguments to allocate more or less RAM to your server. If this file is not present but there is a run.sh file, edit that file and change the contents of it. If neither files exist, then you will need to create a run.sh file yourself. It really is just one command "java -Xmx[Max ram]G -Xms[Min ram]G -jar [server .jar file name] --nogui". Save this with "#!/bin/bash" at the top in a file named run.sh . Now you will need to make the script executable, in your server's console run "sudo chmod 700 run.sh". This will allow it to be executed by the owner of the file. To run the server now use "./run.sh" in the same directory as the script.

Tech Used: Any free computer, laptop, pc, or vm; Flashdrive (only for dedicated servers), bash/batch, JAVA