Simple Debian 11 Minecraft Server – Part 1

Published on December 4, 2021 at 6:55 am by LEW

Minecraft ImageIntroduction

This is going to be a short series of posts about creating a very simple vanilla Minecraft server on top of a base Debian 11 build. It will have very basic functionality.

I will be taking the simplest most straight forward path to get this server up and running. I will not be going into any detail about managing a server from the command line in this series. For information on running a server from the command line please refer to these posts; MineCraft server Console Basic User Management, and Minecraft Console Server Basic World Management.

A quick note on installing the base Debian build, please read the entire post before beginning any setup. When asked to create a normal user, you can name the user MC if you want. When formatting your drive, there are also some partitioning options to consider.

Another method for making a Minecraft server is to use the pre-built MineOS Turnkey image, which comes complete with a web interface. Note that this option can lag, and run older versions of the Minecraft Software sometimes.

The Server Build

For this server, we will start with the base Debian build from this post (note this is strictly a command line build). I am assuming that Debian 11 has been successfully installed. As with all installations, before progressing we should update/upgrade the server before proceeding. This needs to be done with root privileges. The simplest method is to log in as root, instead of a normal user (you should have a root account and password if you followed the basic Debian build).

apt update

apt upgrade

After updating/upgrading, we will be adding some additions. The first of which is an ssh server. Once installed you should test remote connectivity. When established, you can then disconnect the peripheries (keyboard and monitor) from the server. Use the following command to install the ssh server.

apt install openssh-server

A good SSH client to run on your main computer is PuTTY. The free open source PuTTY application is available for most platforms (Windows, Linux, Unix).

Set IP Address

If you have already set a static IP address, you can skip this step. If not, and you plan on using a static IP address, then you will need to edit the /etc/network/interfaces file. I walked through setting up a static IP address in the post on file servers.

If you are unsure of your setup, you can issue the following command to find the necessary information.

ip a

For simplicity though, below is what your main adapter should look like, assuming it is called enp0s3 and you are using the same IP address as me (your adapter name and IP address will most likely be different).

Auto enp0s3
iface enp0s3 inet static
address 192.168.2.12
netmask 255.255.255.0
gateway 192.168.2.1

Install OpenJDK

Current versions of Minecraft server requires Java 8 or higher to run. Since we are building on Debian, we will install the OpenJDK version. OpenJDK is an open source variation of Java by Sun Microsystems (acquired by Oracle in 2010).

We will use apt to find the latest version of OpenJDK. The below command will list all OpenJDK packages available.

apt search openjdk

As of this writing the latest package shown in the list is version 17. So we can refine our search with a pipe to the grep command to only show version 17 packages.

apt search openjdk | grep 17

Since we are not planning on programming, we only need the jre runtime version. Now that we know the package name we can use apt to install it.

apt install openjdk-17-jre

Once installed, we can check the Java version with the following command. This should also give us some basic information about our Java runtime environment.

java -version

Install Screen

Running Minecraft from a terminal will cause a specific issue. You need to be logged in to start it and keep it running. We want the server to run unattended. So we will use a terminal multiplexer to solve this issue.

The one I am going to use here is GNU Screen (or just Screen for short). There are others available that you can use, tmux comes to mind. However I am more familiar with Screen, so that is what I will use here. Feel free to use another terminal multiplexer if you want.

To install the Screen terminal multiplexer, and verify the version, use the following commands. As of this writing the version of Screen in Debian 11 is 4.08.00 (GNU).

apt install screen

screen -v

Conclusion

In this first post of the series, we setup our base install with some programs we will be using in our Minecraft server. In the next post we will finish setting up the server by creating a user, and determining the location of the executable.

Simple Debian 11 Minecraft Server – Part 1

Simple Debian 11 Minecraft Server – Part 2

Simple Debian 11 Minecraft Server – Part 3

Add New Comment

Your email address will not be published. Required fields are marked *