Installing the Minecraft server on the Debian system 10
The following guide describes how to install Minecraft server on a Debian System 10.
We will do the whole thing through the console by entering a few simple commands.
First, we update the system and packages:
1 | sudo apt update |
1 | sudo apt upgrade |
The next step is to install Java
1 | sudo apt install default-jre |
We can check the java version by issuing the command:
1 | java -version |
We add a System User named Minercrat:
1 | sudo adduser minecraft |
We add sudo group to him:
1 | sudo usermod -aG sudo minecraft |
We install Screen so that our server can run in the background:
1 | sudo apt install screen -y |
We create the game server folder and go to it:
1 | mkdir minecraft |
1 | cd minecraft |
We download the minecraft server
1 | wget https://launcher.mojang.com/v1/objects/a16d67e5807f57fc4e550299cf20226194497dc2/server.jar |
We create a script so that our minecrat server starts by itself in the event of a server restart.
For this purpose, we create the start.sh file:
1 | sudo nano start.sh |
We paste into it:
1 | java -Xms1024M -Xmx2560M -jar server.jar nogui |
We give permission:
1 | sudo chmod +x start.sh |
We are updating packages again:
1 | sudo apt update |
We can now start the Minecraft server with the command:
1 | ./start.sh |
At the first run, we should accept the license. The script will guide us what to do.
The next step is to open eula.txt and set eula = true. This will allow your server to connect to the Minecraft client software. Open this file in your preferred editor and make sure, that sounds: eula=true.
1 | sudo nano eula.txt |
1 | eula=true |
We add our game server to run in the background:
1 | screen /home/minecraft/run.sh |
The last step is to add the port to the firewall
1 | sudo ufw allow 25565 |
THX for this tutorial!!!
Note: en Debian 11 currently default-jre installs a version of java that is too low for minecraft_server.1.18.2.jar
install openjdk-17-jdk instead