Configure HTTP port on openHAB 2.5 - Missing /etc/default/openhab2 file

Dear openHAB community,
I would like to change the default ports of openHAB. Unfortunately I don’t find the right place to do so. I downloaded the latest stable version from the website as a zip, unzipped it according to the installation guid for linux. Now the openhab2 folder is created in the “/opt/” directory.

I tried to follow this thread - in particular the post of Ben Clark - Changing port number on openHAB 2.0, but I can’t find the mentioned file: " /etc/default/openhab2". I looked through all sub directories of the openhab2-directory as well as the directory “/etc/”, but I can’t find the mentioned file.

Do I have to create this file manually or did I miss to run some sort of installation script?

Thank you a lot in advance!

  • Platform information:
    • Hardware: Raspberry Pi 3B+/ 1GB RAM/ 16GB SD Card
    • OS: Linux version 4.9.35-v7+
    • Java Runtime Environment: JVM 25.65-b01; Version 1.8.0_65
    • openHAB version: openhab-2.5.4
  • Issue of the topic: I can’t find the file “/etc/default/openhab2” to set the variables OPENHAB_HTTP_PORT and OPENHAB_HTTPS_PORT
  • Please post configurations (if applicable): nothing yet configured

Something not right there.

What about if you try:

sudo grep OPENHAB_HTTP_PORT /etc/* -r

That should search through all the files in the /etc directory and below looking for that string. I just tried and it finds it in /etc/default/openhab2 so I don’t know why it’s not where it should be on you setup

Why aren’t you using apt to install? It is the recomended way over manual install. Or have you looked at openHABian?

All the files are where you extracted them and no default environment file is created as stated in the docs:

1 Like

I tried this command on my Linux machine, but it only showed me some script lines from the files “/opt/openhab2/runtime/bin/setenv” and “/opt/openhab2/runtime/bin/setenv.bat” and no files which include the OPENHAB_HTTP_PORT settings.

Therefor I will uninstall all openhab2 files and try the solution pointed out by @gitMiguel

1 Like

I tried to install with apt-get, but it only produced error messages. After that I formatted the whole SD-Card and tried the solution @gitMiguel pointed out - using openHABian. Luckily that worked out very well!

Thanks for your response!

1 Like

Glad to hear that it worked out! openHABian is a good way to start.