Install Domoticz on Centos 7

Old version below

We are going to compile domoticz on a new Centos 7 install!

  1. Install Centos7
  2. yum -y install epel-release && yum update
  3. yum -y install wget libusb.x86_64 openssl-devel perl '@Development tools' vim mlocate cmake systemd-devel libgudev1-devel libssh.x86_64 python34-devel.x86_64 python34 glibc-static libstdc++-static curl curl-devel bash-completion
  4. Go to https://www.openssl.org/source/ , we are going to compile openssl!
  5. mkdir -p /root/ssl && cd $_ && wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz && tar xzvf openssl-1.0.2l.tar.gz && cd openssl-1.0.2l && ./config && make && make install
  6. mkdir /opt/boost && cd $_ && wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz && tar xzvf boost_1_65_1.tar.gz && cd boost_1_65_1 && ./bootstrap.sh && ./b2 stage threading=multi link=static --with-thread --with-date_time --with-system --with-atomic --with-regex && ./b2 install threading=multi link=static --with-thread --with-date_time --with-system --with-atomic --with-regex
  7. cd /opt/ && git clone https://github.com/OpenZWave/open-zwave open-zwave-read-only && cd open-zwave-read-only/ && git pull && yum install systemd-devel && make -j 3 && make install
  8. cd /opt && git clone https://github.com/domoticz/domoticz.git dev-domoticz && cd dev-domoticz && cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt
  9. CONF_SWAPFILE=1024 make -j 3
  10. useradd domoticz && chown -R domoticz. /opt/dev-domoticz/
  11. echo "W1VuaXRdCiAgICAgICBEZXNjcmlwdGlvbj1kb21vdGljel9zZXJ2aWNlCltTZXJ2aWNlXQogICAgICAgVXNlcj1kb21vdGljegogICAgICAgR3JvdXA9ZG9tb3RpY3oKICAgICAgIEV4ZWNTdGFydD0vb3B0L2Rldi1kb21vdGljei9kb21vdGljeiAtd3d3IDgwODAgLXNzbHd3dyA4NDQzCiAgICAgICBXb3JraW5nRGlyZWN0b3J5PS9vcHQvZGV2LWRvbW90aWN6CiAgICAgICBDYXBhYmlsaXR5Qm91bmRpbmdTZXQ9Q0FQX05FVF9CSU5EX1NFUlZJQ0UKICAgICAgIFJlc3RhcnQ9b24tZmFpbHVyZQogICAgICAgUmVzdGFydFNlYz0xbQogICAgICAgI1N0YW5kYXJkT3V0cHV0PW51bGwKW0luc3RhbGxdCiAgICAgICBXYW50ZWRCeT1tdWx0aS11c2VyLnRhcmdldAo="| base64 -d > /etc/systemd/system/domoticz.service
  12. systemctl daemon-reload
  13. systemctl enable domoticz.service
  14. systemctl start domoticz.service
  15. configure the firewall, etc etc.

Note: This post was first trying to install domoticz from the packages, then went into compiling.

Type-as-I-do-it post:
( All installed yum in 1 command: yum update && yum install epel-release; yum install wget libusb.x86_64 openssl-devel perl ‘@Development tools’ vim mlocate cmake systemd-devel libgudev1-devel libssh.x86_64 python34-devel.x86_64 python34 glibc-static libstdc++-static)

  1. Install Centos 7
  2. yum update
  3. yum install wget
  4. mkdir /opt/domoticz
  5. cd /opt/domoticz
  6. wget https://releases.domoticz.com/releases/release/domoticz_linux_x86_64.tgz
  7. tar xzvf dom [tab]
  8. ./updaterelease
  9. yum install libusb.x86_64
  10. yum install -y openssl-devel
  11. Go to https://www.openssl.org/source/
  12. mkdir -p /root/ssl; cd $_; wget https://www.openssl.org/source/openssl-1.0.2l.tar.gz
  13. tar xzvf openssl-1.0.2l.tar.gz
  14. cd openssl-1.0.2l
  15. yum install perl
  16. ./config
  17. yum install ‘@Development tools’
  18. make
  19. make install
  20. cd /opt/domoticz
  21. cd /usr/lib64/ && ln -s /usr/lib64/libssl.so.1.0.2k libssl.so.1.0.0
  22. cd –
  23. cd /usr/lib64/ && ln -s libcrypto.so.1.0.2k libcrypto.so.1.0.0 && cd –
  24. mkdir /opt/boost && cd $_ && wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz && tar xzvf boost_1_65_1.tar.gz && cd boost_1_65_1 && ./bootstrap.sh && ./b2 stage threading=multi link=static –with-thread –with-date_time –with-system –with-atomic –with-regex && ./b2 install threading=multi link=static –with-thread –with-date_time –with-system –with-atomic –with-regex
  25. cd /opt/ && git clone https://github.com/OpenZWave/open-zwave open-zwave-read-only && cd open-zwave-read-only/ && git pull && yum install systemd-devel && make -j 3
  26. sudo yum install epel-release
  27. yum install curl libcurl libcurl-devel python34-devel.x86_64 python34 glibc-static libstdc++-static
  28. cmake -DCMAKE_BUILD_TYPE=Release CMakeLists.txt
  29. CONF_SWAPFILE=1024
  30. make -j 3
  31. wait
  32. test it, do: ./domoticz
  33. useradd domoticz && chown -R domoticz. /opt/dev-domoticz/ && usermod -a -G dialout domoticz
  34. vi /etc/systemd/system/domoticz.service

[Unit]
Description=domoticz_service
[Service]
User=domoticz
Group=domoticz
ExecStart=/opt/dev-domoticz/domoticz -www 8080 -sslwww 8443
WorkingDirectory=/opt/dev-domoticz
# Give the right to open priviliged ports. This allows you to run on a port <1024 without root permissions (user/group setting above) # # The next line was previously working, so try this on older systems. # ExecStartPre=setcap 'cap_net_bind_service=+ep' /home/domoticz/domoticz/domoticz # # The below works on ubuntu 16 LTS. CapabilityBoundingSet=CAP_NET_BIND_SERVICE Restart=on-failure RestartSec=1m #StandardOutput=null [Install] WantedBy=multi-user.target

  • systemctl start domoticz.service
  • configure the firewall, etc etc.