<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.domoticz.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pipiche+dz</id>
	<title>Domoticz Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.domoticz.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pipiche+dz"/>
	<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/Special:Contributions/Pipiche_dz"/>
	<updated>2026-09-20T04:08:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wiki.domoticz.com/index.php?title=Command_line_parameters&amp;diff=18753</id>
		<title>Command line parameters</title>
		<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/index.php?title=Command_line_parameters&amp;diff=18753"/>
		<updated>2024-12-23T15:50:35Z</updated>

		<summary type="html">&lt;p&gt;Pipiche dz: Adding pYTHONPATH environment variable description&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Introduction===&lt;br /&gt;
Domoticz can be started with various parameters to configure the environment. These parameters can be set in configuration files or during manual startup (eg &amp;lt;code&amp;gt;./domoticz -www 8080 -sslwww 443&amp;lt;/code&amp;gt;)  &lt;br /&gt;
&lt;br /&gt;
===Parameters===&lt;br /&gt;
The following command line parameters are available: &lt;br /&gt;
&lt;br /&gt;
-version display version number &lt;br /&gt;
&lt;br /&gt;
-www port (for example -www 8080)&lt;br /&gt;
&lt;br /&gt;
-wwwbind address (for example -wwwbind 0.0.0.0 or -wwwbind 192.168.0.20)&lt;br /&gt;
&lt;br /&gt;
-wwwroot file_path (for example D:\www or /opt/domoticz/www)&lt;br /&gt;
&lt;br /&gt;
-dbase file_path (for example D:\domoticz.db or /opt/domoticz/domoticz.db) &lt;br /&gt;
&lt;br /&gt;
-userdata file_path (for example D:\domoticzdata or /opt/domoticz) &lt;br /&gt;
&lt;br /&gt;
-approot file_path (for example D:\domoticz or /opt/domoticz) &lt;br /&gt;
&lt;br /&gt;
-webroot additional web root, useful with proxy servers (for example domoticz) &lt;br /&gt;
&lt;br /&gt;
-startupdelay seconds (default=0) &lt;br /&gt;
&lt;br /&gt;
-nowwwpwd (in case you forgot the webserver username/ password) &lt;br /&gt;
&lt;br /&gt;
-wwwcompress mode (on=always compress [default], off=always decompress, static=no processing but try precompressed first) &lt;br /&gt;
&lt;br /&gt;
-nobrowser (do not start webbrowser) (Windows Only) &lt;br /&gt;
&lt;br /&gt;
-noupdates (do not use the internal update functionality) &lt;br /&gt;
&lt;br /&gt;
-dbase_disable_wal_mode (2021.1 beta, Database journal mode switch from WAL (write ahead) to DELETE)(Windows only) &lt;br /&gt;
&lt;br /&gt;
-log file_path (for example D:\domoticz.log or /tmp/domoticz.txt) &lt;br /&gt;
&lt;br /&gt;
-loglevel level_string (combination of: all,normal,status,error,debug) &lt;br /&gt;
&lt;br /&gt;
-loglevel level_num (addition of: 1=normal, 2=status, 4=error, 8=debug)(-loglevel debug has to be set to display debug messages) &lt;br /&gt;
&lt;br /&gt;
-debuglevel level_string (combination of: all,normal,hardware,received,webserver,eventsystem,python,thread_id,sql)(-loglevel debug has to be set to enable debug) &lt;br /&gt;
&lt;br /&gt;
-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) &lt;br /&gt;
&lt;br /&gt;
-notimestamps (do not prepend timestamps to logs; useful with syslog, etc.) &lt;br /&gt;
&lt;br /&gt;
-php_cgi_path (for example /usr/bin/php-cgi) &lt;br /&gt;
&lt;br /&gt;
-daemon (run as background daemon)(Unix Only) &lt;br /&gt;
&lt;br /&gt;
-pidfile pid file location (for example /var/run/domoticz.pid)(Unix Only) &lt;br /&gt;
&lt;br /&gt;
-syslog [user|daemon|local0 .. local7] (use syslog as log output, defaults to facility &#039;user&#039;)(Unix Only)&lt;br /&gt;
&lt;br /&gt;
-f config_file (for example /etc/domoticz.conf)(Unix Only) Easy for debugging, a sample config file can be found in [https://raw.githubusercontent.com/domoticz/domoticz/development/scripts/domoticz.conf link]&lt;br /&gt;
&lt;br /&gt;
-weblog file_path (for example /var/log/domoticz_access.log) Creates Apache Combined Logformat logs containg all webrequests. (Beta)&lt;br /&gt;
&lt;br /&gt;
*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 &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt;. This can be done by specifying &#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;syslog:&#039;&amp;lt;nowiki/&amp;gt;&#039;&#039; as the &#039;&#039;&amp;lt;nowiki/&amp;gt;&#039;weblog file&#039;&#039;&#039;. But this only works when you enabled &amp;lt;code&amp;gt;syslog&amp;lt;/code&amp;gt; for the other logging as well! See the &amp;lt;code&amp;gt;-syslog&amp;lt;/code&amp;gt; commandline option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If Domoticz is compiled with SSL support:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
-sslwww port (for example -sslwww 443, or -sslwww 0 to disable https) &lt;br /&gt;
&lt;br /&gt;
-sslcert file_path (for example /opt/domoticz/server_cert.pem) &lt;br /&gt;
&lt;br /&gt;
-sslkey file_path (if different from certificate file) &lt;br /&gt;
&lt;br /&gt;
-sslpass passphrase (to access to server private key in certificate) &lt;br /&gt;
&lt;br /&gt;
-sslmethod method (supported methods: tlsv1, tlsv1_server, sslv23, sslv23_server, tlsv11, tlsv11_server, tlsv12, tlsv12_server) &lt;br /&gt;
&lt;br /&gt;
-ssloptions options (for SSL options, default is &#039;default_workarounds,no_sslv2,no_sslv3,no_tlsv1,no_tlsv1_1,single_dh_use&#039;) &lt;br /&gt;
&lt;br /&gt;
-ssldhparam file_path (for SSL DH parameters) &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If no –sslcert parameter is provided, Domoticz will use server_cert.pem from its installation folder&lt;br /&gt;
&lt;br /&gt;
===Unix Deamon configuration===&lt;br /&gt;
The above mentioned command line parameters can be added as DEAMON_ARGS in /etc/init.d/domoticz.sh. See for instructions page [[Linux|Installation Linux]]&lt;br /&gt;
&lt;br /&gt;
Or in the file /etc/systemd/system/domoticz.service when systemd is used (more recent systems) edit the line &amp;lt;code&amp;gt;ExecStart=/home/domoticz/domoticz/domoticz -www 8080 -sslwww 443&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Python plugin environment===&lt;br /&gt;
&lt;br /&gt;
In the context of embedded Python in C++ code, PYTHONPATH is an environment variable that specifies the directories where Python looks for modules and packages. It plays a crucial role in ensuring your embedded Python code can locate and import the required Python modules.&lt;br /&gt;
&lt;br /&gt;
Key Uses of PYTHONPATH:&lt;br /&gt;
&lt;br /&gt;
# Module Discovery: When your embedded Python code executes an import statement, Python searches for the module in directories listed in PYTHONPATH, in addition to the standard library paths.&lt;br /&gt;
&lt;br /&gt;
# Custom Module Locations: If your project includes custom Python modules or packages that are not installed in the standard Python library directories, you can add their paths to PYTHONPATH to make them accessible.&lt;br /&gt;
&lt;br /&gt;
# Isolation of Dependencies: You can use PYTHONPATH to point to a specific directory containing dependencies, ensuring your embedded Python environment is isolated and predictable.&lt;br /&gt;
&lt;br /&gt;
# Debugging and Testing: During development, you might use PYTHONPATH to include paths for testing modules or different versions of libraries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Docker environment values===&lt;br /&gt;
You can use these command line parameters also as Environment values when using &#039;&#039;&#039;EXTRA_CMD_ARG.&#039;&#039;&#039; See also Docker page https://hub.docker.com/r/domoticz/domoticz&lt;br /&gt;
&lt;br /&gt;
===Windows Domoticz startup parameters:===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
For adding other command line parameters (including log file without the need for reinstalling) take the following steps:&lt;br /&gt;
&lt;br /&gt;
#When running as a service change regkey &amp;lt;code&amp;gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Domoticz\Parameters&amp;lt;/code&amp;gt;  . Add  value &amp;lt;code&amp;gt;AppParameters&amp;lt;/code&amp;gt; with  the command line parameters eg: -log &amp;quot;&amp;lt;Path-to-logfile\domoticz.log&amp;gt;&amp;quot;&lt;br /&gt;
#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 &amp;quot;C:\Users\Public\Domoticz\domoticz.log&amp;quot;  -loglevel normal,status,error&lt;/div&gt;</summary>
		<author><name>Pipiche dz</name></author>
	</entry>
	<entry>
		<id>https://wiki.domoticz.com/index.php?title=Linux&amp;diff=18752</id>
		<title>Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/index.php?title=Linux&amp;diff=18752"/>
		<updated>2024-12-19T14:14:48Z</updated>

		<summary type="html">&lt;p&gt;Pipiche dz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to compile/build the latest beta snapshot of Domoticz for Debian-based Linux operating systems. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no need for all this if you&#039;re just installing a pre-built binary (see the [https://www.domoticz.com/downloads/ downloads page] for that).  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use pre-built installation==&lt;br /&gt;
If no source code changes or special compile actions/environments are needed just install a pre-built binary (see the [https://www.domoticz.com/downloads/ downloads page] for that). Minimum supported Ubuntu version for pre-built: 20.04 LTS&lt;br /&gt;
&lt;br /&gt;
Ubuntu installation in terminal:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sudo bash -c &amp;quot;$(curl -sSfL &amp;lt;nowiki&amp;gt;https://install.domoticz.com&amp;lt;/nowiki&amp;gt;)&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will get an install dialog and some questions will be asked about  HTTP/HTTPS enablement for WebUI and related ports.&lt;br /&gt;
&lt;br /&gt;
[[File:Domoticz install1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Domoticz install finished.png]]&lt;br /&gt;
&lt;br /&gt;
Just point your browser to the IP address of your Linux system, and use the port specified during the installation script.&amp;lt;br&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;http://192.168.0.10:8080&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&#039;&#039;&#039;From 2023.1 Stable:&#039;&#039;&#039; By default Domoticz is protected by a username (&#039;&#039;admin&#039;&#039;) and password (&#039;&#039;domoticz&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Now you can go on and visit the [[Getting started]] documentation area for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Use Docker container==&lt;br /&gt;
You can also install Domoticz as a Docker container. Go to wiki page [[Docker]] for the instructions&lt;br /&gt;
==Compiling the source code==&lt;br /&gt;
If you made source code changes or your environment is not compatible with the [https://www.domoticz.com/downloads/ pre-built images] you can compile and install Domoticz yourself.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Follow the steps provided here&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Build Domoticz from source|Build_Domoticz_from_source]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Allow non-root user to access ttyUSB* ports==&lt;br /&gt;
&lt;br /&gt;
If&amp;lt;nowiki/&amp;gt; you don&#039;t plan on interfacing Domoticz with USB and/or serial devices, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
By default (at least on Ubuntu) a non-root user has no permission to access the ttyUSB* ports. So if you have Domoticz running under a separate user &#039;&#039;(which is always a good idea to make the system more secure)&#039;&#039;, Domoticz isn&#039;t allowed access to your RFXCOM for example. Here are two methods of doing it. For most people the first one by adding the user to the dialout goup is enough and by far the easiest. &lt;br /&gt;
&lt;br /&gt;
===Adding the user to the dialout group===&lt;br /&gt;
This can be done by running the command below:&lt;br /&gt;
 sudo usermod -a -G dialout YOURUSERNAME&lt;br /&gt;
&#039;&#039;(Where you replace YOURUSERNAME with the user that runs Domoticz.)&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting up a udev rule===&lt;br /&gt;
Alternatively you can setup (as root) a udev rule that matches the RFXCOM device. To find which attributes match your device use the command:&lt;br /&gt;
 udevadm info -a -p $(udevadm info -q path /dev/ttyUSB1) | less&lt;br /&gt;
Where /dev/ttyUSB1 is the device.&lt;br /&gt;
If you wish to run Domoticz under the YOURUSERNAME credentials, who is member of the YOURGROUPNAME group and your device has serial YOURSERIAL a suitable udev rule would be:&lt;br /&gt;
 SUBSYSTEM==&amp;quot;tty&amp;quot;, SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;0403&amp;quot;, ATTRS{serial}==&amp;quot;YOURSERIAL&amp;quot;, ATTRS{idProduct}==&amp;quot;6001&amp;quot;, SYMLINK+=&amp;quot;ttyUSB21&amp;quot;, OWNER=&amp;quot;YOURUSERNAME&amp;quot;, GROUP=&amp;quot;YOURGROUPNAME&amp;quot;&lt;br /&gt;
Save it to a file under /etc/udev/rules.d/ with the .rules extention and run:&lt;br /&gt;
 service udev reload&lt;br /&gt;
Unplug and replug the device and execute:&lt;br /&gt;
 ls -l /dev/ttyUSB*&lt;br /&gt;
You should see something like&lt;br /&gt;
 crw-rw---- 1 domoticz domoticz 188, 1 Nov 10 15:27 /dev/ttyUSB1&lt;br /&gt;
 lrwxrwxrwx 1 root     root          7 Nov 10 15:27 /dev/ttyUSB21 -&amp;gt; ttyUSB1&lt;br /&gt;
The added SYMLINK+= creates an additional link to the device node. This is a static name that is useful when you have multiple usb-serial devices that go into your box. Use the static link in Domoticz.&lt;br /&gt;
For more information on udev rules have a look here: http://www.reactivated.net/writing_udev_rules.html&lt;br /&gt;
&lt;br /&gt;
==Starting Domoticz automatically when the system boots==&lt;br /&gt;
There are basically two ways to do this - via init.d (which starts things serially) or via systemd (which starts things up in parallel and therefore leads to faster booting). On modern systems the systemd method is generally preferred.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The &amp;quot;pre-built&amp;quot; install method already creates a service that starts Domoticz after reboot or restart of your system.&lt;br /&gt;
===Option 1: Init.d Method (not preferred)===&lt;br /&gt;
To let Domoticz start automatically when the system boots &#039;&#039;(which is probably the case, as most people run it on a headless server)&#039;&#039;, run the commands below, (You want to end up in &#039;&#039;/home/YOURUSERNAME/domoticz/&#039;&#039;)&amp;lt;br&amp;gt;&lt;br /&gt;
 cd domoticz&lt;br /&gt;
 sudo cp domoticz.sh /etc/init.d&lt;br /&gt;
 sudo chmod +x /etc/init.d/domoticz.sh&lt;br /&gt;
 sudo update-rc.d domoticz.sh defaults&lt;br /&gt;
&lt;br /&gt;
Edit the startup script. &lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/init.d/domoticz.sh&lt;br /&gt;
&lt;br /&gt;
The lines you usually need to change are USERNAME, DAEMON and DAEMON_ARGS&lt;br /&gt;
&lt;br /&gt;
 USERNAME=yourusername&lt;br /&gt;
 DAEMON=/home/$USERNAME/domoticz/$NAME&lt;br /&gt;
 DAEMON_ARGS=&amp;quot;-daemon -www 8080&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*Change the USERNAME variable to the user you want domoticz to be run as. It&#039;s recommended to run domoticz as its own user and not as root, due to security reasons.&lt;br /&gt;
*If you installed Domoticz in the USERNAME home directory &amp;lt;code&amp;gt;/home/yourusername/domoticz&amp;lt;/code&amp;gt; you don&#039;t need to change the DAEMON variable. If you installed it in an alternate location for example &amp;lt;code&amp;gt;/usr/local/domoticz/&amp;lt;/code&amp;gt; you should change DAEMON to &amp;lt;code&amp;gt;/usr/local/domoticz/$NAME&amp;lt;/code&amp;gt;&lt;br /&gt;
*If you want to use another web interface port change the &#039;8080&#039; in: &amp;lt;code&amp;gt;DAEMON_ARGS=&amp;quot;-daemon www 8080&amp;quot;&amp;lt;/code&amp;gt; to your own port.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: To be able to use ports below 1024, for example the standard port for webbrowsing, 80, you need to run domoticz as the root user.&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to see more arguments for DAEMON_ARGS run this in the domoticz directory (or check page [[Command line parameters]]). This is usually not needed.&lt;br /&gt;
 ./domoticz -h&lt;br /&gt;
&lt;br /&gt;
Domoticz will now start automatically when you reboot your machine.&lt;br /&gt;
&lt;br /&gt;
====Manually controlling the Domoticz service====&lt;br /&gt;
&lt;br /&gt;
This only works if you followed the above steps.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now start/stop/restart and check the status of domoticz with:&amp;lt;br&amp;gt;&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh start&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh stop&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh restart&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh status&lt;br /&gt;
&lt;br /&gt;
If your system supports it you can instead use:&amp;lt;br&amp;gt;&lt;br /&gt;
 sudo service domoticz.sh start&lt;br /&gt;
 sudo service domoticz.sh stop&lt;br /&gt;
 sudo service domoticz.sh restart&lt;br /&gt;
 sudo service domoticz.sh status&lt;br /&gt;
&lt;br /&gt;
===Option 2: Systemd Alternative (Preferred)===&lt;br /&gt;
Open the systemd configuration file, here you can change the port number you wish to use.  To use a port below 1024 you can run as root (not reccomended) or you can un-comment one of the marked lines in the file - you should only un-comment one of the lines depending on your Ubuntu version&amp;lt;span&amp;gt; &amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/systemd/system/domoticz.service&lt;br /&gt;
&lt;br /&gt;
 [Unit]&lt;br /&gt;
        Description=domoticz_service&lt;br /&gt;
 [Service]&lt;br /&gt;
        User=domoticz&lt;br /&gt;
        Group=domoticz&lt;br /&gt;
        EnvironmentFile=/home/pi/domoticz.env&lt;br /&gt;
        ExecStart=/home/domoticz/domoticz/domoticz -www 8080 -sslwww 443&lt;br /&gt;
        WorkingDirectory=/home/domoticz&lt;br /&gt;
        #        &lt;br /&gt;
        # Give the right to open priviliged ports. This allows you to run on a port &amp;lt;1024 without root permissions (user/group setting above)&lt;br /&gt;
        #&lt;br /&gt;
        # The following line is for pre-16.04 systems.&lt;br /&gt;
        # ExecStartPre=setcap &#039;cap_net_bind_service=+ep&#039; /home/domoticz/domoticz/domoticz&lt;br /&gt;
        #&lt;br /&gt;
        # The below works on Ubuntu 16.04 LTS&lt;br /&gt;
        # CapabilityBoundingSet=CAP_NET_BIND_SERVICE&lt;br /&gt;
        #&lt;br /&gt;
        # The following works on Ubuntu 18.04&lt;br /&gt;
        # AmbientCapabilities=CAP_NET_BIND_SERVICE&lt;br /&gt;
        #&lt;br /&gt;
        Restart=on-failure&lt;br /&gt;
        RestartSec=1m&lt;br /&gt;
        #StandardOutput=null&lt;br /&gt;
 [Install]&lt;br /&gt;
        WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
or on Raspberry Pi Stretch as root (remove &#039;#&#039; on User and Group lines to run as &#039;Pi&#039; user):&lt;br /&gt;
 [Unit]&lt;br /&gt;
       Description=domoticz_service&lt;br /&gt;
 [Service]&lt;br /&gt;
       #User=pi&lt;br /&gt;
       #Group=users&lt;br /&gt;
       ExecStart=/home/pi/domoticz/domoticz -www 8080 -sslwww 443&lt;br /&gt;
       EnvironmentFile=/home/pi/domoticz.env&lt;br /&gt;
       WorkingDirectory=/home/pi/domoticz&lt;br /&gt;
       ExecStartPre=setcap &#039;cap_net_bind_service=+ep&#039; /home/pi/domoticz/domoticz&lt;br /&gt;
       Restart=on-failure&lt;br /&gt;
       RestartSec=1m&lt;br /&gt;
       #StandardOutput=null&lt;br /&gt;
 [Install]&lt;br /&gt;
       WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
on Raspbian Linux 10 (buster), I had to add this just before  ExecStartPre=setcap  now it works. I don&#039;t know about security implications!! &amp;lt;br&amp;gt;&lt;br /&gt;
The service file must add the directive &amp;quot;PermissionsStartOnly=true&amp;quot;, in order to be able to execute the &amp;quot;ExecStartPre=/sbin/setcap &#039;cap_net_bind_service=+ep&#039; ...&amp;quot; one! &amp;lt;br&amp;gt;For extra command line parameters in line ExecStart= check page [[Command line parameters]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to set some specific environment variable for the execution of the domoticz daemon, you can use the filename specified in the EnvironmentFile clause to do so.&lt;br /&gt;
Here for example, we are setting the PYTHONPATH to use a local python environment .&lt;br /&gt;
&lt;br /&gt;
 vi /home/pi/domoticz.env&lt;br /&gt;
&lt;br /&gt;
 PYTHONPATH=&amp;quot;/home/domoticz/Domoticz_Python_Environment/:$PYTHONPATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable the service====&lt;br /&gt;
 systemctl daemon-reload&lt;br /&gt;
 systemctl enable domoticz.service&lt;br /&gt;
====Start the service====&lt;br /&gt;
 systemctl start domoticz.service&lt;br /&gt;
&lt;br /&gt;
Note: Use only one of these two alternatives (init.d method or systemd method) for auto-start.&lt;br /&gt;
&lt;br /&gt;
==Updating Domoticz==&lt;br /&gt;
Once in a while, a new Domoticz version is released, and of course you want to update. &lt;br /&gt;
&lt;br /&gt;
Use the Web Interface to update Domoticz (Menu Setup-&amp;gt;Check for Updates) &lt;br /&gt;
&lt;br /&gt;
If this fails for any reason (e.g. partial download giving segmentation fault) then you should manually update by: &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#Navigate to the directory where Domoticz is installed: &amp;lt;code&amp;gt;cd domoticz&amp;lt;/code&amp;gt; (You want to end up in &#039;&#039;/home/YOURUSERNAME/domoticz/&#039;&#039;)&amp;lt;br&amp;gt;&lt;br /&gt;
#Update to the latest Beta with: &amp;lt;code&amp;gt;sudo ./updatebeta&amp;lt;/code&amp;gt;&lt;br /&gt;
#Update to the latest Release with: &amp;lt;code&amp;gt;sudo ./updaterelease&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If all went correctly, Domoticz should be updated to the latest version and should be running again automatically.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Revert to backup after incorrect update===&lt;br /&gt;
For updates (beta and stable) an automatic backup of the complete domoticz environment including scripts and plugins is created in &amp;lt;code&amp;gt;domoticz/backups/domoticz_backup_yyyymmdd_hhmmss.tar.gz&amp;lt;/code&amp;gt; by the update script.&lt;br /&gt;
&lt;br /&gt;
To extract that backup:&lt;br /&gt;
&lt;br /&gt;
*enter domoticz backup directory (where domoticz store a backup before upgrading)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd ~&amp;lt;USER&amp;gt;/domoticz/backups&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*run tar command to extract the backup (specify the right filename and correct domoticz folder)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;tar xvzf domoticz_backup_yyyymmdd_hhmms.tar.gz -C /home/&amp;lt;USER&amp;gt;/domoticz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*restart domoticz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;service domoticz restart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Attention:&#039;&#039;&#039; when you use [https://mmonit.com/monit/ Monit], be sure to disable it before doing the update process, otherwise after you have stopped Domoticz by hand yourself, it will get restarted automatically by Monit within a few minutes (because that is what is Monit should do normally).&amp;lt;br&amp;gt;&lt;br /&gt;
Stopping Monit can be done by &amp;lt;code&amp;gt;sudo /etc/init.d/monit stop&amp;lt;/code&amp;gt; and after updating it can be started again with &amp;lt;code&amp;gt;sudo /etc/init.d/monit start&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
You could also use this command: &amp;lt;code&amp;gt;make &amp;amp;&amp;amp; sudo /etc/init.d/domoticz.sh start &amp;amp;&amp;amp; sudo /etc/init.d/monit start&amp;lt;/code&amp;gt; to update, start Domoticz &amp;amp; start Monit when updating is done.&lt;br /&gt;
===Script to update almost automatically===&lt;br /&gt;
For updating almost automatically, i made this script&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#! /bin/sh&lt;br /&gt;
cd /home/YOURUSERNAME/domoticz/ \&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/monit stop \&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/domoticz.sh stop \&lt;br /&gt;
&amp;amp;&amp;amp; git pull \&lt;br /&gt;
&amp;amp;&amp;amp; make \&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/domoticz.sh start\&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/monit start &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Save it as &#039;&#039;domoupdater.sh&#039;&#039;, give it executable rights (&amp;lt;code&amp;gt;chmod +x domoupdater.sh&amp;lt;/code&amp;gt;) and call it by &amp;lt;code&amp;gt;sh /home/YOURUSERNAME/domoupdater.sh&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It will change the current path to the Domoticz folder, stop Monit, stop Domoticz, pull binaries, compile, start Domoticz, start Monit again.&amp;lt;br&amp;gt;&lt;br /&gt;
Very handy to run &amp;amp; go do something else.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In theory it can work automatically (weekly cronjob for example), however when running as a non-root user (which is the case in my situation), it will ask for the password of the user. But after you have provided the password (almost immediately after the script has started), it will continue without needing any further user input.&amp;lt;br&amp;gt;&lt;br /&gt;
In theory it is possible to let it run fully automated, but i myself prefer a bit of feedback (watching afterwards if all went well). If you want to work around this sudo password asking, look [http://superuser.com/a/67766 here].&lt;br /&gt;
&lt;br /&gt;
when compiling the main Domoticz binary. For more information read this thread on the forum: [https://www.domoticz.com/forum/viewtopic.php?f=28&amp;amp;t=12625#p90568 Link]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
==Problems locating Python==&lt;br /&gt;
Some users, particularly those on old operating systems see the following message when starting Domoticz:&lt;br /&gt;
&lt;br /&gt;
  2016-12-20 09:44:32.251 Failed dynamic library load, install the latest libpython3.x library that is available for your platform. &lt;br /&gt;
&lt;br /&gt;
this shows that, even though python3 may be on the system, the python library can not be located.  This error will not stop Domoticz from starting but will mean that hardware supported by the Python Plugin Framework will not be available. To fix this, install the newest version of libpython3 for the platform. For example, RaspberryPi Jessie has python 3.4 on it but the library is not included.  Executing:&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install libpython3.4&lt;br /&gt;
&lt;br /&gt;
should solve the issue.  Note that python 3.4 is the earliest support version of python, where available later versions should always be used.&amp;lt;br&amp;gt;&lt;br /&gt;
If you are building from source and python 3 is installed but Make is not able to progress, try to add &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
  set(Python_ADDITIONAL_VERSIONS 3.4)&lt;br /&gt;
just before &#039;&#039;find_package(PythonLibs 3.4)&#039;&#039; in the CMakeLists.txt&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your platform does not have a compatible version, for example RaspberryPi Wheezy, then one can be built from source using:&lt;br /&gt;
  wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz&lt;br /&gt;
  tar -xvf Python-3.5.2.tar.xz&lt;br /&gt;
  cd Python-3.5.2&lt;br /&gt;
  ./configure --enable-shared&lt;br /&gt;
  make&lt;br /&gt;
  sudo make install&lt;br /&gt;
Don&#039;t miss the enabled-shared flag otherwise libpython will not be built.&lt;br /&gt;
&lt;br /&gt;
Note: Only peform this step if you are building from source and are having issues, it should not be required.&amp;lt;br&amp;gt;&lt;br /&gt;
After building Python 3.5.x change CMakeLists.txt&lt;br /&gt;
  option(USE_PYTHON_PLUGINS &amp;quot;Use Python Plugins&amp;quot; YES)&lt;br /&gt;
  IF(USE_PYTHON_PLUGINS)&lt;br /&gt;
    set(Python_ADDITIONAL_VERSIONS 3.5)      &amp;lt;---- add this line&lt;br /&gt;
    find_package(PythonLibs 3.5)   &amp;lt;---- change version into 3.5&lt;br /&gt;
    IF(PYTHONLIBS_FOUND)&lt;br /&gt;
&lt;br /&gt;
==Monitoring Domoticz==&lt;br /&gt;
Software crashes, it&#039;s a fact of life. Luckily there are a number of ways to keep an eye on Domoticz, and automaticallty restart it if it crashes. The following page gives instructions [[Monitoring domoticz]]&lt;br /&gt;
&lt;br /&gt;
==Add support for Tellstick==&lt;br /&gt;
If you need support for Tellstick or Tellstic Duo you need to install telldus-core before compiling Domoticz. On Debian-based systems (For example Ubuntu and Raspbian) telldus-core can be installed by doing the following:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;deb &amp;lt;nowiki&amp;gt;http://download.telldus.com/debian/&amp;lt;/nowiki&amp;gt; stable main&amp;quot; | sudo tee /etc/apt/sources.list.d/telldus.list&lt;br /&gt;
 wget -q &amp;lt;nowiki&amp;gt;http://download.telldus.se/debian/telldus-public.key&amp;lt;/nowiki&amp;gt; -O- | sudo apt-key add -&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install libtelldus-core-dev&lt;br /&gt;
   &lt;br /&gt;
==How to set up a virtual machine to run Domoticz==&lt;br /&gt;
&lt;br /&gt;
[[How to set up a virtual machine to run Domoticz]]&lt;br /&gt;
&lt;br /&gt;
   [[Category:Domoticz]]  &lt;br /&gt;
   &lt;br /&gt;
   [[Category:Manual]]  &lt;br /&gt;
   &lt;br /&gt;
   [[Category:Install]]  &lt;br /&gt;
   &lt;br /&gt;
   [[Category:Linux]]&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
[[Category:Python]]&lt;/div&gt;</summary>
		<author><name>Pipiche dz</name></author>
	</entry>
	<entry>
		<id>https://wiki.domoticz.com/index.php?title=Linux&amp;diff=18751</id>
		<title>Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/index.php?title=Linux&amp;diff=18751"/>
		<updated>2024-12-19T14:13:56Z</updated>

		<summary type="html">&lt;p&gt;Pipiche dz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to compile/build the latest beta snapshot of Domoticz for Debian-based Linux operating systems. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no need for all this if you&#039;re just installing a pre-built binary (see the [https://www.domoticz.com/downloads/ downloads page] for that).  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use pre-built installation==&lt;br /&gt;
If no source code changes or special compile actions/environments are needed just install a pre-built binary (see the [https://www.domoticz.com/downloads/ downloads page] for that). Minimum supported Ubuntu version for pre-built: 20.04 LTS&lt;br /&gt;
&lt;br /&gt;
Ubuntu installation in terminal:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sudo bash -c &amp;quot;$(curl -sSfL &amp;lt;nowiki&amp;gt;https://install.domoticz.com&amp;lt;/nowiki&amp;gt;)&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will get an install dialog and some questions will be asked about  HTTP/HTTPS enablement for WebUI and related ports.&lt;br /&gt;
&lt;br /&gt;
[[File:Domoticz install1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Domoticz install finished.png]]&lt;br /&gt;
&lt;br /&gt;
Just point your browser to the IP address of your Linux system, and use the port specified during the installation script.&amp;lt;br&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;http://192.168.0.10:8080&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&#039;&#039;&#039;From 2023.1 Stable:&#039;&#039;&#039; By default Domoticz is protected by a username (&#039;&#039;admin&#039;&#039;) and password (&#039;&#039;domoticz&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Now you can go on and visit the [[Getting started]] documentation area for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Use Docker container==&lt;br /&gt;
You can also install Domoticz as a Docker container. Go to wiki page [[Docker]] for the instructions&lt;br /&gt;
==Compiling the source code==&lt;br /&gt;
If you made source code changes or your environment is not compatible with the [https://www.domoticz.com/downloads/ pre-built images] you can compile and install Domoticz yourself.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Follow the steps provided here&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Build Domoticz from source|Build_Domoticz_from_source]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Allow non-root user to access ttyUSB* ports==&lt;br /&gt;
&lt;br /&gt;
If&amp;lt;nowiki/&amp;gt; you don&#039;t plan on interfacing Domoticz with USB and/or serial devices, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
By default (at least on Ubuntu) a non-root user has no permission to access the ttyUSB* ports. So if you have Domoticz running under a separate user &#039;&#039;(which is always a good idea to make the system more secure)&#039;&#039;, Domoticz isn&#039;t allowed access to your RFXCOM for example. Here are two methods of doing it. For most people the first one by adding the user to the dialout goup is enough and by far the easiest. &lt;br /&gt;
&lt;br /&gt;
===Adding the user to the dialout group===&lt;br /&gt;
This can be done by running the command below:&lt;br /&gt;
 sudo usermod -a -G dialout YOURUSERNAME&lt;br /&gt;
&#039;&#039;(Where you replace YOURUSERNAME with the user that runs Domoticz.)&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting up a udev rule===&lt;br /&gt;
Alternatively you can setup (as root) a udev rule that matches the RFXCOM device. To find which attributes match your device use the command:&lt;br /&gt;
 udevadm info -a -p $(udevadm info -q path /dev/ttyUSB1) | less&lt;br /&gt;
Where /dev/ttyUSB1 is the device.&lt;br /&gt;
If you wish to run Domoticz under the YOURUSERNAME credentials, who is member of the YOURGROUPNAME group and your device has serial YOURSERIAL a suitable udev rule would be:&lt;br /&gt;
 SUBSYSTEM==&amp;quot;tty&amp;quot;, SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;0403&amp;quot;, ATTRS{serial}==&amp;quot;YOURSERIAL&amp;quot;, ATTRS{idProduct}==&amp;quot;6001&amp;quot;, SYMLINK+=&amp;quot;ttyUSB21&amp;quot;, OWNER=&amp;quot;YOURUSERNAME&amp;quot;, GROUP=&amp;quot;YOURGROUPNAME&amp;quot;&lt;br /&gt;
Save it to a file under /etc/udev/rules.d/ with the .rules extention and run:&lt;br /&gt;
 service udev reload&lt;br /&gt;
Unplug and replug the device and execute:&lt;br /&gt;
 ls -l /dev/ttyUSB*&lt;br /&gt;
You should see something like&lt;br /&gt;
 crw-rw---- 1 domoticz domoticz 188, 1 Nov 10 15:27 /dev/ttyUSB1&lt;br /&gt;
 lrwxrwxrwx 1 root     root          7 Nov 10 15:27 /dev/ttyUSB21 -&amp;gt; ttyUSB1&lt;br /&gt;
The added SYMLINK+= creates an additional link to the device node. This is a static name that is useful when you have multiple usb-serial devices that go into your box. Use the static link in Domoticz.&lt;br /&gt;
For more information on udev rules have a look here: http://www.reactivated.net/writing_udev_rules.html&lt;br /&gt;
&lt;br /&gt;
==Starting Domoticz automatically when the system boots==&lt;br /&gt;
There are basically two ways to do this - via init.d (which starts things serially) or via systemd (which starts things up in parallel and therefore leads to faster booting). On modern systems the systemd method is generally preferred.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The &amp;quot;pre-built&amp;quot; install method already creates a service that starts Domoticz after reboot or restart of your system.&lt;br /&gt;
===Option 1: Init.d Method (not preferred)===&lt;br /&gt;
To let Domoticz start automatically when the system boots &#039;&#039;(which is probably the case, as most people run it on a headless server)&#039;&#039;, run the commands below, (You want to end up in &#039;&#039;/home/YOURUSERNAME/domoticz/&#039;&#039;)&amp;lt;br&amp;gt;&lt;br /&gt;
 cd domoticz&lt;br /&gt;
 sudo cp domoticz.sh /etc/init.d&lt;br /&gt;
 sudo chmod +x /etc/init.d/domoticz.sh&lt;br /&gt;
 sudo update-rc.d domoticz.sh defaults&lt;br /&gt;
&lt;br /&gt;
Edit the startup script. &lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/init.d/domoticz.sh&lt;br /&gt;
&lt;br /&gt;
The lines you usually need to change are USERNAME, DAEMON and DAEMON_ARGS&lt;br /&gt;
&lt;br /&gt;
 USERNAME=yourusername&lt;br /&gt;
 DAEMON=/home/$USERNAME/domoticz/$NAME&lt;br /&gt;
 DAEMON_ARGS=&amp;quot;-daemon -www 8080&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*Change the USERNAME variable to the user you want domoticz to be run as. It&#039;s recommended to run domoticz as its own user and not as root, due to security reasons.&lt;br /&gt;
*If you installed Domoticz in the USERNAME home directory &amp;lt;code&amp;gt;/home/yourusername/domoticz&amp;lt;/code&amp;gt; you don&#039;t need to change the DAEMON variable. If you installed it in an alternate location for example &amp;lt;code&amp;gt;/usr/local/domoticz/&amp;lt;/code&amp;gt; you should change DAEMON to &amp;lt;code&amp;gt;/usr/local/domoticz/$NAME&amp;lt;/code&amp;gt;&lt;br /&gt;
*If you want to use another web interface port change the &#039;8080&#039; in: &amp;lt;code&amp;gt;DAEMON_ARGS=&amp;quot;-daemon www 8080&amp;quot;&amp;lt;/code&amp;gt; to your own port.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: To be able to use ports below 1024, for example the standard port for webbrowsing, 80, you need to run domoticz as the root user.&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to see more arguments for DAEMON_ARGS run this in the domoticz directory (or check page [[Command line parameters]]). This is usually not needed.&lt;br /&gt;
 ./domoticz -h&lt;br /&gt;
&lt;br /&gt;
Domoticz will now start automatically when you reboot your machine.&lt;br /&gt;
&lt;br /&gt;
====Manually controlling the Domoticz service====&lt;br /&gt;
&lt;br /&gt;
This only works if you followed the above steps.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now start/stop/restart and check the status of domoticz with:&amp;lt;br&amp;gt;&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh start&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh stop&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh restart&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh status&lt;br /&gt;
&lt;br /&gt;
If your system supports it you can instead use:&amp;lt;br&amp;gt;&lt;br /&gt;
 sudo service domoticz.sh start&lt;br /&gt;
 sudo service domoticz.sh stop&lt;br /&gt;
 sudo service domoticz.sh restart&lt;br /&gt;
 sudo service domoticz.sh status&lt;br /&gt;
&lt;br /&gt;
===Option 2: Systemd Alternative (Preferred)===&lt;br /&gt;
Open the systemd configuration file, here you can change the port number you wish to use.  To use a port below 1024 you can run as root (not reccomended) or you can un-comment one of the marked lines in the file - you should only un-comment one of the lines depending on your Ubuntu version&amp;lt;span&amp;gt; &amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/systemd/system/domoticz.service&lt;br /&gt;
&lt;br /&gt;
 [Unit]&lt;br /&gt;
        Description=domoticz_service&lt;br /&gt;
 [Service]&lt;br /&gt;
        User=domoticz&lt;br /&gt;
        Group=domoticz&lt;br /&gt;
        EnvironmentFile=/home/pi/domoticz.env&lt;br /&gt;
        ExecStart=/home/domoticz/domoticz/domoticz -www 8080 -sslwww 443&lt;br /&gt;
        WorkingDirectory=/home/domoticz&lt;br /&gt;
        #        &lt;br /&gt;
        # Give the right to open priviliged ports. This allows you to run on a port &amp;lt;1024 without root permissions (user/group setting above)&lt;br /&gt;
        #&lt;br /&gt;
        # The following line is for pre-16.04 systems.&lt;br /&gt;
        # ExecStartPre=setcap &#039;cap_net_bind_service=+ep&#039; /home/domoticz/domoticz/domoticz&lt;br /&gt;
        #&lt;br /&gt;
        # The below works on Ubuntu 16.04 LTS&lt;br /&gt;
        # CapabilityBoundingSet=CAP_NET_BIND_SERVICE&lt;br /&gt;
        #&lt;br /&gt;
        # The following works on Ubuntu 18.04&lt;br /&gt;
        # AmbientCapabilities=CAP_NET_BIND_SERVICE&lt;br /&gt;
        #&lt;br /&gt;
        Restart=on-failure&lt;br /&gt;
        RestartSec=1m&lt;br /&gt;
        #StandardOutput=null&lt;br /&gt;
 [Install]&lt;br /&gt;
        WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
or on Raspberry Pi Stretch as root (remove &#039;#&#039; on User and Group lines to run as &#039;Pi&#039; user):&lt;br /&gt;
 [Unit]&lt;br /&gt;
       Description=domoticz_service&lt;br /&gt;
 [Service]&lt;br /&gt;
       #User=pi&lt;br /&gt;
       #Group=users&lt;br /&gt;
       ExecStart=/home/pi/domoticz/domoticz -www 8080 -sslwww 443&lt;br /&gt;
       EnvironmentFile=/home/pi/domoticz.env&lt;br /&gt;
       WorkingDirectory=/home/pi/domoticz&lt;br /&gt;
       ExecStartPre=setcap &#039;cap_net_bind_service=+ep&#039; /home/pi/domoticz/domoticz&lt;br /&gt;
       Restart=on-failure&lt;br /&gt;
       RestartSec=1m&lt;br /&gt;
       #StandardOutput=null&lt;br /&gt;
 [Install]&lt;br /&gt;
       WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
on Raspbian Linux 10 (buster), I had to add this just before  ExecStartPre=setcap  now it works. I don&#039;t know about security implications!! &amp;lt;br&amp;gt;&lt;br /&gt;
The service file must add the directive &amp;quot;PermissionsStartOnly=true&amp;quot;, in order to be able to execute the &amp;quot;ExecStartPre=/sbin/setcap &#039;cap_net_bind_service=+ep&#039; ...&amp;quot; one! &amp;lt;br&amp;gt;For extra command line parameters in line ExecStart= check page [[Command line parameters]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to set some specific environment variable for the execution of the domoticz daemon, you can use the filename specified in the EnvironmentFile clause to do so.&lt;br /&gt;
Here for example, we are setting the PYTHONPATH to use a local python environment .&lt;br /&gt;
&lt;br /&gt;
 vi /home/pi/domoticz.env&lt;br /&gt;
&lt;br /&gt;
PYTHONPATH=&amp;quot;/home/domoticz/Domoticz_Python_Environment/:$PYTHONPATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable the service====&lt;br /&gt;
 systemctl daemon-reload&lt;br /&gt;
 systemctl enable domoticz.service&lt;br /&gt;
====Start the service====&lt;br /&gt;
 systemctl start domoticz.service&lt;br /&gt;
&lt;br /&gt;
Note: Use only one of these two alternatives (init.d method or systemd method) for auto-start.&lt;br /&gt;
&lt;br /&gt;
==Updating Domoticz==&lt;br /&gt;
Once in a while, a new Domoticz version is released, and of course you want to update. &lt;br /&gt;
&lt;br /&gt;
Use the Web Interface to update Domoticz (Menu Setup-&amp;gt;Check for Updates) &lt;br /&gt;
&lt;br /&gt;
If this fails for any reason (e.g. partial download giving segmentation fault) then you should manually update by: &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#Navigate to the directory where Domoticz is installed: &amp;lt;code&amp;gt;cd domoticz&amp;lt;/code&amp;gt; (You want to end up in &#039;&#039;/home/YOURUSERNAME/domoticz/&#039;&#039;)&amp;lt;br&amp;gt;&lt;br /&gt;
#Update to the latest Beta with: &amp;lt;code&amp;gt;sudo ./updatebeta&amp;lt;/code&amp;gt;&lt;br /&gt;
#Update to the latest Release with: &amp;lt;code&amp;gt;sudo ./updaterelease&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If all went correctly, Domoticz should be updated to the latest version and should be running again automatically.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Revert to backup after incorrect update===&lt;br /&gt;
For updates (beta and stable) an automatic backup of the complete domoticz environment including scripts and plugins is created in &amp;lt;code&amp;gt;domoticz/backups/domoticz_backup_yyyymmdd_hhmmss.tar.gz&amp;lt;/code&amp;gt; by the update script.&lt;br /&gt;
&lt;br /&gt;
To extract that backup:&lt;br /&gt;
&lt;br /&gt;
*enter domoticz backup directory (where domoticz store a backup before upgrading)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd ~&amp;lt;USER&amp;gt;/domoticz/backups&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*run tar command to extract the backup (specify the right filename and correct domoticz folder)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;tar xvzf domoticz_backup_yyyymmdd_hhmms.tar.gz -C /home/&amp;lt;USER&amp;gt;/domoticz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*restart domoticz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;service domoticz restart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Attention:&#039;&#039;&#039; when you use [https://mmonit.com/monit/ Monit], be sure to disable it before doing the update process, otherwise after you have stopped Domoticz by hand yourself, it will get restarted automatically by Monit within a few minutes (because that is what is Monit should do normally).&amp;lt;br&amp;gt;&lt;br /&gt;
Stopping Monit can be done by &amp;lt;code&amp;gt;sudo /etc/init.d/monit stop&amp;lt;/code&amp;gt; and after updating it can be started again with &amp;lt;code&amp;gt;sudo /etc/init.d/monit start&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
You could also use this command: &amp;lt;code&amp;gt;make &amp;amp;&amp;amp; sudo /etc/init.d/domoticz.sh start &amp;amp;&amp;amp; sudo /etc/init.d/monit start&amp;lt;/code&amp;gt; to update, start Domoticz &amp;amp; start Monit when updating is done.&lt;br /&gt;
===Script to update almost automatically===&lt;br /&gt;
For updating almost automatically, i made this script&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#! /bin/sh&lt;br /&gt;
cd /home/YOURUSERNAME/domoticz/ \&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/monit stop \&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/domoticz.sh stop \&lt;br /&gt;
&amp;amp;&amp;amp; git pull \&lt;br /&gt;
&amp;amp;&amp;amp; make \&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/domoticz.sh start\&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/monit start &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Save it as &#039;&#039;domoupdater.sh&#039;&#039;, give it executable rights (&amp;lt;code&amp;gt;chmod +x domoupdater.sh&amp;lt;/code&amp;gt;) and call it by &amp;lt;code&amp;gt;sh /home/YOURUSERNAME/domoupdater.sh&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It will change the current path to the Domoticz folder, stop Monit, stop Domoticz, pull binaries, compile, start Domoticz, start Monit again.&amp;lt;br&amp;gt;&lt;br /&gt;
Very handy to run &amp;amp; go do something else.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In theory it can work automatically (weekly cronjob for example), however when running as a non-root user (which is the case in my situation), it will ask for the password of the user. But after you have provided the password (almost immediately after the script has started), it will continue without needing any further user input.&amp;lt;br&amp;gt;&lt;br /&gt;
In theory it is possible to let it run fully automated, but i myself prefer a bit of feedback (watching afterwards if all went well). If you want to work around this sudo password asking, look [http://superuser.com/a/67766 here].&lt;br /&gt;
&lt;br /&gt;
when compiling the main Domoticz binary. For more information read this thread on the forum: [https://www.domoticz.com/forum/viewtopic.php?f=28&amp;amp;t=12625#p90568 Link]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
==Problems locating Python==&lt;br /&gt;
Some users, particularly those on old operating systems see the following message when starting Domoticz:&lt;br /&gt;
&lt;br /&gt;
  2016-12-20 09:44:32.251 Failed dynamic library load, install the latest libpython3.x library that is available for your platform. &lt;br /&gt;
&lt;br /&gt;
this shows that, even though python3 may be on the system, the python library can not be located.  This error will not stop Domoticz from starting but will mean that hardware supported by the Python Plugin Framework will not be available. To fix this, install the newest version of libpython3 for the platform. For example, RaspberryPi Jessie has python 3.4 on it but the library is not included.  Executing:&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install libpython3.4&lt;br /&gt;
&lt;br /&gt;
should solve the issue.  Note that python 3.4 is the earliest support version of python, where available later versions should always be used.&amp;lt;br&amp;gt;&lt;br /&gt;
If you are building from source and python 3 is installed but Make is not able to progress, try to add &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
  set(Python_ADDITIONAL_VERSIONS 3.4)&lt;br /&gt;
just before &#039;&#039;find_package(PythonLibs 3.4)&#039;&#039; in the CMakeLists.txt&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your platform does not have a compatible version, for example RaspberryPi Wheezy, then one can be built from source using:&lt;br /&gt;
  wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz&lt;br /&gt;
  tar -xvf Python-3.5.2.tar.xz&lt;br /&gt;
  cd Python-3.5.2&lt;br /&gt;
  ./configure --enable-shared&lt;br /&gt;
  make&lt;br /&gt;
  sudo make install&lt;br /&gt;
Don&#039;t miss the enabled-shared flag otherwise libpython will not be built.&lt;br /&gt;
&lt;br /&gt;
Note: Only peform this step if you are building from source and are having issues, it should not be required.&amp;lt;br&amp;gt;&lt;br /&gt;
After building Python 3.5.x change CMakeLists.txt&lt;br /&gt;
  option(USE_PYTHON_PLUGINS &amp;quot;Use Python Plugins&amp;quot; YES)&lt;br /&gt;
  IF(USE_PYTHON_PLUGINS)&lt;br /&gt;
    set(Python_ADDITIONAL_VERSIONS 3.5)      &amp;lt;---- add this line&lt;br /&gt;
    find_package(PythonLibs 3.5)   &amp;lt;---- change version into 3.5&lt;br /&gt;
    IF(PYTHONLIBS_FOUND)&lt;br /&gt;
&lt;br /&gt;
==Monitoring Domoticz==&lt;br /&gt;
Software crashes, it&#039;s a fact of life. Luckily there are a number of ways to keep an eye on Domoticz, and automaticallty restart it if it crashes. The following page gives instructions [[Monitoring domoticz]]&lt;br /&gt;
&lt;br /&gt;
==Add support for Tellstick==&lt;br /&gt;
If you need support for Tellstick or Tellstic Duo you need to install telldus-core before compiling Domoticz. On Debian-based systems (For example Ubuntu and Raspbian) telldus-core can be installed by doing the following:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;deb &amp;lt;nowiki&amp;gt;http://download.telldus.com/debian/&amp;lt;/nowiki&amp;gt; stable main&amp;quot; | sudo tee /etc/apt/sources.list.d/telldus.list&lt;br /&gt;
 wget -q &amp;lt;nowiki&amp;gt;http://download.telldus.se/debian/telldus-public.key&amp;lt;/nowiki&amp;gt; -O- | sudo apt-key add -&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install libtelldus-core-dev&lt;br /&gt;
   &lt;br /&gt;
==How to set up a virtual machine to run Domoticz==&lt;br /&gt;
&lt;br /&gt;
[[How to set up a virtual machine to run Domoticz]]&lt;br /&gt;
&lt;br /&gt;
   [[Category:Domoticz]]  &lt;br /&gt;
   &lt;br /&gt;
   [[Category:Manual]]  &lt;br /&gt;
   &lt;br /&gt;
   [[Category:Install]]  &lt;br /&gt;
   &lt;br /&gt;
   [[Category:Linux]]&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
[[Category:Python]]&lt;/div&gt;</summary>
		<author><name>Pipiche dz</name></author>
	</entry>
	<entry>
		<id>https://wiki.domoticz.com/index.php?title=Linux&amp;diff=18750</id>
		<title>Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/index.php?title=Linux&amp;diff=18750"/>
		<updated>2024-12-19T14:11:41Z</updated>

		<summary type="html">&lt;p&gt;Pipiche dz: Adding EnvironmentFile&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes how to compile/build the latest beta snapshot of Domoticz for Debian-based Linux operating systems. &lt;br /&gt;
&lt;br /&gt;
There&#039;s no need for all this if you&#039;re just installing a pre-built binary (see the [https://www.domoticz.com/downloads/ downloads page] for that).  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Use pre-built installation==&lt;br /&gt;
If no source code changes or special compile actions/environments are needed just install a pre-built binary (see the [https://www.domoticz.com/downloads/ downloads page] for that). Minimum supported Ubuntu version for pre-built: 20.04 LTS&lt;br /&gt;
&lt;br /&gt;
Ubuntu installation in terminal:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;sudo bash -c &amp;quot;$(curl -sSfL &amp;lt;nowiki&amp;gt;https://install.domoticz.com&amp;lt;/nowiki&amp;gt;)&amp;quot;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You will get an install dialog and some questions will be asked about  HTTP/HTTPS enablement for WebUI and related ports.&lt;br /&gt;
&lt;br /&gt;
[[File:Domoticz install1.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Domoticz install finished.png]]&lt;br /&gt;
&lt;br /&gt;
Just point your browser to the IP address of your Linux system, and use the port specified during the installation script.&amp;lt;br&amp;gt;&lt;br /&gt;
For example: &amp;lt;code&amp;gt;http://192.168.0.10:8080&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&#039;&#039;&#039;From 2023.1 Stable:&#039;&#039;&#039; By default Domoticz is protected by a username (&#039;&#039;admin&#039;&#039;) and password (&#039;&#039;domoticz&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
Now you can go on and visit the [[Getting started]] documentation area for more information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Use Docker container==&lt;br /&gt;
You can also install Domoticz as a Docker container. Go to wiki page [[Docker]] for the instructions&lt;br /&gt;
==Compiling the source code==&lt;br /&gt;
If you made source code changes or your environment is not compatible with the [https://www.domoticz.com/downloads/ pre-built images] you can compile and install Domoticz yourself.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Follow the steps provided here&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
[[Build Domoticz from source|Build_Domoticz_from_source]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==Allow non-root user to access ttyUSB* ports==&lt;br /&gt;
&lt;br /&gt;
If&amp;lt;nowiki/&amp;gt; you don&#039;t plan on interfacing Domoticz with USB and/or serial devices, you can skip this step.&lt;br /&gt;
&lt;br /&gt;
By default (at least on Ubuntu) a non-root user has no permission to access the ttyUSB* ports. So if you have Domoticz running under a separate user &#039;&#039;(which is always a good idea to make the system more secure)&#039;&#039;, Domoticz isn&#039;t allowed access to your RFXCOM for example. Here are two methods of doing it. For most people the first one by adding the user to the dialout goup is enough and by far the easiest. &lt;br /&gt;
&lt;br /&gt;
===Adding the user to the dialout group===&lt;br /&gt;
This can be done by running the command below:&lt;br /&gt;
 sudo usermod -a -G dialout YOURUSERNAME&lt;br /&gt;
&#039;&#039;(Where you replace YOURUSERNAME with the user that runs Domoticz.)&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Setting up a udev rule===&lt;br /&gt;
Alternatively you can setup (as root) a udev rule that matches the RFXCOM device. To find which attributes match your device use the command:&lt;br /&gt;
 udevadm info -a -p $(udevadm info -q path /dev/ttyUSB1) | less&lt;br /&gt;
Where /dev/ttyUSB1 is the device.&lt;br /&gt;
If you wish to run Domoticz under the YOURUSERNAME credentials, who is member of the YOURGROUPNAME group and your device has serial YOURSERIAL a suitable udev rule would be:&lt;br /&gt;
 SUBSYSTEM==&amp;quot;tty&amp;quot;, SUBSYSTEMS==&amp;quot;usb&amp;quot;, ATTRS{idVendor}==&amp;quot;0403&amp;quot;, ATTRS{serial}==&amp;quot;YOURSERIAL&amp;quot;, ATTRS{idProduct}==&amp;quot;6001&amp;quot;, SYMLINK+=&amp;quot;ttyUSB21&amp;quot;, OWNER=&amp;quot;YOURUSERNAME&amp;quot;, GROUP=&amp;quot;YOURGROUPNAME&amp;quot;&lt;br /&gt;
Save it to a file under /etc/udev/rules.d/ with the .rules extention and run:&lt;br /&gt;
 service udev reload&lt;br /&gt;
Unplug and replug the device and execute:&lt;br /&gt;
 ls -l /dev/ttyUSB*&lt;br /&gt;
You should see something like&lt;br /&gt;
 crw-rw---- 1 domoticz domoticz 188, 1 Nov 10 15:27 /dev/ttyUSB1&lt;br /&gt;
 lrwxrwxrwx 1 root     root          7 Nov 10 15:27 /dev/ttyUSB21 -&amp;gt; ttyUSB1&lt;br /&gt;
The added SYMLINK+= creates an additional link to the device node. This is a static name that is useful when you have multiple usb-serial devices that go into your box. Use the static link in Domoticz.&lt;br /&gt;
For more information on udev rules have a look here: http://www.reactivated.net/writing_udev_rules.html&lt;br /&gt;
&lt;br /&gt;
==Starting Domoticz automatically when the system boots==&lt;br /&gt;
There are basically two ways to do this - via init.d (which starts things serially) or via systemd (which starts things up in parallel and therefore leads to faster booting). On modern systems the systemd method is generally preferred.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The &amp;quot;pre-built&amp;quot; install method already creates a service that starts Domoticz after reboot or restart of your system.&lt;br /&gt;
===Option 1: Init.d Method (not preferred)===&lt;br /&gt;
To let Domoticz start automatically when the system boots &#039;&#039;(which is probably the case, as most people run it on a headless server)&#039;&#039;, run the commands below, (You want to end up in &#039;&#039;/home/YOURUSERNAME/domoticz/&#039;&#039;)&amp;lt;br&amp;gt;&lt;br /&gt;
 cd domoticz&lt;br /&gt;
 sudo cp domoticz.sh /etc/init.d&lt;br /&gt;
 sudo chmod +x /etc/init.d/domoticz.sh&lt;br /&gt;
 sudo update-rc.d domoticz.sh defaults&lt;br /&gt;
&lt;br /&gt;
Edit the startup script. &lt;br /&gt;
&lt;br /&gt;
 sudo nano /etc/init.d/domoticz.sh&lt;br /&gt;
&lt;br /&gt;
The lines you usually need to change are USERNAME, DAEMON and DAEMON_ARGS&lt;br /&gt;
&lt;br /&gt;
 USERNAME=yourusername&lt;br /&gt;
 DAEMON=/home/$USERNAME/domoticz/$NAME&lt;br /&gt;
 DAEMON_ARGS=&amp;quot;-daemon -www 8080&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*Change the USERNAME variable to the user you want domoticz to be run as. It&#039;s recommended to run domoticz as its own user and not as root, due to security reasons.&lt;br /&gt;
*If you installed Domoticz in the USERNAME home directory &amp;lt;code&amp;gt;/home/yourusername/domoticz&amp;lt;/code&amp;gt; you don&#039;t need to change the DAEMON variable. If you installed it in an alternate location for example &amp;lt;code&amp;gt;/usr/local/domoticz/&amp;lt;/code&amp;gt; you should change DAEMON to &amp;lt;code&amp;gt;/usr/local/domoticz/$NAME&amp;lt;/code&amp;gt;&lt;br /&gt;
*If you want to use another web interface port change the &#039;8080&#039; in: &amp;lt;code&amp;gt;DAEMON_ARGS=&amp;quot;-daemon www 8080&amp;quot;&amp;lt;/code&amp;gt; to your own port.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: To be able to use ports below 1024, for example the standard port for webbrowsing, 80, you need to run domoticz as the root user.&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to see more arguments for DAEMON_ARGS run this in the domoticz directory (or check page [[Command line parameters]]). This is usually not needed.&lt;br /&gt;
 ./domoticz -h&lt;br /&gt;
&lt;br /&gt;
Domoticz will now start automatically when you reboot your machine.&lt;br /&gt;
&lt;br /&gt;
====Manually controlling the Domoticz service====&lt;br /&gt;
&lt;br /&gt;
This only works if you followed the above steps.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can now start/stop/restart and check the status of domoticz with:&amp;lt;br&amp;gt;&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh start&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh stop&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh restart&lt;br /&gt;
 sudo /etc/init.d/domoticz.sh status&lt;br /&gt;
&lt;br /&gt;
If your system supports it you can instead use:&amp;lt;br&amp;gt;&lt;br /&gt;
 sudo service domoticz.sh start&lt;br /&gt;
 sudo service domoticz.sh stop&lt;br /&gt;
 sudo service domoticz.sh restart&lt;br /&gt;
 sudo service domoticz.sh status&lt;br /&gt;
&lt;br /&gt;
===Option 2: Systemd Alternative (Preferred)===&lt;br /&gt;
Open the systemd configuration file, here you can change the port number you wish to use.  To use a port below 1024 you can run as root (not reccomended) or you can un-comment one of the marked lines in the file - you should only un-comment one of the lines depending on your Ubuntu version&amp;lt;span&amp;gt; &amp;lt;/span&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 vi /etc/systemd/system/domoticz.service&lt;br /&gt;
&lt;br /&gt;
 [Unit]&lt;br /&gt;
        Description=domoticz_service&lt;br /&gt;
 [Service]&lt;br /&gt;
        User=domoticz&lt;br /&gt;
        Group=domoticz&lt;br /&gt;
        ExecStart=/home/domoticz/domoticz/domoticz -www 8080 -sslwww 443&lt;br /&gt;
        WorkingDirectory=/home/domoticz&lt;br /&gt;
        #        &lt;br /&gt;
        # Give the right to open priviliged ports. This allows you to run on a port &amp;lt;1024 without root permissions (user/group setting above)&lt;br /&gt;
        #&lt;br /&gt;
        # The following line is for pre-16.04 systems.&lt;br /&gt;
        # ExecStartPre=setcap &#039;cap_net_bind_service=+ep&#039; /home/domoticz/domoticz/domoticz&lt;br /&gt;
        #&lt;br /&gt;
        # The below works on Ubuntu 16.04 LTS&lt;br /&gt;
        # CapabilityBoundingSet=CAP_NET_BIND_SERVICE&lt;br /&gt;
        #&lt;br /&gt;
        # The following works on Ubuntu 18.04&lt;br /&gt;
        # AmbientCapabilities=CAP_NET_BIND_SERVICE&lt;br /&gt;
        #&lt;br /&gt;
        Restart=on-failure&lt;br /&gt;
        RestartSec=1m&lt;br /&gt;
        #StandardOutput=null&lt;br /&gt;
 [Install]&lt;br /&gt;
        WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
or on Raspberry Pi Stretch as root (remove &#039;#&#039; on User and Group lines to run as &#039;Pi&#039; user):&lt;br /&gt;
 [Unit]&lt;br /&gt;
       Description=domoticz_service&lt;br /&gt;
 [Service]&lt;br /&gt;
       #User=pi&lt;br /&gt;
       #Group=users&lt;br /&gt;
       ExecStart=/home/pi/domoticz/domoticz -www 8080 -sslwww 443&lt;br /&gt;
       EnvironmentFile=/home/pi/domoticz.env&lt;br /&gt;
       WorkingDirectory=/home/pi/domoticz&lt;br /&gt;
       ExecStartPre=setcap &#039;cap_net_bind_service=+ep&#039; /home/pi/domoticz/domoticz&lt;br /&gt;
       Restart=on-failure&lt;br /&gt;
       RestartSec=1m&lt;br /&gt;
       #StandardOutput=null&lt;br /&gt;
 [Install]&lt;br /&gt;
       WantedBy=multi-user.target&lt;br /&gt;
on Raspbian Linux 10 (buster), I had to add this just before  ExecStartPre=setcap  now it works. I don&#039;t know about security implications!! &amp;lt;br&amp;gt;&lt;br /&gt;
The service file must add the directive &amp;quot;PermissionsStartOnly=true&amp;quot;, in order to be able to execute the &amp;quot;ExecStartPre=/sbin/setcap &#039;cap_net_bind_service=+ep&#039; ...&amp;quot; one! &amp;lt;br&amp;gt;For extra command line parameters in line ExecStart= check page [[Command line parameters]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to set some specific environment variable for the execution of the domoticz daemon, you can use the filename specified in the EnvironmentFile clause to do so.&lt;br /&gt;
Here for example, we are setting the PYTHONPATH to use a local python environment .&lt;br /&gt;
&lt;br /&gt;
 vi /home/pi/domoticz.env&lt;br /&gt;
&lt;br /&gt;
PYTHONPATH=&amp;quot;/home/domoticz/Domoticz_Python_Environment/:$PYTHONPATH&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable the service====&lt;br /&gt;
 systemctl daemon-reload&lt;br /&gt;
 systemctl enable domoticz.service&lt;br /&gt;
====Start the service====&lt;br /&gt;
 systemctl start domoticz.service&lt;br /&gt;
&lt;br /&gt;
Note: Use only one of these two alternatives (init.d method or systemd method) for auto-start.&lt;br /&gt;
&lt;br /&gt;
==Updating Domoticz==&lt;br /&gt;
Once in a while, a new Domoticz version is released, and of course you want to update. &lt;br /&gt;
&lt;br /&gt;
Use the Web Interface to update Domoticz (Menu Setup-&amp;gt;Check for Updates) &lt;br /&gt;
&lt;br /&gt;
If this fails for any reason (e.g. partial download giving segmentation fault) then you should manually update by: &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#Navigate to the directory where Domoticz is installed: &amp;lt;code&amp;gt;cd domoticz&amp;lt;/code&amp;gt; (You want to end up in &#039;&#039;/home/YOURUSERNAME/domoticz/&#039;&#039;)&amp;lt;br&amp;gt;&lt;br /&gt;
#Update to the latest Beta with: &amp;lt;code&amp;gt;sudo ./updatebeta&amp;lt;/code&amp;gt;&lt;br /&gt;
#Update to the latest Release with: &amp;lt;code&amp;gt;sudo ./updaterelease&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If all went correctly, Domoticz should be updated to the latest version and should be running again automatically.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Revert to backup after incorrect update===&lt;br /&gt;
For updates (beta and stable) an automatic backup of the complete domoticz environment including scripts and plugins is created in &amp;lt;code&amp;gt;domoticz/backups/domoticz_backup_yyyymmdd_hhmmss.tar.gz&amp;lt;/code&amp;gt; by the update script.&lt;br /&gt;
&lt;br /&gt;
To extract that backup:&lt;br /&gt;
&lt;br /&gt;
*enter domoticz backup directory (where domoticz store a backup before upgrading)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;cd ~&amp;lt;USER&amp;gt;/domoticz/backups&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*run tar command to extract the backup (specify the right filename and correct domoticz folder)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;tar xvzf domoticz_backup_yyyymmdd_hhmms.tar.gz -C /home/&amp;lt;USER&amp;gt;/domoticz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*restart domoticz&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;service domoticz restart&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Attention:&#039;&#039;&#039; when you use [https://mmonit.com/monit/ Monit], be sure to disable it before doing the update process, otherwise after you have stopped Domoticz by hand yourself, it will get restarted automatically by Monit within a few minutes (because that is what is Monit should do normally).&amp;lt;br&amp;gt;&lt;br /&gt;
Stopping Monit can be done by &amp;lt;code&amp;gt;sudo /etc/init.d/monit stop&amp;lt;/code&amp;gt; and after updating it can be started again with &amp;lt;code&amp;gt;sudo /etc/init.d/monit start&amp;lt;/code&amp;gt;.&amp;lt;br&amp;gt;&lt;br /&gt;
You could also use this command: &amp;lt;code&amp;gt;make &amp;amp;&amp;amp; sudo /etc/init.d/domoticz.sh start &amp;amp;&amp;amp; sudo /etc/init.d/monit start&amp;lt;/code&amp;gt; to update, start Domoticz &amp;amp; start Monit when updating is done.&lt;br /&gt;
===Script to update almost automatically===&lt;br /&gt;
For updating almost automatically, i made this script&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#! /bin/sh&lt;br /&gt;
cd /home/YOURUSERNAME/domoticz/ \&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/monit stop \&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/domoticz.sh stop \&lt;br /&gt;
&amp;amp;&amp;amp; git pull \&lt;br /&gt;
&amp;amp;&amp;amp; make \&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/domoticz.sh start\&lt;br /&gt;
&amp;amp;&amp;amp; sudo /etc/init.d/monit start &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Save it as &#039;&#039;domoupdater.sh&#039;&#039;, give it executable rights (&amp;lt;code&amp;gt;chmod +x domoupdater.sh&amp;lt;/code&amp;gt;) and call it by &amp;lt;code&amp;gt;sh /home/YOURUSERNAME/domoupdater.sh&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
It will change the current path to the Domoticz folder, stop Monit, stop Domoticz, pull binaries, compile, start Domoticz, start Monit again.&amp;lt;br&amp;gt;&lt;br /&gt;
Very handy to run &amp;amp; go do something else.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
In theory it can work automatically (weekly cronjob for example), however when running as a non-root user (which is the case in my situation), it will ask for the password of the user. But after you have provided the password (almost immediately after the script has started), it will continue without needing any further user input.&amp;lt;br&amp;gt;&lt;br /&gt;
In theory it is possible to let it run fully automated, but i myself prefer a bit of feedback (watching afterwards if all went well). If you want to work around this sudo password asking, look [http://superuser.com/a/67766 here].&lt;br /&gt;
&lt;br /&gt;
when compiling the main Domoticz binary. For more information read this thread on the forum: [https://www.domoticz.com/forum/viewtopic.php?f=28&amp;amp;t=12625#p90568 Link]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
==Problems locating Python==&lt;br /&gt;
Some users, particularly those on old operating systems see the following message when starting Domoticz:&lt;br /&gt;
&lt;br /&gt;
  2016-12-20 09:44:32.251 Failed dynamic library load, install the latest libpython3.x library that is available for your platform. &lt;br /&gt;
&lt;br /&gt;
this shows that, even though python3 may be on the system, the python library can not be located.  This error will not stop Domoticz from starting but will mean that hardware supported by the Python Plugin Framework will not be available. To fix this, install the newest version of libpython3 for the platform. For example, RaspberryPi Jessie has python 3.4 on it but the library is not included.  Executing:&lt;br /&gt;
&lt;br /&gt;
  sudo apt-get install libpython3.4&lt;br /&gt;
&lt;br /&gt;
should solve the issue.  Note that python 3.4 is the earliest support version of python, where available later versions should always be used.&amp;lt;br&amp;gt;&lt;br /&gt;
If you are building from source and python 3 is installed but Make is not able to progress, try to add &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
  set(Python_ADDITIONAL_VERSIONS 3.4)&lt;br /&gt;
just before &#039;&#039;find_package(PythonLibs 3.4)&#039;&#039; in the CMakeLists.txt&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If your platform does not have a compatible version, for example RaspberryPi Wheezy, then one can be built from source using:&lt;br /&gt;
  wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz&lt;br /&gt;
  tar -xvf Python-3.5.2.tar.xz&lt;br /&gt;
  cd Python-3.5.2&lt;br /&gt;
  ./configure --enable-shared&lt;br /&gt;
  make&lt;br /&gt;
  sudo make install&lt;br /&gt;
Don&#039;t miss the enabled-shared flag otherwise libpython will not be built.&lt;br /&gt;
&lt;br /&gt;
Note: Only peform this step if you are building from source and are having issues, it should not be required.&amp;lt;br&amp;gt;&lt;br /&gt;
After building Python 3.5.x change CMakeLists.txt&lt;br /&gt;
  option(USE_PYTHON_PLUGINS &amp;quot;Use Python Plugins&amp;quot; YES)&lt;br /&gt;
  IF(USE_PYTHON_PLUGINS)&lt;br /&gt;
    set(Python_ADDITIONAL_VERSIONS 3.5)      &amp;lt;---- add this line&lt;br /&gt;
    find_package(PythonLibs 3.5)   &amp;lt;---- change version into 3.5&lt;br /&gt;
    IF(PYTHONLIBS_FOUND)&lt;br /&gt;
&lt;br /&gt;
==Monitoring Domoticz==&lt;br /&gt;
Software crashes, it&#039;s a fact of life. Luckily there are a number of ways to keep an eye on Domoticz, and automaticallty restart it if it crashes. The following page gives instructions [[Monitoring domoticz]]&lt;br /&gt;
&lt;br /&gt;
==Add support for Tellstick==&lt;br /&gt;
If you need support for Tellstick or Tellstic Duo you need to install telldus-core before compiling Domoticz. On Debian-based systems (For example Ubuntu and Raspbian) telldus-core can be installed by doing the following:&lt;br /&gt;
&lt;br /&gt;
 echo &amp;quot;deb &amp;lt;nowiki&amp;gt;http://download.telldus.com/debian/&amp;lt;/nowiki&amp;gt; stable main&amp;quot; | sudo tee /etc/apt/sources.list.d/telldus.list&lt;br /&gt;
 wget -q &amp;lt;nowiki&amp;gt;http://download.telldus.se/debian/telldus-public.key&amp;lt;/nowiki&amp;gt; -O- | sudo apt-key add -&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install libtelldus-core-dev&lt;br /&gt;
   &lt;br /&gt;
==How to set up a virtual machine to run Domoticz==&lt;br /&gt;
&lt;br /&gt;
[[How to set up a virtual machine to run Domoticz]]&lt;br /&gt;
&lt;br /&gt;
   [[Category:Domoticz]]  &lt;br /&gt;
   &lt;br /&gt;
   [[Category:Manual]]  &lt;br /&gt;
   &lt;br /&gt;
   [[Category:Install]]  &lt;br /&gt;
   &lt;br /&gt;
   [[Category:Linux]]&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
[[Category:Python]]&lt;/div&gt;</summary>
		<author><name>Pipiche dz</name></author>
	</entry>
	<entry>
		<id>https://wiki.domoticz.com/index.php?title=File:DashZigbeeForDomoticz.png&amp;diff=16825</id>
		<title>File:DashZigbeeForDomoticz.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/index.php?title=File:DashZigbeeForDomoticz.png&amp;diff=16825"/>
		<updated>2022-01-17T07:59:34Z</updated>

		<summary type="html">&lt;p&gt;Pipiche dz: Pipiche dz uploaded a new version of File:DashZigbeeForDomoticz.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pipiche dz</name></author>
	</entry>
	<entry>
		<id>https://wiki.domoticz.com/index.php?title=File:Dash_z4d.png&amp;diff=16820</id>
		<title>File:Dash z4d.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/index.php?title=File:Dash_z4d.png&amp;diff=16820"/>
		<updated>2022-01-17T07:50:49Z</updated>

		<summary type="html">&lt;p&gt;Pipiche dz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pipiche dz</name></author>
	</entry>
	<entry>
		<id>https://wiki.domoticz.com/index.php?title=File:Dashboard_z4d.png&amp;diff=16819</id>
		<title>File:Dashboard z4d.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/index.php?title=File:Dashboard_z4d.png&amp;diff=16819"/>
		<updated>2022-01-17T07:49:46Z</updated>

		<summary type="html">&lt;p&gt;Pipiche dz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Pipiche dz</name></author>
	</entry>
	<entry>
		<id>https://wiki.domoticz.com/index.php?title=Zigate&amp;diff=16818</id>
		<title>Zigate</title>
		<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/index.php?title=Zigate&amp;diff=16818"/>
		<updated>2022-01-17T07:48:36Z</updated>

		<summary type="html">&lt;p&gt;Pipiche dz: Pipiche dz moved page Zigate to ZigbeeForDomoticz: Name of plugin changed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[ZigbeeForDomoticz]]&lt;/div&gt;</summary>
		<author><name>Pipiche dz</name></author>
	</entry>
	<entry>
		<id>https://wiki.domoticz.com/index.php?title=File:Dashboard.png&amp;diff=13999</id>
		<title>File:Dashboard.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.domoticz.com/index.php?title=File:Dashboard.png&amp;diff=13999"/>
		<updated>2020-04-09T08:01:27Z</updated>

		<summary type="html">&lt;p&gt;Pipiche dz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Dashboard Plugin&lt;/div&gt;</summary>
		<author><name>Pipiche dz</name></author>
	</entry>
</feed>