Docs / Game Servers / How to Set Up a Minecraft Java Server on Linux

How to Set Up a Minecraft Java Server on Linux

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 27 views · 2 min read

Overview

Minecraft is one of the most popular games in the world, and hosting your own Java Edition server gives you full control over gameplay, mods, and who can join. This guide walks you through setting up a dedicated Minecraft server on your Breeze.

Requirements

  • A Breeze with at least 2 GB RAM (4 GB+ recommended for 10+ players)
  • Ubuntu 22.04 or newer
  • Java 21 or newer

Step 1: Install Java

sudo apt update
sudo apt install -y openjdk-21-jre-headless
java -version

Step 2: Create a Server Directory

sudo useradd -r -m -d /opt/minecraft minecraft
sudo mkdir -p /opt/minecraft/server
sudo chown minecraft:minecraft /opt/minecraft/server

Step 3: Download the Server JAR

cd /opt/minecraft/server
sudo -u minecraft wget https://piston-data.mojang.com/v1/objects/SERVER_JAR_URL/server.jar

Visit the official Minecraft download page to get the latest server JAR URL.

Step 4: Accept the EULA

echo "eula=true" | sudo -u minecraft tee eula.txt

Step 5: Configure Server Properties

sudo -u minecraft nano server.properties

Key settings to adjust:

server-port=25565
max-players=20
view-distance=10
motd=My Kazepute Server
enable-command-block=true
difficulty=normal

Step 6: Create a Systemd Service

sudo tee /etc/systemd/system/minecraft.service <<EOF
[Unit]
Description=Minecraft Java Server
After=network.target

[Service]
User=minecraft
WorkingDirectory=/opt/minecraft/server
ExecStart=/usr/bin/java -Xms1G -Xmx2G -jar server.jar nogui
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now minecraft

Step 7: Allow Through Firewall

sudo ufw allow 25565/tcp

Memory Allocation Tips

PlayersRecommended RAMJVM Flags
1-52 GB-Xms1G -Xmx2G
5-154 GB-Xms2G -Xmx4G
15-308 GB-Xms4G -Xmx8G

Connecting

Players connect using your server's IP address and port 25565 in the Minecraft multiplayer menu.

Was this article helpful?