This script automatically installs Java 21, downloads the latest PaperMC build, and creates a startup script with optimized JVM flags.
Requirements
- Ubuntu 22.04 or Debian 12
- At least 2 GB RAM
- Run as root or with sudo
Install Script
Copy and paste this into your server terminal:
#!/bin/bash
apt-get update -q
apt-get install -y openjdk-21-jre-headless wget screen
mkdir -p /opt/minecraft
cd /opt/minecraft
wget -q https://api.papermc.io/v2/projects/paper/versions/1.21.4/builds/latest/downloads/paper-1.21.4.jar -O server.jar
echo "eula=true" > eula.txt
echo "java -Xmx4G -Xms2G -XX:+UseG1GC -jar server.jar nogui" > start.sh
chmod +x start.sh
echo "Done! Run: screen -S mc bash /opt/minecraft/start.sh"
Skip the setup entirely?
Our servers come with Minecraft pre-installed. One click and you are playing β no terminal commands needed.