This guide walks through setting up the Discogs Music Library Manager in Docker, from a minimal working installation to full configuration.
- Docker (Docker Desktop on Mac/Windows, or Docker Engine on Linux)
- A FLAC music library with albums tagged with
DISCOGS_RELEASE_ID(set via Yate or similar) - A Discogs API token (free account required)
git clone https://codeberg.org/koehntopp/discogs.git
cd discogsmkdir -p config
cp config_demo.py config/config.pyOpen config/config.py and fill in the three required values:
config_dir = "/config" # leave as-is for Docker
discogs_api_key = "YOUR_TOKEN" # from https://www.discogs.com/settings/developers
flacroot = "/flac/" # path inside the container — matches the volume mount belowEverything else can stay at its default for now.
The file is gitignored (it may contain credentials). Create it yourself:
services:
discogs:
build: .
container_name: discogs
ports:
- "8765:8000"
volumes:
- ./config:/config # config.py, logs
- /path/to/your/flac:/flac
environment:
- CONFIG_DIR=/config
- PORT=8000
restart: unless-stoppedReplace /path/to/your/flac with the actual path to your FLAC library on the host.
docker compose up --buildThe first build takes a few minutes — it compiles TagLib 2.x and rsgain from source. Subsequent starts are instant.
Open http://localhost:8765 in your browser.
The main view is a table of your albums, read from Tagwright (tagwright_url, refreshed every albums_refresh_minutes). Each row shows:
| Column | Description |
|---|---|
| Album Artist | Artist name |
| Album | Title with year, format, and bitrate (e.g. Kind of Blue [1959 CD 44kHz DR13]) |
| DR | Dynamic Range score; coloured green → red; links to loudness-war.info search |
| Original Date | First ever release year |
| Release Date | This specific release year |
| Catalog | Catalogue number |
| Cover Art | Thumbnail link to albumartexchange.com |
| Version | Format variant (SACD, 5.1, Qobuz, etc.) |
- Refresh — fetches the album table from Tagwright again
- Lyrics — fetches lyrics for all albums in
nzbdir(see Part 2) - Bliss — organises files into
Artist/Album/track.flacstructure (see Part 2) - Sync — makes ROCK pull the library from the NAS with rsync (see Part 3)
- Log — opens the live log modal; shows output from any running process
- Settings — edit all config values in the browser; saves to
config/config.py
Type in the search box to filter by artist or album name. Click any column header to sort. The table updates without a page reload.
Tag enrichment (fixtags.py) — given a FLAC file with DISCOGS_RELEASE_ID set, queries the Discogs API and:
- Fills in
DATE(this release),ORIGINALRELEASEDATE(first ever release),ORIGINAL_TITLE - Rewrites the
ALBUMtag toTitle [YEAR FORMAT BITRATE]
File organisation (bliss.py) — moves files into a consistent folder structure:
flacroot/
Album Artist/
Album Title [2024 CD 44kHz DR10]/
01_Track Title.flac
Lyrics (update_lyrics.py) — fetches synced (LRC) or plain lyrics from lrclib.net and stores them in the LYRICS FLAC tag. Uses 32 parallel workers. Detects and clears malformed LRC; upgrades bare LRC to versions with metadata headers.
These features work on a staging directory (nzbdir) where you drop freshly tagged files before they are enriched and moved into the library:
nzbdir = "/nzb/" # staging area for new albums
flacroot_local = "/Volumes/FLAC/" # path to flacroot as seen from your Mac
# used for tagger deep-links in the UIAdd a volume mount for the staging directory in docker-compose.yml:
volumes:
- ./config:/config
- /path/to/your/flac:/flac
- /path/to/your/nzb:/nzb # add this- Tag new albums in Yate (or similar): assign
DISCOGS_RELEASE_ID,ALBUMARTIST,ALBUM, cover art - Move the folder into
nzbdir - Click Refresh in the web UI (or run
uv run nzbfix.pydirectly) — this runs DR calculation, ReplayGain, fingerprinting, tag enrichment, lyrics, and file organisation in sequence - Files land in
flacrootunderArtist/Album/
If you want a parallel MP3 copy of your library (for mobile / car):
mp3root = "/mp3/"volumes:
- /path/to/your/mp3:/mp3 # add thisMP3 copies are created by running bliss.py with --mp3 directly — this is not exposed in the web UI:
docker exec discogs uv run bliss.py --mp3The Sync button runs a shell script you provide, so the sync itself is entirely yours to define.
The template sync_demo.sh makes ROCK pull the library from the NAS with rsync over SSH, so the
data goes NAS to ROCK directly and not through the Docker host. rsync sends only the changed
blocks of retagged files; --delete removes files on ROCK that are gone from the NAS and @eaDir/
is excluded. Design: ADR 0010.
- Copy
sync_demo.shtoconfig/sync.sh(next toconfig.py) and edit the host names and paths. - Set
sync_script = 'sync.sh'inconfig.py(or in Settings). A bare name is looked up in the config directory; an absolute path also works. - Make the host's SSH keys visible to the container: mount the host's SSH folder read-only at
/root/.ssh(see the volume line in the compose files). It needs the private key that ROCK accepts and aknown_hostsentry for ROCK (ssh-keyscan -H <rock-ip> >> known_hosts). The script then needs no key setting. The image contains thesshclient. - ROCK needs its own key on the NAS (rsync service enabled in DSM, SSH port 22). On ROCK:
ssh-keygen -t ed25519 -N '', append the public key to the NAS user's~/.ssh/authorized_keysand accept the host key once withssh <nas-user>@<nas> true. On Synology the user's home directory and~/.sshmust not be group- or world-writable. - Test the script from the Docker host before using the button:
bash config/sync.sh(addnto-rltifor a dry run).
Start the long-running command with exec (as the template does): Kill then ends the remote rsync.
The log modal shows every line the script prints; rsync progress lines are shown at most every 5 s.
sync_script = "sync.sh" # script in the config directory (or an absolute path)To forward logs to a Synology log server (or any syslog daemon):
syslog_host = "192.168.1.1" # IP of your log server
syslog_port = 514 # UDP port (514 is standard)No restart needed after adding these via the Settings UI — they are read at startup. If you add them manually to config.py, restart the container.
Add up to 5 custom buttons to the toolbar — useful for linking to related apps (your NAS UI, Prowlarr, etc.).
In Settings, fill in Link button #1 through #5 with full URLs. The button appears immediately; the favicon is fetched and cached automatically.
If the app requires authentication to serve its favicon, you can place the icon file manually:
config/link_favicon_1.ico # for Link button #1
config/link_favicon_2.ico # for Link button #2
# etc.
Any image format works (PNG, ICO, SVG, GIF, JPEG).
The Synology workflow differs because Container Manager doesn't support docker compose build from source.
./build_synology.sh # produces discogs-synology-amd64.tar (~400 MB)For ARM-based Synology:
./build_synology.sh arm64- Copy the
.tarfile to your Synology (e.g. via File Station) - Container Manager → Image → Add → Import from file → select the tar
- Container Manager → Container → Create → select the
discogs:latestimage
| Setting | Value |
|---|---|
| Port | 8765 (host) → 8000 (container) |
| Volume: config | /volume1/docker/discogs/config → /config |
| Volume: FLAC | /volume1/FLAC → /flac |
Env: CONFIG_DIR |
/config |
Env: PORT |
8000 |
| Restart policy | Unless stopped |
Create /volume1/docker/discogs/config/config.py from config_demo.py before starting the container.
Logs are written to config/discogs.log (JSON format). The Log button in the UI shows live output from any running process.
To change verbosity:
environment:
- LOG_LEVEL=DEBUGgit pull
docker compose up --buildThe build reuses Docker layer cache — only changed layers rebuild. Python dependencies are pre-installed at build time, so startup remains instant.