Skip to content

Configuration, environment and storage ​

The default configuration is data/config.js. DATA_PATH changes the data directory; CONFIG_PATH selects an external configuration file. If the target configuration is absent on first start, the server tries to initialize it from the legacy/bundled root configuration.

Normal startup merges defaults, configuration and environment variables. WebDAV restoration can subsequently reload remote configuration and accounts, so environment variables do not universally remain the final authority. Check the active path and effective values in the console.

Environment changes need a process restart or container recreation. Some console changes apply immediately; listener/path changes can require restart and reconnection.

Environment variables ​

Defaults below refer to code defaults. Bundled configuration, saved values and image environment can differ; Docker data/log paths are described in the deployment guide.

Environment variableConfig keyDescriptionDefault
PORTportService port9527
BIND_IPbindIPListening interface0.0.0.0
ADMIN_PATHadmin.pathBackend management interface path/admin
PLAYER_PATHplayer.pathWeb player access path (default root /)/
ADMIN_PASSWORDadmin.passwordAdmin password (for management console and music player admin login)123456
SERVER_NAMEserverNameSync service name (shown in client pairing & admin console title)LX Sync Server
PLAYER_NAMEplayer.nameWeb player name (shown in web player title & login card)LX Music Web
ENABLE_DEBUGdebug.enabledEnable DEBUG mode (verbose debug and source sandbox logs, default false)false
MAX_SNAPSHOT_NUMmaxSnapshotNumMax snapshots to keep10
CONFIG_PATH-Absolute path to external config file (defaults to data/config.js)-
DATA_PATH-Absolute path to data storage directory./data
LOG_PATH-Absolute path to log output directory./logs
PROXY_HEADERproxy.headerOriginal client IP header supplied by reverse proxyx-real-ip
USER_ENABLE_ROOTuser.enableRootEnable root path (use ip:port, password must be unique)false
USER_ENABLE_PATHuser.enablePathEnable user path (use ip:port/username, passwords can repeat)true
WEBDAV_ENABLEwebdav.enableEnable WebDAV sync and backupfalse
WEBDAV_URLwebdav.urlWebDAV URL-
WEBDAV_USERNAMEwebdav.usernameWebDAV Username-
WEBDAV_PASSWORDwebdav.passwordWebDAV Password-
WEBDAV_SYNC_PATHwebdav.syncPathWebDAV remote sync path/lx-sync
WEBDAV_BACKUP_PATHwebdav.backupPathWebDAV remote backup path/lx-sync-backups
SYNC_INTERVALsync.intervalWebDAV incremental sync interval (min)60
BACKUP_INTERVALsync.backupIntervalWebDAV full backup interval (hours)24
WEBDAV_EXCLUDE_CACHEwebdav.excludeCacheExclude cache dir from sync (data/cache/<user>). When enabled, skips incremental sync & full backup (already-synced files are NOT deleted)false
WEBDAV_EXCLUDE_MUSICwebdav.excludeMusicExclude music/download dir from sync (data/music/<user>). When enabled, skips incremental sync & full backup (already-synced files are NOT deleted)false
ENABLE_WEBPLAYER_AUTHplayer.enableAuthEnable Web Player passwordfalse
WEBPLAYER_PASSWORDplayer.passwordWeb Player password123456
DISABLE_TELEMETRYdisableTelemetryDisable anonymous telemetry and update notificationsfalse
ENABLE_PUBLIC_USER_RESTRICTIONuser.enablePublicRestrictionEnable public user permission restriction (restrict upload/delete public sources)true
ENABLE_PUBLIC_NON_ADMIN_LOCAL_MUSICuser.enablePublicNonAdminLocalMusicEnable non-admin access to local music (allows non-admin public accounts to access local music)false
ENABLE_PUBLIC_NON_ADMIN_BROWSER_DOWNLOADuser.enablePublicNonAdminBrowserDownloadEnable non-admin browser download (allows non-admin/public accounts to download songs via browser)true
ENABLE_PUBLIC_NON_ADMIN_SERVER_CACHEuser.enablePublicNonAdminServerCacheEnable non-admin server cache (allows non-admin/public accounts to cache songs on server)false
ENABLE_PUBLIC_FAVORITESuser.enablePublicFavoritesEnable public favorites and songs (allows guest/public to view and play public favorites)false
ENABLE_PUBLIC_NON_ADMIN_ACCESSuser.enablePublicNonAdminAccessEnable non-admin access to public favorites & songs (allows non-admin public accounts to view)false
ENABLE_CUSTOM_MUSIC_DIRuser.enableCustomMusicDirEnable custom music directories feature globallyfalse
ENABLE_LOGIN_USER_CACHE_RESTRICTIONuser.enableLoginCacheRestrictionEnable cache settings restriction for logged-in non-admin usersfalse
ENABLE_CACHE_SIZE_LIMITuser.enableCacheSizeLimitEnable cache size limit (auto-cleanup via LRU)false
CACHE_SIZE_LIMITuser.cacheSizeLimitCache size limit in MB2000
CONFIG_BACKUP_ENABLEconfigBackup.enableEnable automatic config.js backup (creates daily backup copy)true
CONFIG_BACKUP_RETENTION_DAYSconfigBackup.retentionDaysConfig backup retention period in days (auto cleans up expired backups)7
CONFIG_BACKUP_DIRconfigBackup.dirBackup directory, relative to data; empty uses data/backupsempty
SNAPSHOT_BACKUP_PATHsnapshot.backupPathCustom storage path for playlist snapshots (absolute or relative to ./data)-
LIST_ADD_MUSIC_LOCATION_TYPElist.addMusicLocationTypePosition when adding songs to list (top / bottom)top
PROXY_ALL_ENABLEDproxy.all.enabledEnable outgoing request proxy (for Music SDK)false
PROXY_ALL_ADDRESSproxy.all.addressProxy address (supports http:// or socks5://)-
SINGER_SOURCE_PRIORITYsinger.sourcePrioritySinger info retrieval priority (e.g., tx,wy or wy,tx)tx,wy
SUBSONIC_ENABLEsubsonic.enableEnable Subsonic API supporttrue
SUBSONIC_PATHsubsonic.pathSubsonic API access path (default /rest)/rest
SUBSONIC_PORTsubsonic.portSeparate port; requires subsonic.standalone=true4050
SUBSONIC_ENABLE_DEBUGsubsonic.enableDebugEnable Subsonic debug log modefalse
SUBSONIC_ONLINE_SEARCHsubsonic.onlineSearchEnable Subsonic online searchtrue
SUBSONIC_ONLINE_SEARCH_MODEsubsonic.onlineSearchModeSubsonic online search mode (fallback / merge / local_only)fallback
SUBSONIC_ONLINE_SEARCH_SOURCESsubsonic.onlineSearchSourcesSubsonic online search default platformswy,tx,kw,kg,mg
SUBSONIC_PUBLIC_LEADERBOARDSsubsonic.publicLeaderboardsExpose online shared playlists/leaderboardsfalse
SUBSONIC_LEADERBOARD_SOURCEsubsonic.leaderboardSourceSubsonic public leaderboard default platform (single platform, e.g., tx, wy)tx
SUBSONIC_LYRIC_TRANSLATIONsubsonic.lyricTranslationInclude translations in Subsonic lyricstrue
SUBSONIC_CACHE_ON_PLAYsubsonic.cacheOnPlayTrigger server caching on Subsonic playback (cached to user dir)false
SUBSONIC_PLAY_CACHE_FIRSTsubsonic.playCacheFirstPrefer streaming local cached/downloaded files on Subsonic playback (default off, to avoid server egress)false
SUBSONIC_QUALITY_ENABLEDsubsonic.quality.enabledEnable Subsonic audio quality selectiontrue
SUBSONIC_QUALITY_PRIORITYsubsonic.quality.prioritySubsonic audio quality priority order (e.g. flac,320k,128k)flac,320k,128k
ARTIST_MAX_FETCH_PAGESartist.maxFetchPagesMaximum fetch pages for artist tracks20
CACHE_NAMING_PATTERNcache.namingPatternsimple, standard, singer_name_quality_album, singer_name, name_singersimple
SYSTEM_ALLOW_UNSAFE_VMsystem.allowUnsafeVMAllow VM mode custom source scripts (note security risks)false
LX_USER_<username>usersCreate account using a password string—
SUBSONIC_SOURCE_PRIORITYsubsonic.source.priorityCross-platform candidate prioritykw,tx,wy,mg,kg
SUBSONIC_SOURCE_CROSS_PLATFORMsubsonic.source.crossPlatformAllow cross-platform candidate lookuptrue
SUBSONIC_SOURCE_AUTOSWITCH_CUSTOMsubsonic.source.autoSwitchCustomTry other custom scripts on the same platformtrue

Boolean values are case-insensitive: true/1/yes/y/on and false/0/no/n/off.

LX_USER_<username> accepts a password string. Use user management for advanced account settings; JSON in that environment variable is not an advanced-account configuration format.

Options without environment mappings include subsonic.standalone, subsonic.localPlaylist, subsonic.customPlaylist and category proxies proxy.music.*, proxy.customSource.*, proxy.app.*. Category proxy enabled inherits the global setting when unset, forces direct connection when false and enables that category's proxy when true; an empty category address falls back to the global address.

See the code defaults.

Storage, backups and updates ​

LocationContents
data/ or DATA_PATHConfiguration, accounts, playlists, preferences and runtime state
data/config.js unless CONFIG_PATH is setActive server configuration
Root cache/ and music/Audio/indexes in root-directory storage mode
Data-directory cache/ and music/Audio/indexes in data-directory storage mode
Custom library pathExisting external audio files; preserve its mounts separately
Log directorySource default: logs/; image default: data/logs/

Audio folders are further scoped by account. A temporary browse switch neither moves files nor changes the saved account location.

Keep subsonic-local-registry.json and subsonic-local-state.json with user data: they preserve local identities, favorites and playlist relationships. They are not disposable audio caches.

Playlist snapshots restore playlists; configuration backups restore configuration. Neither substitutes for audio backups. Configuration backups default to a seven-day retention period under the data directory's backups/ folder.

WebDAV supports remote sync and backups. Startup with WebDAV configured can restore remote data and reload configuration/accounts. Confirm the remote namespace before connecting a new installation. WEBDAV_EXCLUDE_CACHE and WEBDAV_EXCLUDE_MUSIC exclude the corresponding audio folders within data; they do not back up external or root-directory libraries for you.

For container updates:

bash
docker compose pull
docker compose up -d
docker compose logs --tail=100

Preserve all used storage first. Source updates require dependency installation, rebuilding and restarting. Verify account access, playlists, local scanning and actual playback after migration.

Advanced account and path settings ​

Configuration fragment ​

This example illustrates the separate Subsonic listener and a user directory. Merge the fields into your existing object; do not replace a complete configuration with this fragment:

js
module.exports = {
  'subsonic.enable': true,
  'subsonic.standalone': true,
  'subsonic.port': 4050,
  'user.enableCustomMusicDir': true,
  users: [
    {
      name: 'user1',
      password: 'replace-with-your-user-password',
      enableCustomMusicDir: true,
      customMusicDir: '/library',
      allowOperateCustomMusicDir: false,
      allowWriteCustomMusicDir: false,
    },
  ],
}

/library is a Linux/container example. A direct Windows run can use a real path such as D:/Music. Leave operation/write permissions disabled while verifying browsing and playback. A separate Docker listener also needs a 4050:4050 port mapping.

Set a temporary startup environment ​

Bash:

bash
DATA_PATH=/absolute/path/to/test-data PORT=9528 npm run dev

PowerShell:

powershell
$env:DATA_PATH = 'D:\lxserver-test-data'
$env:PORT = '9528'
npm run dev

These commands do not change other terminals' environments. Use a directory separate from your regular instance and check that the test configuration does not restore the same WebDAV namespace.

Use user management for custom paths, operation/write permissions, automatic downloads and account disablement. Manual configuration uses the JavaScript configuration object's users array; existing users.json and remote restoration also affect the final account list. Editing only the root example config does not necessarily override deployed accounts.

Paths belong to the server's environment: host paths for source runs, container paths for Docker. Application permission cannot override a read-only filesystem mount. Browsing another location does not move audio; storage migration is a separate operation.

Checks after changing configuration ​

  • Ports: verify main/separate Subsonic listeners and matching container mappings.
  • Paths: check player, console and clients; avoid duplicated proxy prefixes.
  • Proxies: distinguish outgoing category proxies from media forwarding; verify search and actual playback separately.
  • Directories: check mounts, account permissions and scans, not just saved strings.
  • WebDAV: check remote namespace, exclusions, recovery logs and effective settings.

See deployment and operations.

Released under the Apache-2.0 License. (v2.1.4)