1. Login to your server using SSH


2. Run the following commands to install Java 8. When prompt, select Yes and press Enter to agree to Oracle terms and conditions.
Code:
    # sudo apt-get install -y software-properties-common python-software-properties
    # sudo apt-get update
    # sudo apt install openjdk-8-jdk

3. Once Java is installed, we can setup the Minecraft server. First, create a directory where we can add the Minecraft server files.

Code:
  # mkdir /Minecraft
  # cd /Minecraft

4. Upload your Minecraft JAR file
Code:
# wget http://minecraft.net/download/minecraft_server.jar
5. Now, we have to create a screen to run our Minecraft server on. The screen allows the Minecraft server to run in the background, even when you don't have the SSH session open.

Code:
    # screen -S minecraft

6. Now, you can start the Minecraft server using the command below.
Code:
    # java -Xmx1024M -Xms1024M -jar minecraft_server.1.14.4.jar nogui
(Replace 1024 with the amount of RAM you want to allocate to your Minecraft server.)

7. Your Minecraft server will start up now. If you want to quit the SSH client and let the server run in the background, you have to detach the screen by pressing Control + A + D keys.

8. To reattach the screen, run this command:

Code:
# screen -r minecraft