These are the steps I took and the commands to install Minecraft on Debian

sudo apt-get update
sudo apt-get upgrade
  • Reboot when done and then run the following command
sudo apt install default-jdk
  • Optional: If you want to install a certain version put -rev version number after BuildTools.jar on the last command line 4. Reference
mkdir /home/user/minecraft
cd /home/user/minecraft
java -Xmx1024M -jar BuildTools.jar
  • Next here is the command to start the server
java -Xms512M -Xmx1008M -jar /home/user/minecraft/spigot-1.16.5.jar -nogui
  • You will need to set the eula.txt line to true in order to start the server
nano eula.txt
  • Change eula=false to eula=true then save and exit
  • run the java command above again to start the server
  • In Minecraft when you load up the game select multiplayer and put in the ip address of your server

Register it as a service to start automatically

  • The create a service to start automatically when the computer reboots you will enter this command to create the service file
sudo nano /lib/systemd/system/minecraftserver.service
Description=Minecraft Spigot Server
ExecStart=/usr/bin/java -Xms512M -Xmx1008M -jar /home/user/minecraft/spigot-1.16.5.jar nogui
  • Enable the service like so
sudo systemctl enable minecraftserver.service
  • reboot to start the service or enter the following
sudo systemctl start minecraftserver.service