Skip to content

Install Minecraft Server

  1. update your system and install necessary programs
apt update && upgrade -y
apt update && upgrade -y
Debian 10
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A
echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main" | tee /etc/apt/sources.list.d/java.list
echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main" | tee /etc/apt/sources.list.d/java.list
apt update
apt update
apt install screen gnupg oracle-java17-installer -y
apt install screen gnupg oracle-java17-installer -y

Accept the license conditions by clicking on "OK" with TAB and confirm with ENTER. In the following window click on "YES" and confirm again with ENTER.

Debian 11
apt install screen openjdk-17-jre-headless -y
apt install screen openjdk-17-jre-headless -y
Ubuntu
sudo apt install screen gnupg software-properties-common -y
sudo apt install screen gnupg software-properties-common -y
sudo add-apt-repository ppa:linuxuprising/java
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt update
sudo apt install oracle-java17-installer -y
sudo apt install oracle-java17-installer -y

Accept the license conditions by clicking on "OK" with TAB and confirm with ENTER. In the following window click on "YES" and confirm again with ENTER.

  1. create a subuser for the server and log in
adduser minecraft --disabled-login
adduser minecraft --disabled-login
su minecraft -l
su minecraft -l
  1. version selection (for example with Spigot 1.19.3)
wget https://download.getbukkit.org/spigot/spigot-1.19.3.jar
wget https://download.getbukkit.org/spigot/spigot-1.19.3.jar
  1. create start file

Create a start.sh with:

nano start.sh
nano start.sh

Now copy the following line and paste it with a left click:

 screen -AmdS minecraft java -Xms1G -Xmx1G -jar spigot-1.19.3.jar
 screen -AmdS minecraft java -Xms1G -Xmx1G -jar spigot-1.19.3.jar

WARNING

change the 1 in -Xmx1G to the number of your ram e.g. 10 (server with 10 gigabyte ram)

INFO

Now save the entry with CTRL + O and close the window with CTRL + X

  1. accept licenses and assign file rights
echo "eula = true" > eula.txt
echo "eula = true" > eula.txt
chmod +x start.sh
chmod +x start.sh
  1. start server
./start.sh
./start.sh

INFO

The console can be opened with "screen -r minecraft".