[SOLVED] Rest API port on Synology Docker


I am in the process of moving my openhab installation from Windows to a Synology docker container. Now I run into a problem where someone might have a solution.

When trying if the rest api is running as expected in a browser with:
I get just some ASCII symobls shown: P
Trying the same with https
I get all items shown after I confirmed to load the page ignoring the certificate error

Using https in VS Code produces an error (I saw a github entry that accessing rest api by https is currently not working.)
If I use just the ip (so http) I get:

Error while connecting to openHAB REST API. Parse Error

Which is clear if vs code gets the same ascii chars I see in the browser.

I also tried port 8080 but this seems to lead to my Synology directly and brings a

HTTP Status 404 – Not Found

Is there a different port I should use?
No sure if I can map the ports in my Synology since I used the Synology Docker GUI and can’t find a port mapping there. Even if there would be one I am unsure which ports should be mapped to what.

I would be fine to not access it with https and use http instead but I have no idea what the problem is since even the call from a browser is not working and I just get those ascii characters.

Any hint is much appretiated since I don’t wan’t to go back to my Windows setup.

PS I am using latest stable docker openhab and latest openhab vs code plugin

Same Port for http and https ? That can’t work properly …

That’s normal … you can fix this Warning with an Valid certificate (hard way) or with an Reverse Proxy on your NAS (I think there is an valid Certificate)

To get help post your Docker Config… I think there are Bugs :wink:

Here my valid DEV openhab Docker Config

version: '2.2'

    container_name: OPENHAB_DEV
    image: "openhab/openhab:milestone"
    restart: always
    network_mode: host
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/TZ:/etc/timezone:ro"
      - "./addons:/openhab/addons"
      - "./conf:/openhab/conf"
      - "./userdata:/openhab/userdata"
      USER_ID: "XXXXX"
      OPENHAB_HTTP_PORT: "8585"
      OPENHAB_HTTPS_PORT: "8943"
      EXTRA_JAVA_OPTS: "-Duser.timezone=Europe/Berlin"

Kevin thanks for posting your docker config. After I changed the ports it’s working now! Also I realized that port8080 was used by a second container I have running (unifi controller) and that was causing my problem.