How to Install OpenHAB on Fedora CoreOS Latest
OpenHAB is an open-source home automation platform that enables communication between devices from different manufacturers. Fedora CoreOS is a container-focused operating system. Installing OpenHAB on Fedora Core OS requires several steps that we will outline in this tutorial.
Prerequisites
- Installed Fedora Core OS
- Root access
- Basic knowledge of Linux commands
Step-by-Step Guide
Step 1: Launch Terminal
- Open the terminal from the installed Fedora Core OS.
Step 2: Install Java
- OpenHAB requires Java to function correctly. Install Java with the following command in the terminal:
sudo dnf install java-11-openjdk-devel
Step 3: Download Latest OpenHAB package
- In the terminal, create a new directory for OpenHAB, download the latest OpenHAB package from the OpenHAB website and extract it with the following commands:
sudo mkdir /opt/openhab
cd /opt/openhab
sudo wget https://bintray.com/openhab/mvn/download_file?file_path=org%2Fopenhab%2Fdistro%2Fopenhab%2F2.5.12%2Fopenhab-2.5.12.zip
sudo unzip download_file?file_path=org%2Fopenhab%2Fdistro%2Fopenhab%2F2.5.12%2Fopenhab-2.5.12.zip
Note: Replace the version number with the latest version available for download.
Step 4: Configure User Permissions
- Fedora Core OS uses the
rootlessmode by default, and OpenHAB requires access to some system resources. You need to add the useropenhabto the required groups by running the following command in the terminal:
sudo useradd --system --user-group openhab
sudo usermod -G audio,video,storage openhab
Step 5: Start OpenHAB Service
- Enable and start the OpenHAB service with the following commands in the terminal:
sudo /opt/openhab/userdata/bin/karaf
systemctl enable openhab.service --user openhab
systemctl start openhab.service --user openhab
Note: The first command,
sudo /opt/openhab/userdata/bin/karaf, starts the Karaf console, which is the command-line interface of OpenHAB. Typelogoutto exit the Karaf console after the OpenHAB service starts.
Step 6: Check OpenHAB Status
- Check the status of OpenHAB with the following command in the terminal:
systemctl status openhab.service --user openhab
- Output:
● openhab.service - openhab
Loaded: loaded (/home/openhab/.config/systemd/user/openhab.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-10-06 15:07:44 EDT; 5s ago
Process: 42406 ExecStart=/opt/openhab/runtime/bin/karaf server (code=exited, status=0/SUCCESS)
Main PID: 42407 (java)
Tasks: 33 (limit: 2256)
Memory: 332.6M
CGroup: /user.slice/user-1000.slice/[email protected]/openhab.service
└─42407 /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-0.fc34.x86_64/bin/java -Dopenhab.home=/opt/openhab -Dopenhab.runtime=/opt/openhab/runtime -Dkaraf.home=/opt/open>
Step 7: Access OpenHAB Dashboard
- OpenHAB Dashboard is available on port 8080. Open your browser and enter the following URL:
http://localhost:8080
Congratulations! You have successfully installed OpenHAB on Fedora Core OS. You can now customize and configure OpenHAB as needed. Visit the OpenHAB documentation for more information.