INSTAR Deutschland GmbH

openHAB 2 on Debian



OpenHAB 2 Installation

We are going to use the apt-get package manager to install the latest OpenHAB 2 snapshot on our Debian Linux server. For more installation options - different Linux versions, stable builds, etc. - check out the OpenHAB Download Section.

  1. We will start by adding the needed repository key:
wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
  1. Add the HTTPS transport for APT:
sudo apt-get install apt-transport-https
  1. Add the repository:
echo 'deb https://openhab.jfrog.io/openhab/openhab-linuxpkg unstable main' | sudo tee /etc/apt/sources.list.d/openhab2.list

OpenHAB 2 with your INSTAR IP Camera

  1. Update the package lists and install the openHAB distribution package:
sudo apt-get update && sudo apt-get install openhab2

OpenHAB 2 with your INSTAR IP Camera

  1. Execute the following statements to configure openHAB to start automatically using systemd:
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable openhab2.service
  1. You can start openhab2 by executing:
sudo /bin/systemctl start openhab2.service

OpenHAB 2 with your INSTAR IP Camera

  1. Open the OpenHAB default port in your Firewall:
sudo firewall-cmd --permanent --zone=public --add-port=8080/tcp
sudo firewall-cmd --reload
sudo firewall-cmd --list-all

OpenHAB 2 with your INSTAR IP Camera

  1. Navigate with a web browser to http://<ip-address>:8080 and select the Standard Package:

OpenHAB 2 with your INSTAR IP Camera

If the OpenHAB user interface does not load, you are probably missing Java on your Linux server. You can check the OpenHAB service status by typing:

systemctl status openhab2

OpenHAB 2 with your INSTAR IP Camera

How to install Java with Apt on Debian 9

In this guide, you will install various versions of the Java Runtime Environment (JRE) and the Java Developer Kit (JDK) using apt.

Installing the Default JRE/JDK

The easiest option for installing Java is to use the version packaged with Debian. By default, Debian 9 includes Open JDK, which is an open-source variant of the JRE and JDK.

This package will install OpenJDK version 1.8, which is compatible with Java 8. Java 8 is the current Long Term Support version and is still widely supported, though public maintenance ends in January 2019.

  1. To install this version, first update the package index:
sudo apt update
  1. Next, check if Java is already installed:
java -version

If Java is not currently installed, you'll see the following output:


OpenHAB 2 with your INSTAR IP Camera

  1. Execute the following command to install OpenJDK:
sudo apt install default-jre

This command will install the Java Runtime Environment (JRE). This will allow you to run almost all Java software.

Verify the installation with java -version:


OpenHAB 2 with your INSTAR IP Camera

  1. You may need the Java Development Kit (JDK) in addition to the JRE in order to compile and run some specific Java-based software. To install the JDK, execute the following command, which will also install the JRE:
sudo apt install default-jdk

Verify that the JDK is installed by checking the version of javac, the Java compiler:

javac -version

OpenHAB 2 with your INSTAR IP Camera

You can now navigate with a web browser to http://<ip-address>:8080 and select the Standard Package of OpenHAB2:


OpenHAB 2 with your INSTAR IP Camera

We highly recommend that you read the Concepts Introduction. It introduces a number of important ideas that will help you as you install and begin to configure openHAB for the first time.

Once you have openHAB up and running, the Configuration Guide contains everything you need to know to get your openHAB installation talking to different devices around your home. For instance, you can use Sitemaps to control how the status of these devices are displayed on different openHAB User Interfaces, and you can begin to experiment with Rules in order to get the most out of your installation. There are many other ways of interacting with your openHAB smart home: the most popular are presented in the Interfaces and Ecosystem section below.


OpenHAB 2 with your INSTAR IP Camera

OpenHAB Configuration though Paper UI

The Paper UI is a new interface that helps setting up and configuring your openHAB instance. It does not (yet) cover all aspects, so you still need to resort to textual configuration files.

Add-on management: Easily install or uninstall openHAB add-ons:

MQTT Binding

Go to the Add-Ons Menu and click on the Bindings Tab. As mentioned in the Node-RED Tutorial, we are going to use the MQTT protocol to communicate with our INSTAR IP camera from OpenHAB. To be able to connect to the Mosquitto MQTT Server we need to install the MQTT Binding - make sure that you choose the Version 2 (at the moment of writing this is the 2.4.0.SNAPSHOT version, that is not yet available in the stable version 2.3 of OpenHAB).


OpenHAB 2 with your INSTAR IP Camera

OpenHAB Cloud Connector

You can use the OpenHAB Cloud to access your Smarthome over the internet.


OpenHAB 2 with your INSTAR IP Camera