# Java Edition Minecraft behind mc-router. Live since 2026-10-06 at mc.gbrown.org. # # mc-router owns the one public port (25565) and routes each player by the hostname # they typed: Java clients send it in their first packet, so several servers can # share one port and one IP. Bedrock clients do not send it, which is why the # Bedrock server in ../Bedrock stays separate on its own UDP port. # # Start: docker compose up -d (from this directory) # # Each hostname needs a DNS-only (grey cloud) A record in Cloudflare pointing at the # home IP. The proxied *.gbrown.org wildcard can't carry Minecraft traffic, and a # specific record overrides it. UniFi forwards 25565/tcp to this host. Home # Assistant's Cloudflare integration keeps these records on the current home IP; # select each new record there too. # # Add a server: # 1. mkdir servers/, then copy the "gib" service below and point it there # 2. add "=:25565" to MAPPING # 3. add the DNS-only record for # Servers publish no ports of their own; only mc-router is reachable from outside. services: mc-router: image: itzg/mc-router:latest container_name: mc-router environment: # =: MAPPING: | mc.gbrown.org=gib:25565 ports: ["25565:25565"] networks: [minecraft] labels: com.centurylinklabs.watchtower.enable: "true" restart: unless-stopped gib: image: itzg/minecraft-server:latest container_name: mc-gib environment: # 26.1.2 matches the newest OptiFine (SEUS shaders) on the desktop. The 1.20.4 # world is in backups/; upgrades rewrite the world and cannot be undone. - VERSION=26.1.2 - DIFFICULTY=normal - MAX_PLAYERS=10 - TYPE=VANILLA - MEMORY=12G - SIMULATION_DISTANCE=16 - VIEW_DISTANCE=16 - ALLOW_FLIGHT=true - ENABLE_COMMAND_BLOCK=true - ENABLE_WHITELIST=true - UID=1000 - GID=1000 - EULA=true - TZ=America/New_York - ENABLE_ROLLING_LOGS=true - LANG=en_US.UTF-8 - LANGUAGE=en_US:en - LC_ALL=en_US.UTF-8 - SERVER_NAME=Gib's Minecraft Server - SNOOPER_ENABLED=false - WHITELIST_FILE=/data/whitelist.json #- ENABLE_AUTOPAUSE=true # Don't change MOTD it was really hard to make it look good. - MOTD= \u00A7aGib's Minecraft Server\u00A7r \u00A74Welcome to HECK labels: com.centurylinklabs.watchtower.enable: "true" volumes: - ./servers/gib:/data networks: [minecraft] stdin_open: true tty: true restart: unless-stopped networks: minecraft: {}