Skip to main content

Command-line options

Normally the Kodi add-on starts the elementum binary itself, and you don’t need any of this. You need it when you run the daemon separately from Kodi: on a NAS, in Docker, as a Linux daemon or Windows service, or on a platform that has no Elementum binary.

The binary is inside the add-on zip, in resources/bin/<platform>/elementum (elementum.exe on Windows).

Flags

Flags use one dash and name=value form, e.g. -remoteHost=192.168.1.10. Run elementum -h to see the list for your version. Flags with a list type can be repeated, e.g. -listenInterfaces=eth0 -listenInterfaces=wlan0.

The list below is generated from the source of the latest release.

From elementum v0.1.117.

FlagTypeDefaultDescription
-enableRequestTracingboolEnable ReqAPI tracing
-enableDatabaseTracingboolEnable database tracing
-enableCacheTracingboolEnable cache tracing
-disableParentProcessWatcherbool Disable functionality that checks whether parent process is alive
-disableCacheboolDisable caching for get/set methods
-disableCacheGetboolDisable caching for get methods
-disableCacheSetboolDisable caching for set methods
-disableBackupboolDisable database backup
-disableLibrarySyncboolDisable library sync (local strm updates and Trakt sync process)
-listenInterfacesstring, repeat the flag for several values List of interfaces/IPs to use for libtorrent listen_interfaces
-outgoingInterfacesstring, repeat the flag for several valuesList of interfaces/IPs to use for libtorrent outgoing_interfaces
-remoteHoststring Remote host IP or Hostname (Host with plugin.video.elementum running)
-remotePortint65221Remote host Port (Host with plugin.video.elementum running)
-serverExternalIpstring Set to external IP if you run server behind NAT (e.g. in container with NAT network), so elementum will use this IP in replies and will not try to identify Kodi's IP based on client's IP
-localHoststring Local host IP (IP that would be used for running Elementum HTTP server on a local host)
-localPortint65220Local host Port (Port that would be used for running Elementum HTTP server on a local host)
-localLoginstringLocal host Login (To use for authentication from plugin.video.elementum calls)
-localPasswordstringLocal host Password (To use for authentication from plugin.video.elementum calls)
-logPathstring Log file location path
-configPathstring Custom path to Elementum config (Yaml or JSON format)
-addonPathstringCustom path to addon folder (where Kodi stored files, coming with addon zip)
-profilePathstringCustom path to addon files folder (where Elementum will write data)
-tempPathstringCustom path to temp folder (where Elementum will write temporary files)
-libraryPathstringCustom path to addon library folder
-torrentsPathstringCustom path to addon torrent files folder
-downloadsPathstringCustom path to addon downloads folder
-moveMoviesPathstringCustom path to addon folder, used for moving completed Movie downloads
-moveShowsPathstringCustom path to addon folder, used for moving completed Show downloads
-exportConfigstring Export current configuration, taken from Kodi into a file. Should end with json or yml suffix
-librarySubstitutionsstring, repeat the flag for several values Define substitutions to perform for Kodi library paths in format: from|to. Can be used to operate cross-platform paths.

The daemon runs in server mode when -configPath or -disableParentProcessWatcher is set.

Config file

With -configPath the daemon does not ask Kodi for settings at all, it reads them from a file. The easiest way to get such a file is to export it from a working setup:

  1. Configure Elementum in Kodi as usual.
  2. Start the daemon once with -exportConfig=/path/to/elementum.yml (plus -remoteHost if Kodi is on another device). It reads the settings from Kodi, writes them to the file and keeps running; stop it afterwards.
  3. Edit the file if needed and start the daemon with -configPath=/path/to/elementum.yml.

The file has the add-on info, the platform and a settings map. Keys in settings are the IDs from Kodi add-on settings, for example:

settings:
  download_storage: 0       # 0 = File, 1 = Memory
  download_path: /data/downloads
  library_path: /data/library
  buffer_size: 20

Flags still win over the file: e.g. -downloadsPath overrides download_path.

Client-server mode

Kodi runs the add-on in client mode and talks to a daemon running elsewhere.

On the server (where the daemon runs):

./elementum \
  -disableParentProcessWatcher \
  -remoteHost=192.168.1.20 \
  -localPort=65220 \
  -localLogin=user -localPassword=secret

192.168.1.20 is the Kodi device. Add -configPath=... to keep settings in a file instead of reading them from Kodi.

In Kodi, in Elementum → Configure → Addon Startup:

Setting Value
Do not start binary (client mode) On
Remote host IP of the server
Remote port 65220 (the server’s -localPort)
Local port 65221 (the server’s -remotePort)
Remote host login / password the server’s -localLogin / -localPassword

Restart Kodi after changing these. Kodi must allow remote control (Settings → Services → Control, both “Allow remote control” options), so the daemon can reach Kodi’s JSON-RPC.