Recently, a friend of mine wanted to set up a Minecraft server on Linux, so I decided to write down the process here!

Environment

In this setup, I used the following operating system and packages:

  • Ubuntu 20.04 Server
  • byobu
  • openjdk-8-jdk
  • spigot 1.16.5

Update System and Install Packages

To update the system, we enter the following command:

apt update -y
apt upgrade -y

Next, install Java and Byobu:

apt install openjdk-8-jdk byobu -y

Deploy Minecraft Server

First, we create a folder to place the server files:

mkdir /data
mkdir /data/minecraft
cd /data/minecraft

Next, we download the Minecraft server core. Here, we use Spigot 1.16.5 and use wget to download it to the server:

wget https://cdn.getbukkit.org/spigot/spigot-1.16.5.jar
mv spigot-1.16.5.jar server.jar

After completion, we write a startup script:

java -Xmx2048M -Xms1024M -jar server.jar nogui

Now you can start your Minecraft server!