Multi-Library Configuration
Instead of supplying crossonic-server with a single music library directory you may choose to configure multiple libraries to better organize your music collection and/or give users access to different parts of the full collection.
To configure multi-library support you’ll need to create a config directory next to your docker‑compose.yml file:
mkdir ./configNext, create a music_dirs.json file at ./config/music_dirs.json to configure your libraries. Example:
[ { // REQUIRED: the name of the library "name": "Library 1",
// REQUIRED: the path of the music directory relative to the // working directory of crossonic-server or absolute. Do NOT use shorthands // such as ~ or $HOME. // This is the path INSIDE THE CONTAINER not on the host. I recommend mounting all // libraries unser /libraries/ "path": "/libraries/library1",
// OPTIONAL: a list of names of the users that should have access to this library. // Defaults to all users. "users": ["alice", "bob"] }, { "name": "Library 2", "path": "/libraries/library2", } // ...]Finally, you’ll need to give crossonic-server access to the newly created configuration file. In docker‑compose.yml:
services: crossonic: # ... environment: # ... # Path to the music dir config file INSIDE THE CONTAINER. # Do NOT change this path if you change the location of the config file on the HOST. MUSIC_DIR_CONFIG: "/config/music_dirs.json" # ... volumes: # ... # Mount the config directory: - ./config:/config:ro # Mount your music directories, e.g. - "/path/to/library1:/libraries/library1" - "/path/to/library2:/libraries/library2" - "/path/to/your/music:/music" # your music files # ...Check one last time that all paths are correct and restart the container to apply the changes:
sudo docker compose up -d crossonicCrossonic-Server will now begin a full-scan of your newly configured music libraries.