Skip to main content

Environment Variables

briiianAuthored by briiian · Last updated
self-hosted

These environment variables can be set in your docker-compose.yaml file. All variables are optional.

NameTypeDefaultDescription
MUSIC_DIRstringundefinedAbsolute path to your music.
PHOTOS_DIRstringundefinedAbsolute path to your photos.
MOVIES_DIRstringundefinedAbsolute path to your movies.
TV_DIRstringundefinedAbsolute path to your TV shows.
HTTP_LOG_LEVELnumber0Set the log level¹ for HTTP requests.
EVENTS_LOG_LEVELnumber0Set the log level¹ for the internal event system.
INDEXING_LOG_LEVELnumber10Set the log level¹ for the indexing system.
JOBS_LOG_LEVELnumber10Set the log level¹ for the jobs system.
TRANSCODER_LOG_LEVELnumber0Set the log level¹ for the transcoding system.
DATABASE_LOG_LEVELnumber0Set the log level¹ for database queries.
MAX_CONCURRENT_JOBSnumber3Max number of jobs that are allowed to run at the same time.
SQLITE_PATHstringundefinedAbsolute path for where the server should store the SQLite database. Set to :memory: to use an in-memory database. When omitted, the server will automatically choose a location based on the operating system.

If you change this after the server has already created a database, then you will need to copy the database to the new location manually.
SQLITE_WALbooleanfalseEnable Write-Ahead Logging (WAL) for SQLite. This is a significant performance optimization that allows for concurrent read/writes, but it cannot be enabled if your database is being used over a network connection (NFS, SMB, etc).

Changing this requires a server restart.
CARDINAL_POSTGRESbooleanfalseUse PostgreSQL instead of the default SQLite.
POSTGRES_HOSTstringundefinedPostgreSQL host name. When omitted, the server connects to the database service from the Quick Start examples (cardinal-media-server-<channel>-postgres-db), or 127.0.0.1 when running outside a container.
POSTGRES_PORTnumber5432PostgreSQL port number.
POSTGRES_USERstringcardinalThe PostgreSQL user.
POSTGRES_PASSWORDstringcardinalThe PostgreSQL user password.
POSTGRES_DATABASEstringPostgreSQL database name. Uses your Postgres user name if omitted.
POSTGRES_SSLbooleanfalseEnable SSL for the PostgreSQL connection.
SECURE_COOKIESbooleanfalseAllow the Media Server to issue cookies with stricter security settings. See Media Server → Accounts for more information on how sessions work.
SIGNING_SECRETstringundefinedSecret used to sign authentication tokens. Changing this will revoke all sessions. One is generated automatically if none is provided.
RESET_LOCAL_USER_PWstringundefinedSet this to the username of a local user to reset their password on the next startup. Their new password will be printed in the console.
INDEXING_SCAN_TIMEOUTnumber120Number of seconds the scanner will wait for the file system to respond.
INDEXING_SCAN_VERIFY_PASSESnumber4Maximum number of verification passes the music scanner will make over the file system to confirm that the initial scan did not miss any files. Verification ends early once a pass finds nothing new. Mostly useful for unreliable file systems, like network shares.
HEIF_CONVERSION_TIMEOUTnumber60Number of seconds before we assume that the conversion failed.
FFMPEG_PATHstringundefinedAbsolute path to an ffmpeg binary to use for audio transcoding. When omitted, the bundled ffmpeg build is used. Set this to point at a custom build of ffmpeg.
CONNECT_LAN_IPSstringundefinedOptional. Addresses this machine has on your own network, which Remote Access advertises as local connection routes for this server. Cardinal apps that look the server up through Cardinal's cloud try local routes first, then fall back to the public ones — a direct connection through your router, or the relay. Separate several addresses with commas.

A server inside a Docker bridge network (the Quick Start default) cannot discover its machine's addresses, so without this it advertises no local routes. This setting has no effect on the server's connect.cardinalapps.host address, which always points at your public address, and none on reaching the server by IP on your own network.

¹ Available log levels are:

  • 20 - Debug
  • 10 - Info
  • 0 - Silent

Higher numbers include logs from lower numbers. Setting 0 does not disable error logging.

Was this article helpful?