From 677ab78d34d1cafc8119a87f39a09f66709ffaf5 Mon Sep 17 00:00:00 2001 From: Christine Elisabeth Koppel Date: Wed, 25 Mar 2026 00:20:02 +0100 Subject: [PATCH] Add support for Minecraft Bedrock by exposing port 19132 in firewall and Traefik configuration --- .../modules/system/minecraft.nix | 9 +++++-- nix-system-configs/modules/system/traefik.nix | 27 +++++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/nix-system-configs/modules/system/minecraft.nix b/nix-system-configs/modules/system/minecraft.nix index 070b05c..4dd6b95 100644 --- a/nix-system-configs/modules/system/minecraft.nix +++ b/nix-system-configs/modules/system/minecraft.nix @@ -48,8 +48,8 @@ in { services.tailscale.enable = true; - networking.firewall.allowedTCPPorts = [25565 24454 8100]; - networking.firewall.allowedUDPPorts = [25565 24454 8100]; + networking.firewall.allowedTCPPorts = [25565 24454 8100 19132]; + networking.firewall.allowedUDPPorts = [25565 24454 8100 19132]; # 24454 - https://modrepo.de/minecraft/voicechat/wiki/server_setup_self_hosted !!! # This is the VoiceChat mod in Minecraft @@ -230,6 +230,11 @@ in { sha512 = "7c2e08c526f1a8428711926151ed9b98b931c01770cd8c3689f85c3a54f4c848bdeacc720d0f9f34878c16d8c178628220cc38f5b961a316cba421cd71beab40"; }; + GeyserMC = pkgs.fetchurl { + url = "https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/fabric"; + sha512 = "5cd7bfd350c179e7201563a33f255fbe096b01997a3678321560c887df5df5da5b9ea58450d7b491eb0027c5947e5445da6199d2e665e6caf25152a395d04075"; + }; + } ); diff --git a/nix-system-configs/modules/system/traefik.nix b/nix-system-configs/modules/system/traefik.nix index 74e59c8..5f297f8 100644 --- a/nix-system-configs/modules/system/traefik.nix +++ b/nix-system-configs/modules/system/traefik.nix @@ -306,6 +306,10 @@ in { address = "[::]:25565"; }; + # Minecraft Bedrock (default port 19132) - expose both TCP and UDP + minecraft-bedrock-tcp = {address = "[::]:19132";}; + minecraft-bedrock-udp = {address = "[::]:19132/udp";}; + # Minecraft VoiceChat UDP entrypoint (VoiceChat mod default port) minecraft-voice = { address = "[::]:24454/udp"; @@ -593,6 +597,13 @@ in { service = "minecraft"; entryPoints = ["minecraft"]; }; + + # TCP router for Minecraft Bedrock (19132) + minecraft-bedrock-tcp = { + rule = "HostSNI(`*`)"; + service = "minecraft-bedrock-tcp"; + entryPoints = ["minecraft-bedrock-tcp"]; + }; # TCP game routers openra = { rule = "HostSNI(`*`)"; # catch-all; replace with stricter rule if desired @@ -653,6 +664,11 @@ in { ]; }; + # TCP service for Minecraft Bedrock + minecraft-bedrock-tcp.loadBalancer = { + servers = [ {address = "10.1.1.244:19132";} ]; + }; + # TCP game services openra.loadBalancer = { servers = [{address = "10.1.1.249:1234";}]; @@ -674,6 +690,12 @@ in { entryPoints = ["minecraft-voice"]; service = "minecraft-voice"; }; + + # UDP router for Minecraft Bedrock (19132) + minecraft-bedrock-udp = { + entryPoints = ["minecraft-bedrock-udp"]; + service = "minecraft-bedrock-udp"; + }; # UDP routers for game services valheim-2456 = { entryPoints = ["valheim-2456"]; @@ -706,6 +728,11 @@ in { ]; }; + # UDP service for Minecraft Bedrock + "minecraft-bedrock-udp".loadBalancer = { + servers = [ {address = "10.1.1.244:19132";} ]; + }; + # UDP game services (Valheim and Xonotic) "valheim-2456".loadBalancer = { servers = [{address = "10.1.1.249:2456";}];