Installing openHAB 2 on Raspberry Pi (openHABian)
Eiko WagenknechtThis post explains how to install the home automation software openHAB on a Raspberry Pi. At the time of writing, openHAB version 2.5.1 is current. For a guide on openHAB 3, you can find it here.
Table of Contents
- Required Materials
- 1) Downloading and Installing the Required Software
- 2) Writing the Image to the SD Card
- 3) First Start of openHAB
- 4) Basic Configuration of openHAB
- 5) Optional: Activating the Karaf Console
- 6) Optional: Setting a Static IP Address
- 7) Restarting openHAB
- 8) Settings in the Web Interface
- Conclusion
Required Materials
- Raspberry Pi (e.g., from amazon.de (affiliate link) as a complete kit, approx. €80)
- microSD card, preferably with 16GB or more storage (e.g., Sandisk Ultra microSDHC 32GB from amazon.de (affiliate link), approx. €7)
- Card reader for the microSD card (e.g., Transcend TS-RDF9K2 from amazon.de (affiliate link), approx. €14)
1) Downloading and Installing the Required Software
To install openHAB on a Raspberry Pi, you need 3 downloads:
- The openHABian image (https://github.com/openhab/openhabian/releases/latest)
- When downloading the openHABian image, you need to get the .img.xz file (not .zip)
- Etcher (https://www.balena.io/etcher/) for writing the image to the SD card
- Putty (https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) for connecting via SSH
- Depending on your system, you’ll likely need the 64-bit MSI installer
After downloading, install Etcher and Putty.
2) Writing the Image to the SD Card
To write the image to the SD card, first connect the card with the card reader to your computer. Then start Etcher and select the downloaded .img.xz file in the first menu item and the SD card in the second item. The “Flash!” button starts the process.

3) First Start of openHAB
The completed SD card can now be inserted into the Raspberry Pi, which should then be connected to the network cable and power (in that order!). This boots up the system and performs several configuration steps in the background. During this process, new versions are downloaded from the internet, installed, etc. Depending on your connection speed, this can take a while. For me, it took about 20 minutes. During this time, there is no progress indicator. It is important not to disconnect power from the Raspberry Pi during this time… just wait!
You can tell that this step is complete when the welcome page appears at the URL http://openhab:8080:

4) Basic Configuration of openHAB
Now, we don’t continue in the web interface, but rather via SSH in the command line of the system to make some basic settings.
To do this, we connect to the system via Putty. It can be reached at:
Host: openhab, Port: 22 User: openhabian, Password: openhabian


The openhabian-config tool is used for configuration, which is started with root rights via the command “sudo openhabian-config”. The password is still “openhabian”.

There are now several settings to configure. You navigate between menu items using TAB and the arrow keys, and confirm with ENTER.
First, in the “System Settings” section under “Set System Timezone”, set the timezone, probably to your local timezone:




Also under “System Settings”, you can set a new password. This is highly recommended, otherwise anyone on the network can access and modify the complete openHAB configuration. The setting is in the “Change Passwords” submenu. It’s best to select all services there (use the space bar to set checkmarks) and then enter and confirm the new password:






5) Optional: Activating the Karaf Console
For many administrative possibilities, openHAB offers its own console, the so-called “Karaf” console. It is accessible via SSH in parallel to the normal SSH shell, but on a different port (8101). For it to be accessible from the network, access must be enabled.
This is done in the “openHAB related” menu under “Remote Console”. There you have to enter a password again (best to use the same as above).




To test if the setting was successful, you can now establish a connection with Putty.
Host: openhab, Port: 8101 User: openhab, Password: as just set


6) Optional: Setting a Static IP Address
Some use cases require openHAB to run with a static IP address. Therefore, it makes sense to set this now. The easiest way to do this is if you have a FritzBox or a router with similar functionality. Then the IP can simply be configured there as a static DHCP lease, in the case of the FritzBox with the checkbox “Always assign the same IPv4 address to this network device.”

7) Restarting openHAB
For all settings to take effect, you should execute the command “sudo restart” in the normal SSH console afterward.
8) Settings in the Web Interface
Now, finally, it’s time to access the web interface again at http://openhab:8080. There, you first need to select which startup configuration you want to begin with. I chose “Standard”. But don’t worry, everything can still be adjusted later.

After clicking, you’ll need to wait again - once more without a progress indicator - until the interface shows the following tiles:

By clicking on “PAPER UI”, you access the actual interface where we can make some settings. To do this, we click on Configuration > System.
The settings are always saved block by block. It is therefore important to always use the SAVE button next to the changed settings, otherwise the settings will be lost immediately.

After a new installation, I configure the following areas:
- Ephemeris - Contains information about holidays and regional settings
- Network - Network settings
- Regional Settings - More regional and location settings
You’ll need to replace the exact values with ones appropriate for you. I configured it like this:



Somewhat hidden, there is a second settings menu with exactly one setting, namely the language. You can find it under Preferences in the menu and can switch to German there if you want. Unfortunately, the openHAB interface is not yet localized, so this only affects some add-ons. Here, you need to save with the blue check mark in the top row.


Conclusion
That’s it, openHAB is now installed and operational. Further configuration can now begin!
I look forward to your comments on whether this article helped you. Feel free to write if you have questions or if something remained unclear. Or if you were able to implement exciting automation projects based on this setup 🙂
No Comments? No Problem.
This blog doesn't support comments, but your thoughts and questions are always welcome. Reach out through the contact details in the footer below.
Support Me
If you found this page helpful and want to say thanks, you can show your appreciation by using this link for your next purchase on amazon.com. As an Amazon Associate I earn from qualifying purchases. I get a small commission, and it costs you nothing extra. You can also sponsor me on GitHub here.