Why tag at all
Plex can measure the loudness of your songs on the server. Navidrome does not. It reads ReplayGain tags if your files have them and passes the numbers to the app, and it never writes to your files, so the tags have to be put there by something else.
Lagu copes without them on some devices. On a computer, an iPhone, an iPad or an Android phone it measures an untagged song itself, which can hold the start of a song for a moment the first time it plays. The TV apps, on Apple TV and Android TV, do not measure, so they level tagged songs only. There an untagged song plays 8 dB below its recorded level on every play, whatever its real loudness. With tags in the files, every device gets the same numbers from the server and nothing has to be measured while you listen.
If your library came from a mix of places, do not count on the tags already in it. On the library this guide was tested on, 2.4 percent of the files arrived with ReplayGain tags, and those were off by anything from 8 dB too quiet to 16 dB too loud against a fresh measurement.
What gets written
rsgain is a free command-line tool. In its own words it "applies loudness metadata tags to your files, while leaving the audio stream untouched." The music is not re-encoded and does not change. Each file gains four small tags.
- A track gain and a track peak, which describe that one song.
- An album gain and an album peak, which describe the album as a whole, so the quiet song on an album stays quieter than the loud one beside it.
The target is -18 LUFS, the ReplayGain 2.0 reference. No file is renamed or moved, so a library manager that files your albums is not confused by the scan.
Have a current backup before you start. That advice holds for any tool that writes to every file you own.
1. Install rsgain
Install it on the computer that holds the music, as a user who is allowed to change the files. Navidrome itself only has read access in the setup guide's layout, and that is as it should be.
| System | How |
|---|---|
| Debian 13, Ubuntu 24.04 or later | sudo apt install rsgain |
| Fedora | sudo dnf install rsgain |
| Arch | yay -S rsgain |
| Windows 10 or later | scoop install extras/rsgain, or the ZIP from the releases page with its folder added to your Path |
| macOS 12 or later | Homebrew or MacPorts, or the ZIP from the releases page |
The README has the rest, including a static Linux build and a Docker image for systems with no package.
2. Scan the library
rsgain has an Easy Mode that walks a whole library and uses the recommended settings for each file type. Point it at your music folder.
rsgain easy /path/to/your/music On Windows the path goes in quotes, as in rsgain easy "D:\Music". To use more of the processor, add -m with a number of threads.
rsgain easy -m 4 /path/to/your/music It reads every file from start to finish, so the disks set the pace. On the test library, a run over about 47,000 FLAC songs on hard drives took 16 hours, with a check of every file after it was written. Start it in the evening and let it run.
Easy Mode also holds back a song that would clip if it were turned up, and overwrites any ReplayGain tags already in a file. Overwriting is what you want on a first run.
3. Let Navidrome see the tags
Navidrome notices changed files and reads them again by itself. To do it at once, ask for a scan.
cd ~/navidrome
docker compose exec navidrome navidrome scan To confirm it worked, open any song in Navidrome's web page, choose Get Info, then Raw Tags, and look for the ReplayGain track gain. Adding these tags leaves your albums, playlists, hearts and play counts exactly as they were.
New albums
Run the same command again whenever you have added music. Adding -S skips files that already have a track gain, so only the new albums are read.
rsgain easy -S /path/to/your/music rsgain's README warns against -S for files that came with tags from somewhere else, because those may be from a different scanner. That is the reason to run without it the first time.
What Lagu does with them
Loudness leveling is a setting in Lagu, on by default, with a Quiet, Normal, or Loud target. Quiet is the same -18 LUFS the tags are written for. With tagged files on Navidrome it works like this.
- An album played in order uses the album level, so the album keeps the dynamics its makers gave it.
- Shuffle, radio, a mix, or a queue of songs from different albums uses each song's own level, so they match one another.
- The peak tag stops a quiet song from being turned up into distortion, and no song is ever raised by more than 6 dB.
A tagged song is no longer measured on the device for its level. Lagu still reads a song through once on a phone or computer when it needs the shape of the sound for the waveform seek bar or for Smart Fades.
If you prefer a window
MusicBrainz Picard has a ReplayGain 2.0 plugin. Select albums, choose Calculate ReplayGain from the plugin menu, then save. It runs rsgain underneath, so rsgain still has to be installed. foobar2000 on Windows has a ReplayGain scanner built in. Either writes tags Navidrome reads.
Credits and sources
This guide leans on other people's work. Each project below is its own, with its own license and its own documentation, and theirs is the one to trust if it and this page ever disagree.
- rsgain complexlogic, BSD 2-Clause
The scanner this guide uses. The commands, the Easy Mode defaults and the install methods are from its README.
- ReplayGain
The standard behind the tags, including the difference between a track level and an album level.
- MusicBrainz Picard ReplayGain 2.0 plugin GPL-2.0
Runs rsgain from inside Picard for people who would rather not use a terminal.
- Navidrome
Reads the tags and passes them to apps. It does not write to your music files, by design.