All templates

Minecraft Java Server

v1.0.0

A persistent Minecraft Java Edition server with configurable resources.

games by getarcaneapp
x-arcane:
  icon: "https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/minecraft.svg"
  urls:
    - "https://docker-minecraft-server.readthedocs.io/en/latest/"
services:
  minecraft:
    image: "itzg/minecraft-server:latest"
    restart: "unless-stopped"
    ports:
      - "${PORT:-25565}:25565"
    environment:
      EULA: "${EULA:-false}"
      TYPE: "${SERVER_TYPE:-VANILLA}"
      VERSION: "${MINECRAFT_VERSION:-LATEST}"
      MEMORY: "${JAVA_MEMORY:-2G}"
      MAX_PLAYERS: "${MAX_PLAYERS:-20}"
      MOTD: "${MOTD:-Arcane Minecraft Server}"
      ONLINE_MODE: "true"
      ENABLE_RCON: "true"
      RCON_PASSWORD: "${RCON_PASSWORD:?Set RCON_PASSWORD in .env}"
    volumes:
      - "data:/data"
    cpus: "${CPUS:-2}"
    mem_limit: "${CONTAINER_MEMORY:-3G}"
    stdin_open: true
    tty: true
    healthcheck:
      test:
        - "CMD"
        - "mc-health"
      interval: "10s"
      timeout: "5s"
      retries: 10
      start_period: "2m"
    labels:
      com.getarcaneapp.arcane.icon: "https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/minecraft.svg"
volumes:
  data: {}

README

A persistent Minecraft Java Edition server with configurable resources.

Copy .env.example to .env, review the settings, then run docker compose up -d. In Arcane, import the template and supply the same environment variables. Replace every change-me value before starting. Generate independent secrets with openssl rand -hex 32; use hexadecimal database passwords so connection URLs need no escaping. Use docker compose ps and docker compose logs to check startup.

Read the Minecraft EULA and explicitly set EULA=true only if you accept it. The default intentionally refuses to start. Join using a Minecraft Java client at localhost:25565; online account authentication is enabled. First startup downloads the game server and may take several minutes.

JAVA_MEMORY controls the Java heap, CONTAINER_MEMORY caps the whole container, and CPUS limits CPU use. Leave memory above the heap for Java overhead. The java25 image supports the current releases requiring Java 25; choose a compatible image tag for older game versions requiring another Java runtime. Pin MINECRAFT_VERSION for predictable updates. RCON has a configurable secret and is not published to the host. Use docker compose exec minecraft rcon-cli to administer the server. The data volume stores worlds, settings, and plugins.

Named volumes preserve server data across container recreation. Back up these volumes before upgrades; docker compose down -v deletes them. Set PORT to an unused host port. For remote players, publish or forward the selected TCP game port.

Upstream documentation: Minecraft Java Server deployment.