How to Install Minecraft Server on Debian 12

Minecraft is a sandbox video game that has won the heart of millions of gamers, also this provides an interactive environment where the gamers engage themselves in the woods, grass, and tools. The users can build the building structures and are free to develop their imaginary world. 

Minecraft has two different modes, survival mode, and creative mode,in the first mode, the users have limited resources while another provides them with unlimited resources. 

The Minecraft server can be installed on UNIX systems including the latest release of Debian. This post will demonstrate the step-by-step guide to installing Minecraft Server on Debian 12. 

Prerequisite

  • Debian 12 should be installed
  • Minimum 5 GB RAM
  • Core-based Processors
  • Dedicated graphic card

What is the Installation Method of Minecraft Server on Debian 12?

The installation method of the Minecraft server on Debian 12 consists of different simple steps. 

Step 1: Install OpenJDK

First, install the OpenJDK package with the command:

$ sudo apt install default-jdk -y

This will install the default package of the JAVA on the computer and to verify it, display the version of the installed JAVA:

$ java -version

Step 2: Create a Minecraft User

To use the Minecraft server, create a user for it:

$ sudo adduser minecraft

Step 3: Download & Install the Minecraft Server

Now create a new directory for downloading the Minecraft server, and navigate to it:

$ mkdir minecraft && cd minecraft

After navigating to the newly created directory, download the Minecraft installation file from its official website:

$ wget https://piston-data.mojang.com/v1/objects/84194a2f286ef7c14ed7ce0090dba59902951553/server.jar

Rename the file from “server” to “minecraft_server”:

$ mv server.jar minecraft_server.1.20.1.jar

To install the “Minecraft Server”, execute the command:

$ java -Xmx1024M -Xms1024M -jar minecraft_server.1.20.1.jar nogui

It will ask to agree with the EULA for continuing the installation process: 

Step 4: Agree with the EULA

To agree with the EULA, open the agreement file with the nano text editor:

$ nano eula.txt

Locate the line of “eula=FALSE” and change it to “eula=TRUE”:

Save and exit the nano text editor. 

How to Configure the Firewall for the Minecraft Server on Debian 12?

To configure the firewall for the Minecraft Server on Debian 12, ensure the installation of the UFW on Debian. Minecraft uses port 25565, allowing it to use the UFW:

$ sudo ufw allow 25565

Check the status of the new rule added:

$ sudo ufw status

How to Launch the Minecraft Server on Debian 12?

Run the next command to proceed with the installation as well as launch it:

$ java -Xmx1024M -Xms1024M -jar minecraft_server.1.20.1.jar nogui

Minecraft server has been launched:

To use Minecraft, run the help command:

help

It will display the commands with the help of which one can manage the Minecraft server on Debian 12. For example, we will stop the server:

/stop

How to Remove the Minecraft Server on Debian 12?

To remove and uninstall the Minecraft server on Debian 12, exit the directory of the Minecraft first:

$ cd

Now remove the “minecraft” directory with all its contents:

$ sudo rm -r minecraft

Now run the below command to remove all the files associated with the “minecraft”:

$ sudo apt auto-remove -y

That was all about the Minecraft server on Debian 12. 

Conclusion

To install the Minecraft server on Debian 12, first, install the JDK package and then download the Java script for the Minecraft installer. Agree on its license and then launch the Minecraft application. In this blog, the installation process has been explained with the step-by-step guide on Debian 12.