Do it your self Hobby

Install Openhab2 on Raspberry Pi 3 (Manual Method)

Openhab is a great application running on your Raspberry Pi if you want to build home automation. In this tutorial, we will install Openhab2 on Raspberry Pi 3 using the Manual Method
What we need:

  • Raspberry Pi 3 with Raspbian installed
  • Connect your Raspberry Pi3 on the Wifi

Set a Static IP on Raspberry Pi

We need to set a static IP on Raspberry Pi first. You can visit my other post to see the two different methods on setting a static IP

sudo nano /etc/network/interfaces

Go down and you should see the code below.

auto eth0
iface eth0 inet manual
allow-hotplug wlan0
iface wlan0 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Lets set the IP

sudo nano /etc/dhcpcd.conf

Go down and paste this code, but change the IP according to your network. My Network is 192.168.2.x. Yours maybe different:

interface wlan0
     static ip_address=
     static routers=
     static domain_name_servers=
sudo systemctl enable dhcpcd
sudo systemctl enable networking

We have to reboot

sudo reboot

Installing OpenHab2 – Manual Method

Update and Upgrade the system first. This may take some time.

sudo apt-get update
sudo apt-get upgrade

Add OpenHab user, group, directory, change the ownership and set password:

sudo adduser --system --no-create-home --group --disabled-login openhab
sudo mkdir /home/openhab
sudo chown -R openhab:openhab /home/openhab
sudo passwd openhab

Download the package

cd /tmp
wget -O

Unzip the package

sudo apt-get install unzip
sudo unzip -d /opt/openhab2

Delete the zip file


Take the ownership

sudo chown -hR openhab:openhab /opt/openhab2

Finally, launch the OpenHab runtime

sudo su -s /bin/bash -c '/opt/openhab2/' openhab

Install Openhab runtime Manual method
Go to your browser and open the url: http:// [your raspberrypi ip address]:8080
In my case its:
The initial setup page will show:
Install Openhab Manual method Initial setup
Select Standard (recommended setup)
Then you will be waiting for about 25 minutes while UIs are being installed. I recommend you to use a timer and set to 25 minutes. Because in some cases I waited for 45 minutes and the installation screen still not change. What I do is to force it to stop after 25 minutes and re-run again just to speedup the process.
Install Openhab Manual method Initial setup UIs installation
After 25 minutes, go back to your console and type logout.


If you check your browser you will see 404 page, don’t worry about it. Now re-run the runtime on console by typing:

sudo su -s /bin/bash -c '/opt/openhab2/' openhab

After few seconds, go back and refresh the webpage, keep re-trying after a minute if it still not showing. The image below will show if the installation is successful:
Install Openhab Manual method Initial setup UIs installation interface

Creating a Service for Openhab2

If you logout from the runtime, you will notice the Openhab will not run. We can make a service file so Openhab will automatically run every boot up without launching the runtime.
On console, type:


Creating the Service file:

sudo nano /lib/systemd/system/openhab2.service

Paste this code:

Description=The openHAB 2 Home Automation Bus Solution
ExecStart=/opt/openhab2/ server
ExecStop=/bin/kill -SIGINT $MAINPID

Save it and exit
Make the file as a Service

sudo systemctl daemon-reload
sudo systemctl enable openhab2.service
sudo systemctl start openhab2.service
sudo systemctl status openhab2.service

Reboot your Raspberry Pi and try the page again
Thats it, you just install OpenHAB2 on a Raspberry Pi 3 using the manual method.
Directory Information

DIRECTORIES of Manual Method
openHAB application		/opt/openhab2
Additional add-on files		/opt/openhab2/addons
Site configuration		/opt/openhab2/conf
Log files			/opt/openhab2/userdata/logs
Userdata like rrd4j databases	/opt/openhab2/userdata
Service configuration		/lib/systemd/system/openhab2.service

1 thought on “Install Openhab2 on Raspberry Pi 3 (Manual Method)”

  1. hello , im struggling to login to new user openhab on the pi via ssh? any help will be much appreciated

Comments are closed.