Installing on an Ubuntu system with openHAB and Docker

1. Prerequisites

To run CometVisu with openHAB and Docker the following things are needed:

  1. server with working openHAB installation.

  2. Docker CE and Docker Compose.


No additional web server, such as Apache or similar with PHP support installed is needed, as this is is all part of the container. The above items are all that is required to get up and running successfully.

2. Installing Docker-CE and Compose on the server

This can all be done by running the following console commands:

# Update
sudo apt-get update

# Install prerequisites
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

# add the Docker GPG key
curl -fsSL | sudo apt-key add -

# add Docker repository key
sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"

# Update again
sudo apt-get update

# Install docker-ce and compose
sudo apt-get install docker-ce docker-ce-cli docker-compose

3. System preparations

# Add current user to group *Docker*
sudo usermod -aG docker $USER

After that re-login with that user.

# create folder resource/config for the current user
sudo mkdir -p resource/config

# create an example XML-file in resource/config
sudo nano resource/config/visu_config.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<pages xmlns:xsi="" design="pure" xsi:noNamespaceSchemaLocation="../visu_config.xsd" lib_version="8">
    <status type="html"><![CDATA[
            <img src="resource/icons/comet_64_ff8000.png" alt="CometVisu" /> by <a href=""></a>
            -<a href=".?forceReload=true">Reload</a>
            -<a href="?config=demo">Widget Demo</a>
    <status type="html" condition="!edit" hrefextend="config"><![CDATA[
            - <a href="edit_config.html">Edit</a>
    <status type="html" condition="edit" hrefextend="all"><![CDATA[
            - <a href=".">normal Mode</a>
    <status type="html"><![CDATA[
        - <a href="check_config.php">Check Config</a>
        <div style="float:right;padding-right:0.5em">Version: SVN</div>
<page name="Start page">
# create backup and media folders
sudo mkdir -p resource/config/media
sudo mkdir -p resource/config/backup

# set access rights for the web server
sudo chown -hR www-data:www-data resource/config

4. Install CometVisu via Docker

Install the docker container now

# create yaml file
sudo nano docker-compose.yaml

# example content to configure the docker container to use openHAB as backend

version: '3.4'
        image: "cometvisu/cometvisu:latest"
        restart: always
        - 80:80
            - ./resource/config:/var/www/html/resource/config
            BACKEND_NAME: "openhab"
            BACKEND_OPENHAB: "/rest/"
            BACKEND_PROXY_SOURCE: "/rest"
            BACKEND_PROXY_TARGET: "http://<IP-Openhab2>:8080/rest"


Please make sure that you use 2 spaces for indentation when you edit the YAML-file.

# start the docker container
docker-compose up -d

# find out the name if the running container
docker-compose ps

# find out the IP address of the docker container, <name> must be replaced with the correct container name
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' <name>

You can access the CometVisu in your browser with the URL http://<container-IP>:.