Menu
Cart

openHAB Installation using the Command Line

The openHAB website has installation instructions for various systems. If you have problems with the following instructions try these here.

If you are used to using the Linux command line you will just run the commands and then move to the start openHAB section. If you aren't used to the command line go to the detailed instructions below.

First verify that Java 1.8 or higher is installed by typing:

java -version

If your java version is less than 1.8 go to here and update it.

To install openHAB from the command line simply requires you to open a terminal and run the following four commands:

wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
echo 'deb http://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list

sudo apt-get update

sudo apt-get install openhab2

 

Detailed Instructions:

First you need to open a terminal. Usually the icon shown below is on the toolbar or the main menu. If not look in the "Accessories" tab in the menus. Or you can always try "<CTL><ALT>T".

 

This screenshot shows the commands you will run in order. Refer back to the screenshot as you execute the commands to verify they work correctly.

openHAB 4 commands

 First verify that Java 1.8 or higher is installed by typing:

java -version

If your java version is less than 1.8 go to here and update it. It is probably best to copy and paste the commands so you get them right. To paste in the terminal window you have to right click the mouse and select paste (<CTRL>+v will not work). This adds an encryption key for openHAB to the package repository.

wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey username=openhab' | sudo apt-key add -

This next command puts the file in the sources list.
echo 'deb http://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list

The next command updates the repository with the openHAB packages.

sudo apt-get update 

The next command installs openHAB.

sudo apt-get install openhab-runtime

If these commands worked openHAB is installed.

 Start openHAB:

openHAB is installed now but it is not running. Follow the instructions in this link to start it: Starting openHAB on Linux.