Skip to content

Singleplayer

Pavel Erokhin edited this page Nov 9, 2026 · 3 revisions

Singleplayer

Graphs for the world you play alone: TPS while you build a farm, chunks and entities, your play time, deaths, and health. You need WorldAPI 4.2.0 or newer as a Fabric or NeoForge mod in your game, and Docker for Prometheus and Grafana.

A singleplayer world listens on 127.0.0.1 only and answers only requests that name it so, which a container can't do. That's why the exporter runs beside the game as a binary, and only Prometheus and Grafana run in Docker.

1. Run the exporter

  1. Download the archive for your system from the latest release and unpack it.

  2. Open a world in the game and run /worldapi connect. Click “Copy the token”.

  3. Start the exporter with the address and the token:

    WORLDAPI_URL=http://127.0.0.1:8110/api/v1 WORLDAPI_TOKEN=<the token> ./minecraft-exporter

    In PowerShell: $env:WORLDAPI_URL="http://127.0.0.1:8110/api/v1"; $env:WORLDAPI_TOKEN="<the token>"; .\minecraft-exporter.exe.

The token in config/worldapi/config.yml serves every world, so the exporter keeps working as you switch worlds. Between worlds minecraft_up reads 0.

2. Start Prometheus and Grafana

git clone https://github.com/MairwunNx/minecraft-exporter.git
cd minecraft-exporter/examples
curl -Lo grafana/dashboards/minecraft.json https://github.com/MairwunNx/minecraft-grafana/releases/latest/download/minecraft.json
cd singleplayer
docker compose up -d

Open http://localhost:3000 and log in as admin / admin. The dashboard notices a singleplayer world by side="integrated": it hides the server's players, console, and chat, and shows “Your world” instead, with whether the game is paused, play time, level, deaths, diamonds, advancements, health and food, and your mods. Status reads “Paused” while you are in the game's menu.

Prometheus scrapes the exporter at host.docker.internal:10059, so the exporter keeps its default address, :10059, on every network interface: on a shared network, close port 10059 in your firewall, since the metrics carry what your token reads. Grafana opens on this computer only.

Stop it

docker compose down stops the stack and keeps the history, and docker compose down -v throws it away.

Next: Metrics.

Clone this wiki locally