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

# openHAB on Windows

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

This page is structured as follows:

# Preparation of the environment

# Before you start

Please be sure you have installed the required supporting applications as described in Prerequisites.

# Set 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 named JAVA_HOME (or update the existing one) to match the installation directory of the Java Platform chosen and installed in the step Prerequisites.


# Choose a folder name for the openHAB installation

The name must contain no spaces. On this page, we will be using C:\openHAB as an example.

# Installation

# Install openHAB

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:\openHAB)

    openHAB Folders

  3. Start the server: Launch the runtime by executing the script C:\openHAB\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 page requesting you to set up an administrator username and password:


You are now able to work in the openHAB environment, when launched using C:\openHAB\start.bat. You can choose to add a link to it on your Desktop, Taskbar or start menu as you deem more convenient. If you instead would like to have openHAB start automatically with Windows and run in the background, you can choose to install it as a service as described below.

# Set up openHAB to run as a Windows 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.

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

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

    Wrapper Install_Windows

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

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

    1. Copy all the config text from the below section and paste it in your openHAB-wrapper.conf, replacing all existing content.
    2. Adapt the first entry (OPENHAB_HOME) to match your openHAB installation directory.
    # openHAB-wrapper.conf for Windows Service Installation
    # openHAB installation dir (Adapt this first setting to your system)
    # Wrapper Properties
    # Java Application
    # Wrapper Logging Properties
    # Wrapper Windows Properties
    wrapper.ntservice.description=openHAB Service
  5. Open an elevated command prompt and type the following commands:

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

    Admin cmd


  6. Your openHAB Windows service is now installed and running.

    Validate proper operations by browsing to http://localhost:8080 and verifying that the Windows Service is running and set to Automatic Startup type. Use services.msc and find the openHAB service. Or by logging in with an SSH client to the console (see info below)

    Windows Service

# File Locations

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

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

# What next?

You can:

  • continue reading the Additional steps section of the Installation overview
  • read more about how to handle basic maintenance tasks, in the section below

# Maintenance

# 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:\openHAB 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:\openHAB:

cd C:\openHAB
. .\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.

# Uninstallation

  • perform a backup as described above
  • uninstall openHAB as a Windows service: run PowerShell as an administrator and use the following commands
net stop openHAB
C:\openHAB\userdata\bin\openHAB-service.bat remove
  • you can delete the whole contents of the C:\openHAB\ folder.

# Connecting to the openHAB console

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

  1. Install an SSH client application, e.g., Putty (opens new window), KiTTY (opens new window) or Xshell 5 (opens new window)

  2. Setup a session with the following parameters:

    Port: 8101
    Username: openhab
    Password: habopen

SSH Connection 1

SSH Connection 2

SSH Connection 3

SSH Connection 4