1. Installing Minecraft on Linux Server
1.1 Introduction
Minecraft is one of the most well-known sandbox computer games. In this guide, I will show you how to install your own Minecraft server on your Linux server.
1.2 Preparation
Let's first update our server. Enter the following command to do so:
apt-get update
apt-get upgrade
apt-get install nano
Now let's also install Java 17. Java is needed because the server runs entirely on Java. The official guide recommends at least version 16. Here, we'll install the current version 17.
1.2.1 Installing Java 17
First, let's navigate to the temp directory:
cd /tmp
Now let's download the current Java version.
Next, let's install it:
apt install ./jdk-17_linux-x64_bin.deb
Now we need to make some configurations. Enter the following command all at once:
cat <<EOF | sudo tee /etc/profile.d/jdk.sh
export JAVA_HOME=/usr/lib/jvm/jdk-17/
export PATH=$PATH:$JAVA_HOME/bin
EOF
Now we can check if everything worked. Enter the following commands:
source /etc/profile.d/jdk.sh
java -version
Now you should see this:
1.2.2 Installing Screen
Screen is a program that allows us to keep applications running even when we close the console. We need this because our Minecraft server should always be running, even if we don't have our console open permanently. To install, enter the following:
apt-get install screen
1.2.3 Creating a Folder
Now let's create a folder for the server. Enter the following:
mkdir -p /opt/minecraft/
cd /opt/minecraft/
1.3 Downloading Minecraft
Now let's download the latest version of the Minecraft server. Go to the following website: https://www.minecraft.net/en-us/download/server
Right-click on "minecraft_Server..." and then select "Copy link address."
For me, it's the following link:
Now let's download the server on our Linux server. Enter the following:
1.4 Adjusting Minecraft Server Permissions
Now let's adjust the file permissions. Enter the following:
chmod +x server.jar
1.5 Starting Minecraft Server
Now let's start our Minecraft server for the first time. Enter the following:
java -Xmx1024M -Xms1024M -jar server.jar nogui
You should now receive the following error message. Some files have been created during server startup, which we can now edit.
1.6 Accepting EULA
Now we need to accept the end-user license agreement. Enter the following:
nano eula.txt
You will now see the following:
Change this to "true."
2. Determine Available Memory
Our Minecraft server requires a significant amount of memory. Therefore, we want to allocate as much RAM to our server as possible. According to the manufacturer, at least 1024 MB of RAM is required to play Minecraft.
You can check the size of your memory with the following command:
free -m
This means that a Minecraft server is running in the background.
If you want to take a closer look at the process, enter the following:
screen -x "minecraft"
Now I see the output of my Minecraft server.
To put the Minecraft server back into the background, press "CTRL + A + D" simultaneously.
Finished