🟧 Minecraft Java Edition Server

This page documents the Minecraft Java Edition server role available in the homelab’s Ansible ecosystem.
Although the Java server is not currently deployed, the role and playbook are fully prepared for future use.


📦 Overview

Component Description
Edition Minecraft Java Edition Server
Deployment Method Ansible (minecraft_setup role)
Playbook playbooks/minecraft/deploy_minecraft.yml
Inventory inventory/minecraft/
Version Pin Metadata only (minecraft_setup_version)
Actual Version Source minecraft_setup_download_url
Runtime Requirement Java (OpenJDK recommended)
Status Role exists, but not in active use

🧩 Architecture

The Java Edition server is deployed as a standalone Linux host managed through Ansible. The playbook handles installation of Java, deployment of the server JAR, and service management.

Key Components


🔧 Deployment Workflow

1. Configure Java Server Variables

Example inventory variables:

minecraft_setup_version: 1.21.4
minecraft_setup_port: 25565
minecraft_setup_download_url: https://piston-data.mojang.com/v1/objects/4707d00eb834b446575d89a61a11b5d548d8c001/server.jar
minecraft_setup_java_xmx: 2048
minecraft_setup_java_xms: 256

IMPORTANT minecraft_setup_version is metadata only.
The actual server version is determined by the minecraft_setup_download_url.

2. Deploy or Update the Server

ansible-playbook playbooks/minecraft/deploy_minecraft.yml

The playbook ensures:


🔍 Checking for New Minecraft Java Edition Versions

The Minecraft server does not provide an API for version discovery.
To automate this, the homelab uses a Playwright‑based scraper.

Version Check Playbook

check_minecraft_version.yml

This playbook:

  1. Launches Playwright in headless mode
  2. Scrapes the official Bedrock server download page
  3. Extracts the latest available version
  4. Prints the version to stdout for easy consumption

Updating the Inventory Version

When a new version is detected:

  1. Update the inventory variable:

    minecraft_setup_version: <new_version>
    
  2. Re-run the deployment playbook:

    ansible-playbook playbooks/minecraft/deploy_minecraft.yml
    

This ensures the server is always running the latest official Minecraft Java Edition release.


▶️ Service Management

The role installs a systemd service:

systemctl status minecraft
systemctl restart minecraft
systemctl enable minecraft

The service is restarted automatically when:


🟧 Why This Role Is Not Currently Used

The homelab’s active Minecraft deployment uses Bedrock Edition, because:

The Java role remains available for future use.