Ubuntu Server + Minecraft vanilla server with Purpur

Originally written December 2021, updated April 2022

If you like this content, consider sending me an anonymous tip with Zcash:

zs195rfh80s5m6chxrqej57fg9vxw2ypw2p9ppv3e5f44dstcu36f59pxfukugmgzxnp2djvu6w2jd

I love Minecraft. Recently I started learning about running Minecraft servers. I’m still a n00b, but I want to start sharing my configs so I can get feedback from the community.

Got feedback for me? email: yawnbox at disobey.net

I started using Purpur in order to support vanilla Minecraft plugins and for server performance enhancements. I am also using Adoptium Java for the stability, performance, and security benefits rather than using OpenJDK.

Like always, I’m using Ubuntu Server LTS, 20.04 at the time of writing.

Install and Setup

Presuming you have already enabled the inbound firewall for server security, open up the Minecraft port:

sudo ufw limit 25565/tcp

First, install some dependencies:

sudo apt install zip

Create a limited user that will be running Minecraft on the server, for security:

sudo su root

adduser minecraft

Be sure to create and save a secure password via password manager.

Log in as this user:

su minecraft

Start a “screen” session:

screen

Create a new folder for the server:

cd && mkdir purpur && cd purpur/

Install Adoptium’s Temurin 18 for Java: https://adoptium.net/installation.html#x64_linux-jdk

wget https://github.com/adoptium/temurin18-binaries/releases/download/jdk-18%2B36/OpenJDK18U-jdk_x64_linux_hotspot_18_36.tar.gz

Unzip:

tar xzf OpenJDK18U-jdk_x64_linux_hotspot_18_36.tar.gz

Define the Java path:

export PATH=$PWD/jdk-18+36/bin:$PATH

Validate:

java -version

Download Purpur:

wget https://api.pl3x.net/v2/purpur/1.18.2/latest/download --content-disposition

Create a start script with StartMC: https://startmc.sh/

  1. Server filename: purpur-1.18.2-1612.jar
  2. RAM amount: 16000M
  3. Flag type: Aikar’s flags (12GB+ of RAM)

I also include the java path line from above so that I do not have to manually do that again (line 8, below). My script looks like this:

#!/bin/bash

JAVA="java"
JAR="purpur-1.18.2-1612.jar"
RAM="16000M"
FLAGS="-XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=40 -XX:G1MaxNewSizePercent=50 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=15 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=20 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Daikars.new.flags=true -Dusing.aikars.flags=https://mcflags.emc.gs"

export PATH=$PWD/jdk-18+36/bin:$PATH

echo "Starting server..."
${JAVA} -Xmx${RAM} -Xms${RAM} ${FLAGS} -jar ${JAR} --nogui

Put this in a start script:

vim start.sh

Make the script executable:

chmod +x start.sh

Accept the EULA:

rm -f eula.txt && touch eula.txt && echo 'eula=true' >> eula.txt && cat eula.txt

Start Minecraft for the first time to setup the files:

./start.sh

Type “stop” to stop the server. Now there are many other files and folders in the purpur directory.

I start out by editing my server.properties file:

vim server.properties

Things I typically change:

motd=your.domain.com
difficulty=hard
max-players=2000
allow-flight=true
view-distance=32
server-ip=1.2.3.4
server-name=your.domain.com
level-type=AMPLIFIED

Then start the server back up!

./start.sh

To exit “screen” to leave the Minecraft server running, type and hold Ctrl then press A and D.

Enjoy!

Plugins

cd plugins/

MineTinker:

wget https://github.com/Flo56958/MineTinker/releases/download/v1.7.1/MineTinker.jar

EssentialsX:

wget https://github.com/EssentialsX/Essentials/releases/download/2.19.0/EssentialsX-2.19.0.jar

EssentialsX Chat:

wget https://github.com/EssentialsX/Essentials/releases/download/2.19.0/EssentialsXChat-2.19.0.jar

EssentialsX Spawn:

wget https://github.com/EssentialsX/Essentials/releases/download/2.19.0/EssentialsXSpawn-2.19.0.jar

Maintenance

To backup a world manually:

zip -r world.zip world/

To delete a world and start over (while the server is stopped):

rm -r world/

copyleft 2004-2023