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.
- We will start by adding the needed repository key:
wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
- Add the HTTPS transport for APT:
sudo apt-get install apt-transport-https
- Add the repository:
echo 'deb https://openhab.jfrog.io/openhab/openhab-linuxpkg unstable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
- Update the package lists and install the openHAB distribution package:
sudo apt-get update && sudo apt-get install openhab2
- Execute the following statements to configure openHAB to start automatically using
sudo /bin/systemctl daemon-reload sudo /bin/systemctl enable openhab2.service
- You can start openhab2 by executing:
sudo /bin/systemctl start openhab2.service
- 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
- Navigate with a web browser to
http://<ip-address>:8080and select the Standard Package:
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
In this guide, you will install various versions of the Java Runtime Environment (JRE) and the Java Developer Kit (JDK) using
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.
- To install this version, first update the package index:
sudo apt update
- Next, check if Java is already installed:
If Java is not currently installed, you'll see the following output:
- 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
- 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:
You can now navigate with a web browser to
http://<ip-address>:8080 and select the Standard Package of OpenHAB2:
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.
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:
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).
You can use the OpenHAB Cloud to access your Smarthome over the internet.