Skip to content

Configuration guide

Crossonic-Server is configured using environment variables.

To set a an option named EXAMPLE_CONFIG_OPTION to 42 you would add it to your docker-compose.yml file as follows:

docker-compose.yml
services:
crossonic:
# ...
environment:
# ...
EXAMPLE_CONFIG_OPTION: 42
# ...

After changing the configuration you’ll need to restart the container with:

Terminal window
sudo docker compose up -d crossonic
NameDescriptionExamples
BASE_URLThe URL where crossonic-server is reachable. This value is used in some API responses.https://music.example.com, http://192.168.0.200:8080
DB_USERThe postgres user for the database connection.crossonic
DB_PASSWORDThe password of the postgres user for the database connection.password1234
DB_NAMEThe name of the postgres database.crossonic
DB_HOSTThe host where postgres is reachable.localhost
DB_PORTThe port where postgres is reachable.5432
ENCRYPTION_KEYA secure random key to encrypt secrets in the database. Must be a base64 encoded string representing exactly 32 bytes. Generate with docker run --rm -it --entrypoint crossonic-admin ghcr.io/juho05/crossonic-server gen-encryption-keybase64 string
NameDescriptionExamples
MUSIC_DIRThe directory where your music files are stored./home/user/my_music
DATA_DIRThe directory where crossonic-server should store covers etc./home/user/crossonic-server/data
CACHE_DIRThe directory where crossonic-server should store cached files./home/user/crossonic-server/cache

Make sure these directories exist before starting crossonic-server.

NameDefaultDescriptionFormat
LISTEN_ADDR0.0.0.0:8080The address where crossonic-server should listen for connections.host:port
AUTO_MIGRATEtrueWhether to automatically run database migrations on startup.true/false
LOG_LEVEL4Controls the amount of logs generated.0 (none), 1 (fatal), 2 (error), 3 (warning), 4 (info), 5 (trace)
LOG_FILESTDERRThe file to write logs to instead of writing them to STDERR./home/user/crossonic-server/logs.txt
LOG_APPENDfalseAppend new logs to the log file of the previous session instead of truncating it.true/false
STARTUP_SCANquickControls how your music library will be automatically scanned on startup.disabled, quick, full
LISTENBRAINZ_URLhttps://api.listenbrainz.orgChange the ListenBrainz API base URL to a different (e.g. selfhosted) value. Please disconnect all ListenBrainz users on your server before changing this variable.e.g. https://maloja.example.com/apis/listenbrainz
LASTFM_API_KEYemptySee last.fm integration.x9hp2n6epyaxfnjkgh3jbgjquwwnsh25
SCAN_HIDDENfalseWhether to scan hidden directories/files.true/false
FRONTEND_DIRemptySee hosting a web client/home/user/crossonic-server/frontend
COVER_ART_PRIORITYcover.*,folder.*,front.*,embeddedComma separated list of patterns for cover file names. Use the special value embedded to refer to cover images embedded in the media file metadata. Options are tried from left to right./home/user/crossonic-server/frontend
ARTIST_IMAGE_PRIORITYartist.*Comma separated list of patterns for artist image file names. Options are tried from left to right.