Run the server

Configuration reference

Most of KROMA is set up in its web app, under Server. Environment variables cover what the server needs before it starts: ports, folders, hardware and network. This page lists the ones an operator sets.

Set them under environment: in a compose file, or with -e on docker run. On the Synology package, add them to /var/packages/kroma/var/kroma.conf, one export NAME="value" per line. After a change, recreate the container with docker compose up -d, or restart the package. A plain restart of an existing container keeps the old values.

Lists take commas. The folder lists also take the system's path separator, : on Linux and macOS, ; on Windows.

Ports and addresses

VariableDefaultWhat it does
KROMA_HOST0.0.0.0The network interface to listen on. 0.0.0.0 is every interface, over IPv4. :: is every interface, over IPv6 and IPv4. See IPv6.
KROMA_PORT4040The HTTP port. The apps search the network on 4040, so with another port you may have to type the address in each app.
KROMA_WEB_URLnoneThe public address of KROMA, such as https://kroma.example.com. Invitation, password reset and TV sign-in links use it, and browsers on that address may use the API.
KROMA_PUBLIC_IP_URLhttps://api.ipify.orgA service that returns the server's public IPv4 address, used to recognize apps on the same home network. Empty turns it off.

Media and data

VariableDefaultWhat it does
KROMA_DATA_DIR./data, and /data in the Docker imageWhere KROMA keeps its database, images, modules and downloads in progress. Needs read and write access.
KROMA_MOVIES_DIRSnoneFolders for a library named Films.
KROMA_SERIES_DIRSnoneFolders for a library named Séries.
KROMA_MEDIA_DIRSnoneFolders for one library each, with the type guessed from the content.
KROMA_DEMO_MEDIA1With no library, writes small demo videos to the data folder so that playback can be tested. 0 shows the demo titles without files.
KROMA_WATCH_INTERVAL300Seconds between two scans of every library. 0 turns the periodic scan off. Changes on a local disk are seen at once either way.
KROMA_WALK_THREADScores × 4, from 8 to 32Threads that read folders during a scan. Raise it for network shares.
KROMA_PROBE_WORKERShalf the cores, from 2 to 4Files read at once during a scan.

The three folder variables define the libraries until you create, edit or delete one under Server > Sources. From then on, the libraries are managed there and the variables are ignored.

Metadata

VariableDefaultWhat it does
KROMA_TMDB_API_KEYKROMA's own keyYour own key for TMDB, which provides posters and summaries.
KROMA_TMDB_LANGUAGEen-USThe language of titles and summaries, such as fr-FR.
KROMA_TMDB_ENRICH10 skips TMDB during scans.

Transcoding

VariableDefaultWhat it does
KROMA_HWACCELfound at startup, or the Video encoder settingForces a conversion method: qsv, vaapi, nvenc, videotoolbox, v4l2m2m, or software for the processor. See Hardware transcoding.
KROMA_RENDER_NODE/dev/dri/renderD128The graphics device to use when there are several.
KROMA_ENCODE_EFFORTchosen from the machinequality or realtime, for conversions on the processor.
KROMA_MAX_TRANSCODEShalf the cores, from 1 to 4Video conversions at once. A request past the limit is refused, so the player says so instead of stuttering.
KROMA_FFMPEG_CONCURRENCYthe number of cores minus oneBackground media tasks at once, such as thumbnails and subtitle extraction. On Linux, fewer start while memory is short, and none while the server is swapping. While someone is watching, they run one at a time.

HTTPS and proxies

VariableDefaultWhat it does
KROMA_HTTPS01 also serves HTTPS, with a certificate KROMA makes. See HTTPS on your home network.
KROMA_HTTPS_PORT4443The HTTPS port.
KROMA_TLS_SANSnoneExtra addresses and names for the certificate, such as 192.168.1.50,nas.home. Needed in Docker.
KROMA_HTTPS_REDIRECT01 sends every HTTP visitor to HTTPS. Breaks TV apps that cannot trust the certificate.
KROMA_TRUSTED_PROXIESnoneAddresses or ranges of reverse proxies whose X-Forwarded-For header KROMA believes. See reverse proxies.
KROMA_ALLOWED_ORIGINSnoneExtra web addresses whose pages may use the API. See another address.

Sign-in provider

These name one OpenID Connect provider, for a setup kept in a compose file. See Sign in with your identity provider. Providers added in Admin → Sign-in need none of them.

VariableDefaultWhat it does
KROMA_OIDC_ISSUERnoneThe provider's issuer URL. The provider exists only when this and the client ID are both set.
KROMA_OIDC_CLIENT_IDnoneThe client ID the provider gave KROMA.
KROMA_OIDC_CLIENT_SECRETnoneThe client secret. Leave it out for a public client.
KROMA_OIDC_LABELthe issuer's host nameWhat the sign-in button says after "Continue with".

Logs

VariableDefaultWhat it does
RUST_LOGinfo for KROMA's own parts, warn for the restHow much the server logs, such as debug, or kroma_server=debug for the server only. Remove it to go back to the default.
KROMA_MODULE_LOGthe value of RUST_LOGHow much the modules log.
KROMA_PROFILINGonoff keeps the server from measuring where its time goes, whatever Admin → Performance says.

Modules

VariableDefaultWhat it does
KROMA_MODULE_ENVnoneNames of environment variables that programs started by modules may see. By default they see only a short safe list, never the server's own variables.
KROMA_MODULE_HOT_RELOADnone1 restarts a module when its file changes in the data folder. For module development only.

Updates and installation

VariableDefaultWhat it does
KROMA_UPDATE_DIRnoneThe folder shared with the host updater, which lets Server updates install updates in Docker. See server/updater.
KROMA_INSTALLset by the image and the packagedocker, synology or binary. Decides how Server updates installs an update, so do not change it.
KROMA_SELF_UPDATE_DIRset by the Synology packageWhere the package keeps the server versions it downloads for itself.
KROMA_WEB_DIRset by the image and the packageThe folder of the web app the server serves.
KROMA_MAIL_RELAY_URLhttps://mail.kroma.tvThe relay KROMA sends email through when you choose the relay for email. Change it only if you run your own relay.

Ports and folders in the Docker image

PortWhat it serves
4040the web app, the API and the video streams, over HTTP
4443the same over HTTPS, when KROMA_HTTPS=1
FolderWhat it holds
/dataeverything KROMA writes: database, images, modules, downloads in progress, certificate
your media, for example /mediayour films and series, at the path you mount them

The image runs as root unless you set user:. See Docker.

For developers and forks

VariableDefaultWhat it does
KROMA_RELEASES_URLKROMA's releases on GitHubThe release feed that Server updates reads.
KROMA_STATS_URLKROMA's collectorWhere the anonymous statistics go. A development build sends none unless this is set.
KROMA_APNS_KEY_P8, KROMA_APNS_KEY_ID, KROMA_APNS_TEAM_ID, KROMA_APNS_TOPIC, KROMA_FCM_SERVICE_ACCOUNTnonePush credentials for a fork that publishes its own apps. KROMA's own apps push through its relay.
KROMA_EMBED_MODEL_DIRnoneA model folder passed to the programs the Embeddings module starts.
Edit this page on GitHub