Command line parameters
Introduction
Domoticz can be started with various parameters to configure the environment. These parameters can be set in configuration files or during manual startup (eg ./domoticz -www 8080 -sslwww 443
)
Parameters
The following command line parameters are available:
-version display version number
-www port (for example -www 8080)
-wwwbind address (for example -wwwbind 0.0.0.0 or -wwwbind 192.168.0.20)
-wwwroot file_path (for example D:\www or /opt/domoticz/www)
-dbase file_path (for example D:\domoticz.db or /opt/domoticz/domoticz.db)
-userdata file_path (for example D:\domoticzdata or /opt/domoticz)
-approot file_path (for example D:\domoticz or /opt/domoticz)
-webroot additional web root, useful with proxy servers (for example domoticz)
-startupdelay seconds (default=0)
-nowwwpwd (in case you forgot the webserver username/ password)
-wwwcompress mode (on=always compress [default], off=always decompress, static=no processing but try precompressed first)
-nobrowser (do not start webbrowser) (Windows Only)
-noupdates (do not use the internal update functionality)
-dbase_disable_wal_mode (2021.1 beta, Database journal mode switch from WAL (write ahead) to DELETE)(Windows only)
-log file_path (for example D:\domoticz.log or /tmp/domoticz.txt)
-loglevel level_string (combination of: all,normal,status,error,debug)
-loglevel level_num (addition of: 1=normal, 2=status, 4=error, 8=debug)(-loglevel debug has to be set to display debug messages)
-debuglevel level_string (combination of: all,normal,hardware,received,webserver,eventsystem,python,thread_id,sql)(-loglevel debug has to be set to enable debug)
-debuglevel level_num (addition of: 1=normal, 2=hardware, 4=received, 8=webserver, 16=eventsystem, 32=python, 64=threadids, 128=sql)(-loglevel debug has to be set to enable debug)
-notimestamps (do not prepend timestamps to logs; useful with syslog, etc.)
-php_cgi_path (for example /usr/bin/php-cgi)
-daemon (run as background daemon)(Unix Only)
-pidfile pid file location (for example /var/run/domoticz.pid)(Unix Only)
-syslog [user|daemon|local0 .. local7] (use syslog as log output, defaults to facility 'user')(Unix Only)
-f config_file (for example /etc/domoticz.conf)(Unix Only) Easy for debugging, a sample config file can be found in link
-weblog file_path (for example /var/log/domoticz_access.log) Creates Apache Combined Logformat logs containg all webrequests. (Beta)
- NOTE for Raspberry PI users: Generating these logfiles means constant writing to the filesystem. When running Domoticz on a Raspberry Pi off a SD-card, this logging feature can really cause a lot of wear on such a card and shorten the lifespan of these cards. If you want to get these logs even when running on a Pi, either attach a separate (USB) harddrive to write to. Or have the logging forwarded to another machine using
syslog
. This can be done by specifying 'syslog:' as the 'weblog file'. But this only works when you enabledsyslog
for the other logging as well! See the-syslog
commandline option.
If Domoticz is compiled with SSL support:
-sslwww port (for example -sslwww 443, or -sslwww 0 to disable https)
-sslcert file_path (for example /opt/domoticz/server_cert.pem)
-sslkey file_path (if different from certificate file)
-sslpass passphrase (to access to server private key in certificate)
-sslmethod method (supported methods: tlsv1, tlsv1_server, sslv23, sslv23_server, tlsv11, tlsv11_server, tlsv12, tlsv12_server)
-ssloptions options (for SSL options, default is 'default_workarounds,no_sslv2,no_sslv3,no_tlsv1,no_tlsv1_1,single_dh_use')
-ssldhparam file_path (for SSL DH parameters)
If no –sslcert parameter is provided, Domoticz will use server_cert.pem from its installation folder
Unix Deamon configuration
The above mentioned command line parameters can be added as DEAMON_ARGS in /etc/init.d/domoticz.sh. See for instructions page Installation Linux
Or in the file /etc/systemd/system/domoticz.service when systemd is used (more recent systems) edit the line ExecStart=/home/domoticz/domoticz/domoticz -www 8080 -sslwww 443
Docker environment values
You can use these command line parameters also as Environment values when using EXTRA_CMD_ARG. See also Docker page https://hub.docker.com/r/domoticz/domoticz
Windows Domoticz startup parameters:
For new installations or update of current installations the decision to use an external logfile and the full qualified filename of that logfile is done during the installation dialogue.
For adding other command line parameters (including log file without the need for reinstalling) take the following steps:
- When running as a service change regkey
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Domoticz\Parameters
. Add valueAppParameters
with the command line parameters eg: -log "<Path-to-logfile\domoticz.log>" - When running as an app define it in the target field of the Domoticz properties window (right click on Icon). Something like C:\Users\Public\Domoticz\domoticz.exe -www 8080 -sslwww 443 -log "C:\Users\Public\Domoticz\domoticz.log" -loglevel normal,status,error