Changing port number on openHAB 2.0

I’m assuming that’s Ubuntu 16? Anything that doesn’t use sysVinit (most new versions of each distro) should work.

can confirm that this piece of documentation is still missing.
i am running the package on a synology and am trying to reconfigure the port in latest 2,1 0004 package i downloaded.

kindest regards

confirmed that the change needs to happen in the setenv file.
is there a fix allready for this ?
I had to edit following file to get this done

/volume1/@appstore/openHAB2/runtime/bin -->setenv

then changed the line from
if [ ! -z ${OPENHAB_HTTP_PORT} ]; then


if [ ! -z ${OPENHAB_HTTP_PORT} ]; then

Could we not just add the port to the /etc/default/openhab2 file?

same, after a lot of hair pulling I managed to change McMyadmin to jump ports and free up 8080 for openHAB, on with the show :smiley:

With the latest versions of the linux packages, this should now be the same across all systems. Editing the /etc/default/openhab2 file with the lines:


will change the appropriate ports. Thanks @ralle for pushing this fix.

If it still doesn’t work as expected for some, let me know and I will work to resolve it.


Thank you! Although I switched my other applications and am running openHAB on default ports, so can’t test…

I installed latest stable openHab2 on RPi3 and successfully changed ports in /etc/default/openhab2 as mentioned above.

The problem I have is that voice control with HABDroid only seems to work when I use port 8080.

Is this a bug or do I have to change ports in additional files?

Everything works with latest HABDroid from git-repo on S5mini

1 Like

have the latest version, not working for me to change the port to 80

running on an RPi

Port 80 is a restricted port, you’ll need to openhab with root privileges to use it.

It might be more beneficial to run a reverse proxy instead.

thanks, it is working now, but still can’t pair Hue Emulator with Google Assistant

Afaik, it does not work with Google Assistant, only with Google Home, see Google Home Integration.

Can some tell me how to get a fresh openhabian install to use port 80 with ngnix reverse proxy ?

Which file(s) need changing ?

You don’t need to change the openHAB2 ports that are used by default (8080 for http, 8443 for https) when using a reverse proxy like nginx or apache.
The proxy is running on port 80.
The clients connect to the proxy on 80 and the proxy connects to OH2 on 8080.

Check the link on Benjy’s post on how to set up a reverse proxy:

If you want to use the upcoming Google’s stuff, you need to switch openHAB2 to listen to port 80 natively (no use of proxy).
This is more difficult since:

Kai, to share my experience: Traveling to Munich (I am not living in Germany) I took the chance to buy a Google home and trying it out at a friend who as an original Philips Hue. The procedure in the google home app had been still the same. Back home, google home stayed on and I was able to include my openhab! Thanks for all the support.

Absolute beginner here who had the same problem after installing openhab-2.1.0 on a Mac mini running OS X Server on El Capitan 10.11.6
Solution here thanks to Udo_Hartmann.


I have changed the default port from 8080 to 8090. Everything is working fine locally but i can’t access the PaperUI or HABPanel via the cloud service.
openHAB Cloud

Where do I define the changed port to this binding?

The only change made so far is:

openhabian@openHABianPi:/$ nano /etc/default/openhab2

# The ports openHAB will bind its HTTP/HTTPS web server to.

Please advice

//Michael Stjerna

I guess you don’t need to, since the openHAB Cloud service connects from your local installation to the cloud (from inside to outside) by design, so you don’t need to open your Internet connection.

And both Paper UI and HABPanel cannot be accessed as far as I know, only basic UI.

Sure, that works too:

enter your credentials from your account and you are good to go …

Yes I got this working when I run on port 8080 but not on port 8090 that I use now.
There need to be some configuration for the remote “myopenhab” port settings…

Port for the local access is changed here:

openhabian@openHABianPi:/etc/openhab2/services$ nano /etc/default/openhab2

# The ports openHAB will bind its HTTP/HTTPS web server to.