This page is part of archived documentation for openHAB 2.5. Go to the current stable version

# openHAB 2 on Windows

The following instructions will guide you through the process of setting up openHAB 2.

This page is structured as follows:

# Prerequisites

First, be sure to check that your system has the necessary prerequisites.

Add the JAVA_HOME System Environment Variable in Windows. Navigate to:

  • Control Panel ➡️ System and Security ➡️ System ➡️ Advanced System Settings ➡️ Environment Variables ➡️ System Variables

Create a New System Variable based on your Java installation directory:


The directory that openHAB is installed to must contain no spaces. On this page, we will be using C:\openHAB2 as an example.

# Installation

The openHAB runtime is distributed using a platform-independent zip file. To install it, follow these simple steps:

  1. Download the latest Windows Stable or Snapshot ZIP archive file for manual installation from the Download (opens new window) page.

  2. Unzip the file in your chosen directory (e.g. C:\openHAB2)

    openHAB 2 Folders

  3. Start the server: Launch the runtime by executing the script C:\openHAB2\start.bat and wait a while for it to start and complete.


  4. Point your browser to http://localhost:8080. You should be looking at the openHAB package selection page. When you've selected an appropriate package, this page will contain the UI selection screen, see here for example.

# File Locations

Assuming a successful install, you will now have various folders inside C:\openHAB2:

Windows Installation
openHAB application C:\openHAB2\runtime
Additional add-on files C:\openHAB2\addons
Site configuration C:\openHAB2\conf
Log files C:\openHAB2\userdata\logs
Userdata like rrd4j databases C:\openHAB2\userdata
Service configuration C:\openHAB2\userdata\etc

# Backup

Make sure that you make regular backups of the conf and userdata folders, you can zip and unzip these folders too and from openHAB installations (even across most versions). When you have a setup that you are happy with, it would be a good idea to make a backup of the whole C:\openHAB2 folder. Which can be used any time after a failure.

# Updating the openHAB Runtime

To start the update process, run PowerShell as an administrator and use the following commands, while replacing x.x.x with the wanted openHAB version. Assuming you have openHAB installed in C:\openHAB2:

cd C:\openHAB2
. .\runtime\bin\update.ps1
Update-openHAB -OHVersion x.x.x

Now that openHAB has updated, you only need to run the above commands again for future versions.

# Starting openHAB as a Service

By installing the openHAB process as a service in Windows, you can:

  • Launch it automatically upon system startup
  • Run it in the background

Windows Service Installation Steps

  1. Complete the prerequisites and regular installation steps, including the package selection

  2. Issue the following two commands in your openHAB console:

    feature:install service-wrapper
    wrapper:install --name "openHAB2" --display "openHAB2" --description "openHAB 2 Service"

    Wrapper Install_Windows

  3. Shutdown the openHAB instance by typing logout in the currently running console.

  4. Update the newly created C:\openHAB2\userdata\etc\openHAB2-wrapper.conf to include all necessary parameters.

    • Copy all the config text from the below section and paste it in your openHAB2-wrapper.conf, replacing all existing content.
    • Adapt the first entry (OPENHAB_HOME) to match your openHAB installation directory.
    # openHAB2-wrapper.conf for Windows Service Installation
    # openHAB installation dir (Adapt this first setting to your system)
    # Wrapper Properties
    # Java Application
    # Java Parameters"%KARAF_HOME%""%KARAF_BASE%""%KARAF_DATA%""%KARAF_ETC%""%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed""%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext""%OPENHAB_HOME%""%OPENHAB_HOME%\conf""%OPENHAB_HOME%\runtime""%OPENHAB_HOME%\userdata""%OPENHAB_USERDATA%\logs""%OPENHAB_HOME%\userdata\config""%KARAF_ETC%\""%OPENHAB_LOGDIR%"
    # Wrapper Logging Properties
    # Wrapper Windows Properties
    wrapper.ntservice.description=openHAB 2 Service
  5. Open an elevated command prompt and type the following commands:

    C:\openHAB2\userdata\bin\openHAB2-service.bat install
    net start "openHAB2"

    Admin cmd


  6. Your openHAB Windows service is now installed and running. Validate proper operations by:

    • Browsing to http://localhost:8080 (opens new window)

    • Verifying that the Windows Service is running and set to Automatic Startup type. Use services.msc and find the openHAB2 service.

      Windows Service

    • Logging in with an SSH client to the console (see info below)

# Connecting to the openHAB console

You can connect to openHAB's console using the the C:\openHAB2\runtime\bin\client.bat script on the local machine. Alternatively, you can use a standard SSH client:

SSH Connection 1

SSH Connection 2

SSH Connection 3

SSH Connection 4