This Debian guide installs a Vanilla Minecraft Java server from SSH. If you have bought our Minecraft server hosting, you do not need these Linux steps; use How to create a Minecraft Server for the control panel method.
Minecraft 1.21 and newer needs Java 21. Debian versions do not all ship the same Java packages, so this guide uses the Temurin repository before downloading the Minecraft jar.
If you are hosting it yourself, use a server with enough CPU and RAM for your players. Our Gaming VPS, VPS, and Dedicated Server ranges can all be used for this kind of setup.
Install Java 21 on Debian
- Log in to the Debian server over SSH.
- Install the tools needed to add the Java repository and download Minecraft:
sudo apt update sudo apt install -y wget gpg apt-transport-https curl jq screen
- Add the Temurin repository:
wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --dearmor | sudo tee /etc/apt/keyrings/adoptium.gpg >/dev/null echo "deb [signed-by=/etc/apt/keyrings/adoptium.gpg] https://packages.adoptium.net/artifactory/deb $(. /etc/os-release; echo ) main" | sudo tee /etc/apt/sources.list.d/adoptium.list
- Install the Java 21 runtime:
sudo apt update sudo apt install -y temurin-21-jre
Download the Minecraft server
- Create a folder for the server:
mkdir -p ~/minecraft cd ~/minecraft
- Download the latest Vanilla server jar:
LATEST=$(curl -fsSL https://piston-meta.mojang.com/mc/game/version_manifest_v2.json | jq -r '.latest.release') VERSION_URL=$(curl -fsSL https://piston-meta.mojang.com/mc/game/version_manifest_v2.json | jq -r --arg VERSION "$LATEST" '.versions[] | select(.id == $VERSION) | .url') SERVER_URL=$(curl -fsSL "$VERSION_URL" | jq -r '.downloads.server.url') curl -fLo server.jar "$SERVER_URL"
If you want a specific Minecraft version instead of the latest release, set VERSION to the version you want, then download the matching server jar:
VERSION="1.21.1" VERSION_URL=$(curl -fsSL https://piston-meta.mojang.com/mc/game/version_manifest_v2.json | jq -r --arg VERSION "$VERSION" '.versions[] | select(.id == $VERSION) | .url') SERVER_URL=$(curl -fsSL "$VERSION_URL" | jq -r '.downloads.server.url') curl -fLo server.jar "$SERVER_URL"
- Run it once to create eula.txt and the first set of files:
java -Xms1G -Xmx2G -jar server.jar nogui
- If you agree to the Minecraft EULA, accept it:
sed -i 's/eula=false/eula=true/' eula.txt
Run and connect
- Start the server inside screen:
screen -S minecraft java -Xms1G -Xmx2G -jar server.jar nogui
- Use CTRL + A, then D to detach from the console without stopping Minecraft.
- If this Debian server uses UFW, open the default Minecraft port. Your firewall may be different, especially if your VPS provider has its own firewall controls:
sudo ufw allow 25565/tcp
- Open the console again later with:
screen -r minecraft
Players can connect using the server IP address. If server.properties still uses the default port, that port is 25565.
Debian gives you a clean base for Minecraft, but you still need to handle jar updates, Java updates, backups, restarts, and firewall changes manually.
