Skip to Content
Documentation

Environment variables

The settings you can put in .env, what each does, and when Songstress reads it.

Put these in the .env beside your compose.yaml, then run docker compose up -d to apply them. The compose file passes each one to the container.

When Songstress reads them

Most take effect each time the container starts. A few only set things up the first time, and after that you change them in the app:

  • The admin pair makes the admin account only while the server has no users.
  • The acquisition settings are read once, on the first start. Change them later in Manage ▸ Acquisition ▸ Settings.
  • The Spotify, Last.fm and VPN connections are set up when they don't exist yet.
  • MUSIC_LIBRARIES adds new libraries at every start, and never removes one.
  • The SMTP_ settings reach the sign-in mailer the first time. See Email and notifications.

The basics

VariableDefaultWhat it does
MUSIC_DIRnoneThe folder that holds your music, on this machine. Required.
SONGSTRESS_TAGedgeWhich release to run: latest, a version like v0.49.0, or edge for the newest build.
TZUTCYour time zone.
PUID, PGIDthe music folder's ownerThe user and group Songstress runs as.
SONGSTRESS_PORT8090The port the web app and every app connect to.

Accounts and access

VariableDefaultWhat it does
SONGSTRESS_ADMIN_EMAIL, SONGSTRESS_ADMIN_PASSWORDemptyYour admin account, made at the first start. Empty: you create it in the app.
SONGSTRESS_PUBLIC_URLemptyThe address people use. Invite and reset links point there. When set, it wins over the app's setting at every start.
SONGSTRESS_SECRET_KEYgeneratedThe key that seals connected accounts' and extensions' sign-ins. Empty: Songstress makes one in data/songstress-secret.key.

Email

VariableDefaultWhat it does
SMTP_HOST, SMTP_PORTempty, 587Your mail server. Empty turns email off.
SMTP_USERNAME, SMTP_PASSWORDemptyIts sign-in.
SMTP_FROMthe admin emailWho the mail comes from.
SMTP_TOemptyWho gets the server's notification emails.
SMTP_STARTTLStruefalse uses TLS from the start, as on port 465.

Privacy and updates

VariableDefaultWhat it does
ENABLE_TELEMETRYtruefalse turns off diagnostics for the server and every app signed in to it. See Security and privacy.
UPDATE_CHECKonoff stops checking for new releases.

Jam voice

VariableDefaultWhat it does
VOICE_PORT8093Voice's port, UDP and TCP, the same inside and out.
VOICE_STUNemptyWhere voice asks how its port looks from the internet. Empty: a public server. off: never ask.

Room to work

VariableDefaultWhat it does
SONGSTRESS_MEM_LIMIT4gThe most memory the container may use.
SONGSTRESS_CPUS0The most processors it may use. 0 means no limit.
SONGSTRESS_TMP_SIZE1536mSpace for temporary files, inside the memory limit.
ARTWORK_CACHE_MB2048Space for resized covers, in MB. The oldest go first.
TRANSCODE_LIVE_STREAM10 waits for a converted song to finish before it plays.
TRANSCODE_LIVE_MAX8How many songs may play while they convert, server-wide.
WRAPPED_REEL_MODEmotionposter makes lighter Wrapped videos, one still per slide.
LOG_LEVELINFOHow much the worker logs: DEBUG, INFO, WARNING or ERROR.

Libraries and acquisition

VariableDefaultWhat it does
MUSIC_LIBRARIESMain=/musicYour libraries, as Name=/path, separated by ;. See Compose files.
SWEEP_CRON0 */6 * * *When the upgrade sweep runs.
WORKERS5How many downloads run at once.
DURATION_TOLERANCE_S3How many seconds a found song's length may differ from yours.
SERVICE_ORDERemptyThe order of sources to try. Empty: the built-in order.
UPGRADE_IMPORTEDtruefalse leaves the songs from your music folder as they are, from the first start. See Your music folder.
DISCOGRAPHY_OUTPUT_TEMPLATE, FILENAME_TEMPLATEemptyFolder and file names for new downloads. Empty: {album_artist}/{album} and {track_prefix}{title}.
RETRY_TRANSIENT_HOURS6When to retry after a passing failure.
RETRY_NOMATCH_DAYS30When to look again for a song that wasn't found.
YTDLP_COOKIES_FILEemptyCookies for YouTube Music downloads.

Services

VariableDefaultWhat it does
SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET, SPOTIFY_REDIRECT_URIemptyYour server's Spotify app. You can also set it up in the app.
LASTFM_API_KEY, LASTFM_API_SECRETemptyYour server's Last.fm app, for play counts and scrobbling.

The VPN overlay

VariableDefaultWhat it does
VPN_SERVICE_PROVIDERprotonvpnYour VPN, as Gluetun names it.
WIREGUARD_PRIVATE_KEYnoneYour WireGuard key. Required for the overlay.
WIREGUARD_ADDRESSES10.2.0.2/32Your WireGuard address.
LAN_SUBNET172.16.0.0/12Networks that skip the VPN, like your home network.

See Compose files.

The rest

The compose file passes a few more, for acquisition's own sources and the VPN's exit addresses. Leave them empty unless you know you need them.

On this page