
Install Domoticz 2020 on Raspberry Pi OS
Step-by-step how-to guide install Domoticz on Raspberry Pi with the latest Raspberry image. With the new Raspberry Pi OS (previously know as Raspbian) this guide has been updated to reflect the latest changes.
Please do not use the Raspberry imager, is still rather buggy at the moment.
Working with Win32 Disk Imager gives better results and is proven to be a reliable way to image your Micro SD card…
This how-to is part of a bigger series of Domoticz how-to’s on sancla.com!
This tutorial has been verified with the latest Domoticz 2020.2
Prerequisites
- Raspberry Pi 4 with 2GB or 4GB of memory
– 32GB Micro SD card (16GB works just fine to!)
Class 10 from a good brand, such as Kingston, Transcend or Samsung.
Pay attention to the Read/Write speeds…
– Original or equivalent USB-C Power supply
– Active or passive cooling
Try the Flirc passive cooling case, you won’t be disappointed! - Network cable
- Micro-SD card reader
- Windows 10 installation with win32 disk imager
- Free IP address in your network
Tested with
- Raspberry Pi 4 (4GB model with 16GB sd-card)
- Raspberry Pi OS Lite 4.19 (release date 2020-05-27)
- Domoticz Stable 2020.2 (compile date Apr 27 2020)
- Windows 10 ver 1909
- Win32 Disk Imager
Step 1 – Prepare your Micro SD card
Assuming you work with Windows 10, let’s start by downloading everything we need:
- Latest Raspberry Pi OS image (Lite version):
https://downloads.raspberrypi.org/raspios_lite_armhf_latest - Win32 Disk Imager:
https://sourceforge.net/projects/win32diskimager/files/latest/download - SD Formatter
https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip - Putty standalone 32bit
https://the.earth.li/~sgtatham/putty/latest/w32/putty.exe

To be sure the SD card is in perfect shape, format the SD
card before you begin (source: raspberrypi.org):
- Download SD Formatter for Windows
- Follow the instructions and install
- Format your card with SD Formatter
Load the Raspbian image with WIn32 Disk Imager:
– Start Win32 Disk Imager (assuming your already have this application installed)
– Select the Raspbian image file (*.img, unpack the *.zip file first if you have to already done so)
– Select the drive letter of the SD card
– Click on “write” to start imaging your SD card
To enable SSH for a headless configuration you have to add a file named “ssh” to the “boot” partition/disk of the SD card. Make sure you add this file without any extension!!!

Once all these steps have bee taken, put the SD card into your Raspberry Pi, connect power and let it boot for a couple of minutes.
Step 2 – Find the IP adres of your Raspberry Pi
To be able to connect to the Raspberry Pi we need to know the IP adres that has been supplied by your router. Please be aware that we assume your connect your pi with a network cable. You can connect your pi wirelessly but this is not part of this how-to…
There are a couple of ways we can do this and the raspberrypi.org website published a great article about how to do this:
https://www.raspberrypi.org/documentation/remote-access/ip-address.md
For most home environments I believe the easiest way to do this is by installing the Find app on your phone:
Getting the IP address of a Pi using your smartphone
Source: https://www.raspberrypi.org/documentation/remote-access/ip-address.md
The Fing app is a free network scanner for smartphones. It is available for Android and iOS.
Your phone and your Raspberry Pi have to be on the same network, so connect your phone to the correct wireless network.
When you open the Fing app, touch the refresh button in the upper right-hand corner of the screen. After a few seconds you will get a list with all the devices connected to your network. Scroll down to the entry with the manufacturer “Raspberry Pi”. You will see the IP address in the bottom left-hand corner, and the MAC address in the bottom right-hand corner of the entry.
Step 3 – Connect with SSH
Once you have found the IP adres of your Raspberry Pi, connect to it with a tool called Putty. It is a standalone SSH tool and by far an industry standard application for SSH on Windows.
Start the Putty application, fill in the IP address and press Enter. You get a warning “Putty Security Alert” about the host key which you can safely ignore, continue and connect to the Raspberry Pi.
The default username and password are pi and raspberry.
Should you receive an error instead such as “Network error: Connection refused”, you probably did not correctly configure the SSH file on your SD card, most times caused by using a extension with the SSH file, such as SSH.txt for example.
Follow this YouTube video for more help on this matter:
https://www.youtube.com/watch?v=Q1jWk_nu3Ds
Step 4 – raspi-config
Once connected we start with setting up your Raspberry Pi. We can do so by connecting to the Raspberry pi with SSH/putty and running the following command:
sudo raspi-config

2 steps are important here:
– Setting the “Localisation Options”, so the time zone and date are correctly configured
– Setting a fixed IP address with “Network Options”, so we can always find back the Raspberry Pi in our network.
To do so, check the Raspberry Pi documentation, there are also plenty of YouTube video’s that can assist you with this step.
https://www.raspberrypi.org/documentation/configuration/raspi-config.md
Step 5 – Update, upgrade and reboot
To make sure we have the latest software versions, run the following command on your Raspberry Pi:
sudo apt update -y && sudo apt upgrade -y && sudo reboot
Your Raspberry pi will start updating and upgrading automatically.
Once done it will reboot your Raspberry Pi, your SSH connection terminates during reboot so you know when it’s finished. Rebooting can take a 1-2 minutes is my experience.
Step 6 – Install Domoticz
Once the Raspbian setup and preperation has been completed, it’s finally time to install Domoticz on your Raspberry Pi 4! Connect to your Raspberry with SSH/Putty if you have not already done so and execute the following command to automatically install Domoticz for you:
Source: https://www.domoticz.com/wiki/Raspberry_Pi
curl -L https://install.domoticz.com | bash

During installation you are able to configure the HTTP port, by default configured on port 8080.
You could change this to port 80, the default port for HTTP traffic. This way, you do not need to write “:8080” every time to connect to your Domoticz installation. However, should you wish to install Dashticz later on, port 80 could become conflicted.
My advise, stick to the default port 8080!
peter
Great instruction!
Some thoughts:
1. Change Preferences/Pi-configuration
Activate: ssh,vnc etc.
2. change root password: sudo passwd root
3. Remote ssh & putty
sudo nano /etc/ssh/sshd_config
add PermitRootLogin=yes
restart service ssh restart
4. Actual time
sudo apt install ntp
SANCLA
Hi Peter,
Those are some great additions, thanks!
I would like to add these steps to the guide if you are okay with that, some all can benefit.
Sancla
peter
ofcource.
Another one is
– a step for specify drivers like a sound hat (addon) for the rpi or drivers for an rtc. or settings for a screen
– did i also mention the password of user pi and user root
– or how to update the system
sudo ./updatebeta or
sudo ./updaterelease
– somtehing about backup/restore
SANCLA
Hi Peter,
Great ideas, thanks again for your feedback!
I am already working on a guide to secure Domoticz should you wish to expose Domoticz to the internet (eg port forwarding). I can include the user/root password part.
For SSH, this is included in this guide by saving the known “ssh” file to the root partition on your SD card. VNC is only usefull if you use a GUI/desktop to connect to. In this case we use a headless setup that uses less resources (Linux servers rarely need a desktop/gui to function, Windows server on the other hand can not to without a desktop/GUI).
Unfortunately I do not poses hat’s for pi’s (not yet in any case) so supporting that would be a bit difficult. But maybe it’s nice to include this in my wish list, which of course has gotten completely out of hand as usual…
Regarding backup, I already found a great solution with Duplicati.
See this post for more information:
https://sancla.com/domoticz/how-to-backup-domoticz-with-duplicati/
JPablo
Nice tutorial. it works for me. Step 6: After HTTP it also ask me HTTPS so I leave with default number 443.
Paulie1001
im unable to connect to domoticz via browser, keep getting:
This site can’t be reached192.168.1.66 refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
SANCLA
Well, there are a couple of things that come to mind:
1. Did you connect with the right port? Like http://192.168.1.66:8080
2. Is the Domoticz service up and running?
3. Did the rest of the installation steps go OK like the guide?
Paulie1001
The port is correct. But when i type: sudo service domoticz status
“● domoticz.service – LSB: Home Automation System
Loaded: loaded (/etc/init.d/domoticz.sh; generated)
Active: active (exited) since Sat 2020-10-10 05:29:55 CEST; 6h ago
Docs: man:systemd-sysv-generator(8)
Process: 841 ExecStart=/etc/init.d/domoticz.sh start (code=exited, status=0/SU
Oct 10 05:29:55 raspberrypi systemd[1]: Starting LSB: Home Automation System…
Oct 10 05:29:55 raspberrypi domoticz.sh[841]: start-stop-daemon: unable to start
Oct 10 05:29:55 raspberrypi systemd[1]: Started LSB: Home Automation System.
lines 1-9/9 (END)
SANCLA
Seems Domoticz is unable to start. What you can do is enable the debut log, it’s described on the Domoticz forum: https://www.domoticz.com/forum/viewtopic.php?t=8878. That is the best I currently can do, I’m on the road and don’t have access to a desktop right now.
Paulie1001
I managed to install it in the end..
At the time of my problem, my RPi-4 was in arm64 bit mode (dont know if this matters)., and i was trying for hours installing domoticz via SSH from my Macbook.
My solution for the problem was to do a clean fresh install of Raspberry OS, keep the arm in 32-bit, and installed the domoticz directly with keyboard and RPi-4 -no SSH connection.
And now it works!! I´m not sure what was the problem, it could have been the terminal-client included in mac OS, or it could have been the ARM64bit mode in RPi-4. What do you think?
Dirk Jan
Thank you for this fine instruction. I have a problem I encounter all the times I try to install domoticz. The installation ends when “Checking for libudev” and domoticz is not on my system.
sancla
Good evening Dirk Jan,
I haven’t been using Domoticz for a while now, I switched to HomeAssistant about a year ago.
But I do recognize the issue you are talking about. I encountered the same issue when installing Domoticz on a Debian installation. Back then, I was able to resolve the issue by installing a few missing libraries. Perhaps you could give it a try and see if this works for you. It cant hurt either way.
Try and run the following command from the terminal (SSH):
sudo apt install cmake libboost-dev libboost-thread-dev libboost-system-dev libsqlite3-dev subversion curl libcurl4 libcurl4-openssl-dev libusb-dev zlib1g-dev libssl-dev git -y
If this doesnt work, you can raise the issue with the developers and give that a try:
https://github.com/domoticz/domoticz/issues
Dirk Jan
I don’t see my question and your reaction I got by mail. For the solution you give me thank you!! It worked!