navidrome-stat

navidrome-stat

Docker app from Navidrome-Stat's Repository

Overview

Self-hosted listening statistics for Navidrome. Explore playback history, artist and album rankings, listening charts, and monthly and yearly reviews across clients and servers. Uses a local SQLite database. Set a dashboard administrator token, then add your Navidrome servers in Settings > Connections after signing in. Recording depends on playback reported to Navidrome; installation does not recover a complete past history.

Unraid installation

简体中文 · Documentation

The Docker Manager template uses the published stepaniah/navidrome-statistic:latest image. The latest tag follows stable releases. Navidrome must already be running and reachable from this container. Navidrome Stat connects through its API; it does not need a music-library mount, the Navidrome database, or the Docker socket.

Prepare appdata

Use a dedicated directory on local Unraid storage, such as /mnt/user/appdata/navidrome-stat. Do not use an SMB or NFS mount for SQLite or share this directory with another running instance.

The image runs as UID/GID 1000:1000. Before the first installation, open the Unraid terminal and create the directory with that ownership. This command only runs if the path does not already exist:

test ! -e /mnt/user/appdata/navidrome-stat && \
  install -d -m 0700 -o 1000 -g 1000 /mnt/user/appdata/navidrome-stat

If you choose another path, use it both here and in the Appdata field. For an existing directory, stop the application and back it up before adjusting ownership; UID/GID 1000:1000 must be able to read and write its contents. The image does not interpret PUID or PGID variables. Keep the container stopped while moving its appdata, including moves performed by Unraid's mover.

Install the template manually

  1. Download navidrome-stat.xml from this repository.
  2. Place it on the Unraid server at /boot/config/plugins/dockerMan/templates-user/my-navidrome-stat.xml. Choose a different filename if one already exists; preserve existing saved templates and their settings.
  3. Open Docker > Add Container and select the template from the Template list.
  4. Review the fields below, enter a long, random Administrator token, and apply.
  5. Enable Autostart for the container on the Docker page if it should start with the server.

Unraid stores saved container templates in the directory above; see the Community Applications documentation.

Field Default or action
Repository stepaniah/navidrome-statistic:latest
Network bridge; leave privileged mode off
WebUI Host port 39421 → container port 39421/tcp
Appdata /mnt/user/appdata/navidrome-stat → /data, read-write
Administrator token Set STATS_API_TOKEN to a long, random value before applying
Database path /data/navidrome_stats.db; shown in Advanced View

If the host port is occupied, change only the host port. The WebUI shortcut uses the mapped port. Keep the administrator token non-empty: an empty token disables administrator authentication, and without a viewer token the dashboard and administrative APIs are public.

Connect Navidrome

Open the container's WebUI, sign in with the administrator token, and add a server in Settings > Connections. Enter its URL, username, and password, test the connection, then save it enabled. Repeat for additional servers.

Use an address reachable from the container. localhost refers to Navidrome Stat itself. For Navidrome on the same Unraid server, use the server's reachable address and Navidrome's published port, or attach both containers to the same user-defined Docker network and use Navidrome's container name and internal port. The default bridge network does not provide container-name lookup.

The template leaves the NAVIDROME_* environment fallback unset. Saved connections are the normal setup path. If you need an environment-only connection, add all three variables from the configuration reference and leave the saved connection list empty.

Run one instance per set of sources. Playback must be reported to Navidrome by the player; installing the service does not recover a complete past listening history. See collection and counting.

Access and storage

  • Viewer token in Advanced View optionally enables read-only access. Use a different random value from the administrator token. Add STATS_READ_ONLY_SOURCE_ID and/or STATS_READ_ONLY_USERNAME if viewers should have a fixed scope; see configuration.
  • Protect metrics defaults to true in this template, requiring administrator authentication for /metrics.
  • For remote access, configure an HTTPS reverse proxy and set Secure session cookie to true. Leave it false for direct HTTP access.
  • Unraid stores entered environment values in the saved container template and Docker configuration. Password masking only hides the field on screen. Keep saved templates and flash backups private.
  • Appdata contains the SQLite database, its write-ahead-log files when present, secret.key, and the artwork cache. Saved Navidrome passwords are encrypted with that key. Back up the whole directory while the container is stopped. See privacy and operations.

Update and recover

  1. Read the release notes, record the running version from the dashboard's About information, and stop the container.
  2. Back up the complete appdata directory and keep a private copy of the saved container settings.
  3. Use Unraid's container update action to pull the current latest image, then start the container if it is stopped. Preserve the appdata mapping and configured tokens.
  4. Sign in, confirm the version, check saved connections and earlier history, and verify collection resumes.

To pin a release, change Repository to a published tag such as stepaniah/navidrome-statistic:v0.9.5. Unraid updates the configured tag; a pinned installation requires changing that field to move to another release. Public template edits do not replace the settings of an existing installation; review its saved configuration when adopting new fields.

For a rollback, stop the container and restore both the previous image tag and its matching pre-update appdata backup. Do not run an older version against a database migrated by a newer version without confirming compatibility.

Check the installation

Check Expected result
Open WebUI in a private browser window Login is required; the administrator token opens the dashboard and settings
Request /health {"status":"ok"}; this only checks process liveness
Request /health/ready Database is ok; readiness may be degraded before adding an enabled connection
Add a connection and play music Connection succeeds and collection begins; counting follows the configured threshold
Restart or recreate the container with the same appdata mapping Connections and listening history remain available
Change only the host port The Unraid WebUI shortcut opens the new mapped port

If SQLite cannot be opened or the key file cannot be written, check the Appdata mapping and ownership. A successful /health response alone does not verify authentication, upstream access, collection, or persistence.

Media gallery

1 / 2

Requirements

A reachable Navidrome server and a dedicated local appdata directory writable by UID/GID 1000:1000. Prepare the directory as described in the ReadMe before installation. Run one instance per set of sources. Use an HTTPS reverse proxy for remote access.

Download Statistics

4,147
Total Downloads

Related apps

Details

Repository
stepaniah/navidrome-statistic:latest
Last Updated2026-10-03
First Seen2026-10-12

Runtime arguments

Web UI
http://[IP]:[PORT:39421]/
Network
bridge
Shell
sh
Privileged
false

Template configuration

WebUIPorttcp

Dashboard port. Change the host port if it is already in use; keep container port 39421.

Target
39421
Default
39421
Value
39421
AppdataPathrw

Dedicated local directory for SQLite, the credential key, and artwork cache. Must be writable by UID/GID 1000:1000; see the ReadMe before installing.

Target
/data
Default
/mnt/user/appdata/navidrome-stat
Value
/mnt/user/appdata/navidrome-stat
Administrator tokenVariable

Required: enter a long, random token for dashboard login. Keep it private. Add Navidrome connections in the dashboard after signing in.

Target
STATS_API_TOKEN
Database pathVariable

SQLite file inside the persistent appdata mount. Keep this path unchanged for normal installations.

Target
DATABASE_URL
Default
/data/navidrome_stats.db
Value
/data/navidrome_stats.db
Viewer tokenVariable

Optional read-only dashboard token. Must differ from the administrator and ListenBrainz tokens. Leave empty to disable viewer access.

Target
STATS_READ_ONLY_TOKEN
Secure session cookieVariable

Set true when accessing the dashboard through HTTPS. Leave false for direct HTTP access.

Target
SESSION_COOKIE_SECURE
Default
false|true
Value
false
Protect metricsVariable

Require administrator authentication for the metrics endpoint.

Target
STATS_METRICS_AUTH
Default
true|false
Value
true