Skip to content
eripaPublic

About

Run multiple Minecraft (Bedrock) servers on a single LAN host.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

151 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

rustmine: Minecraft Bedrock multiplexer

ci release latest release license

Puts every world on your Bedrock server into one LAN Games list, without proxying gameplay. Under the hood it is a NetherNet LAN discovery and signaling multiplexer for Bedrock Dedicated Server (BDS) 1.26.50 and later.

rustmine restores what manymine provided under RakNet. Bedrock clients discover LAN worlds over UDP 7551; rustmine answers one discovery request with one pong per configured world, from a dedicated socket per world, and relays the encrypted SDP offer/answer/candidate datagrams by network ID.

It is not a game proxy: each world's own BDS still terminates its WebRTC connection, and gameplay traffic flows directly from the client to that world. rustmine never decrypts, rewrites, or forwards gameplay packets.

Documentation

  • How rustmine works — the protocol, the socket-per-world design, providers, and the observability model.
  • Reference — configuration, metrics, logs, the full NixOS example, the lab, and troubleshooting.

Install

Prebuilt binary

Prebuilt Linux binaries (x86_64 and aarch64) are attached to every release, with a SHA256SUMS file. The example below pins v0.4.0; substitute the current tag.

curl -LO https://github.com/eripa/rustmine/releases/download/v0.4.0/rustmine-v0.4.0-x86_64-unknown-linux-gnu.tar.gz
tar xzf rustmine-v0.4.0-x86_64-unknown-linux-gnu.tar.gz
cd rustmine-v0.4.0-x86_64-unknown-linux-gnu
./rustmine check --config rustmine.yaml

Container image

The same tag publishes the container image to GHCR:

docker run --rm ghcr.io/eripa/rustmine:v0.4.0 check --config /config/rustmine.yaml

Docker Compose

A complete stack: the router plus two worlds for it to advertise. Save it as compose.yaml.

services:
  rustmine:
    image: ghcr.io/eripa/rustmine:v0.4.0
    restart: unless-stopped
    # UDP 7551 broadcasts, and the worlds' bridge addresses, are only reachable
    # from the host's network namespace.
    network_mode: host
    cap_drop: [ ALL ]
    security_opt:
      - no-new-privileges:true
    # The image runs as nonroot and the socket is mode 660, so the router joins
    # the socket's group; `rustmine docker-socket-gid` prints that group.
    group_add:
      - "${DOCKER_GID:?set DOCKER_GID, for example: docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro ghcr.io/eripa/rustmine:v0.4.0 docker-socket-gid}"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro

  world-a:
    image: itzg/minecraft-bedrock-server
    restart: unless-stopped
    environment:
      EULA: "TRUE"
      SERVER_NAME: "World A"
      # One UDP port per player; the same range is published below.
      MAX_PLAYERS: "2"
      SERVER_UDP_PORTS: "${LAN_IP:?set LAN_IP to this host's LAN address}:19500-19501:19500-19501"
      # An enabled but empty allow-list refuses every player. Lowercase only.
      ALLOW_LIST: "false"
    ports:
      - "19500-19501:19500-19501/udp"
    volumes:
      - world-a-data:/data
    labels:
      - rustmine.enable=true
    # The stock healthcheck speaks RakNet and reports unhealthy under NetherNet.
    healthcheck:
      disable: true
    networks: [ minecraft ]

  world-b:
    image: itzg/minecraft-bedrock-server
    restart: unless-stopped
    environment:
      EULA: "TRUE"
      SERVER_NAME: "World B"
      MAX_PLAYERS: "2"
      SERVER_UDP_PORTS: "${LAN_IP}:19510-19511:19510-19511"
      ALLOW_LIST: "false"
    ports:
      - "19510-19511:19510-19511/udp"
    volumes:
      - world-b-data:/data
    labels:
      - rustmine.enable=true
    healthcheck:
      disable: true
    networks: [ minecraft ]

volumes:
  world-a-data:
  world-b-data:

networks:
  # The shipped config prefers a network called `minecraft`, and Compose would
  # otherwise prefix the project name.
  minecraft:
    name: minecraft

LAN_IP is the address clients use for gameplay: this host's LAN address, not a container's. Put it and DOCKER_GID in an .env file next to compose.yaml (Compose reads it automatically), then:

docker compose up -d

rustmine.enable=true is the label the Docker provider looks for; manymine.enable=true works too, so existing worlds keep their label. The router's shipped config already enables the provider with that label and the minecraft network, so no config file is needed to start.

Each world keeps its own public UDP range for gameplay (SERVER_UDP_PORTS=<public-ip>:<public-range>:<local-range>) and publishes that UDP range. Do not publish TCP 19132 or UDP 7551 for LAN play: rustmine owns discovery on 7551, and clients reach each world through it.

Docker

--network host is required to receive LAN broadcasts on UDP 7551 and to reach the worlds' bridge addresses.

docker run --network host \
  --cap-drop=ALL --security-opt=no-new-privileges \
  --group-add "$(stat -c '%g' /var/run/docker.sock)" \
  -v /var/run/docker.sock:/var/run/docker.sock:ro \
  -v "$PWD/config/rustmine.yaml:/config/rustmine.yaml:ro" \
  ghcr.io/eripa/rustmine:v0.4.0

The image runs as a non-root user, so when the Docker provider is on it must join the socket's group (--group-add, or group_add in Compose); the socket is mounted read-only. No capabilities are needed.

The image already contains the repository's config/rustmine.yaml at /config/rustmine.yaml, so the config -v is optional: it is how you override the shipped default.

just docker builds the same image locally as rustmine:dev if you have modified your checkout.

NixOS

The flake exposes packages.<system>.rustmine, packages.<system>.default, devShells.<system>.default, and nixosModules.default. The module supplies its own package, so a host configuration never names one.

{ inputs, ... }:
{
  imports = [ inputs.rustmine.nixosModules.default ];

  services.rustmine = {
    enable = true;
    openFirewall = true;        # UDP 7551 for LAN discovery
    settings = {
      docker.enabled = true;    # discover worlds by label
      static = [ ];
    };
  };

  virtualisation.docker.enable = true;
  virtualisation.oci-containers.backend = "docker";
}

The full flake wiring, module behaviour, and a nine-world example are in the reference.

Quick start

cargo run -- check --config config/rustmine.yaml   # validate and exit
cargo run -- run   --config config/rustmine.yaml   # run the router

The binary takes --config or RUSTMINE_CONFIG (default /etc/rustmine/config.yaml).

While running, the status listener (127.0.0.1:9101 by default) serves /healthz, /readyz, /status and /metrics. See Status and health endpoints for what each returns, and Metrics for every series.

From source

Rust 1.88 or newer:

git clone https://github.com/eripa/rustmine.git
cd rustmine
cargo build --release

The submodules under vendor/ are agent skills, not build inputs — a plain clone builds. just init fetches them if you also want the chat skills.

Contributing

Issues and pull requests are welcome. CONTRIBUTING.md covers the toolchain, the two-world lab and the commit convention. Security problems go to SECURITY.md, not the issue tracker.

License

This is free and unencumbered software released into the public domain under the Unlicense. Do what you like with it; there is no warranty.

Third-party components keep their own terms: the agent skills under vendor/ (superpowers, unslop) are MIT-licensed, and every crate in Cargo.lock carries its own license — deny.toml lists the permissive set this project accepts.

About

Run multiple Minecraft (Bedrock) servers on a single LAN host.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages