Ubuntu is usually the quickest Linux option for a manual Minecraft Java server because the packages you need are available through apt. This guide is for a self-managed server over SSH. If you are using our Minecraft server hosting, use How to create a Minecraft Server instead.

You can run this on a Gaming VPS, VPS, or Dedicated Server. For public servers, leave some spare RAM for the OS and for world generation spikes.

Install Java and tools

  1. Connect to the Ubuntu server over SSH as a user with sudo access.
  2. Update apt, then install Java 21 and the small tools used later in the guide:
    sudo apt update
    sudo apt install -y openjdk-21-jre-headless curl jq screen
  3. Create a clean folder for the Minecraft files:
    mkdir -p ~/minecraft
    cd ~/minecraft

Download and start Minecraft

  1. Download the current Vanilla server jar from Mojang:
    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"
  2. Start the server once so it creates eula.txt, then let it stop:
    java -Xms1G -Xmx2G -jar server.jar nogui
  3. If you agree to the Minecraft EULA, update the file:
    sed -i 's/eula=false/eula=true/' eula.txt
  4. Start Minecraft inside screen so it keeps running after you close SSH:
    screen -S minecraft java -Xms1G -Xmx2G -jar server.jar nogui
  5. Press CTRL + A, then D to leave the screen session running in the background.

Firewall and console access

  1. If this Ubuntu server uses UFW, allow the default Minecraft port. Your firewall may be different, so use the rule that matches your server:
    sudo ufw allow 25565/tcp
  2. Return to the Minecraft console later with:
    screen -r minecraft

Players can connect using your server IP and port 25565. If you change the server port in server.properties, give players the new IP:port instead.

This Ubuntu setup gives you full control, but it also means you need to manage backups, updates, firewall changes, Java issues, and restarts yourself.

  • 0 Benutzer fanden dies hilfreich
War diese Antwort hilfreich?

Mehr zum Thema

Colour Codes for Minecraft Multiplayer and Vanilla

This article lists all of the codes you can use with many plugins in Minecraft using Spigot or...

What is the difference between Fabric, Quilt and Forge in Minecraft Modding

Exploring the Distinctions Between Fabric and Forge When diving into the exciting world of...

What is a Grindstone and how is it used?

In this guide, we will teach you what the Grindstone in Minecraft does, and how to use it...

How to Convert Java and Bedrock Edition Worlds

In this guide, we’ll be teaching you how to convert your world from a Java Edition world to a...

Minecraft's New Version Numbers

Minecraft has changed how its version numbers work from 2026 onwards. Instead of carrying on with...