Because of limitation on my Synology NAS I bought a NUC with i3 processor and 16GB RAM
I installed Ubuntu and docker and created a yaml compose file
I can install and it shows as running.
But I can´t access it on port 8080
The yaml file
name: docker-compose.yml
There you can see the IP address - I 1st recommend to try to connect to the IP - not the hostname to avoid potential problems with name resolution. If you do not see anything on port 8080, or 8443 then we need to check other things - but that’s a first step in my opinion.
I think this is not necessary, as you directly map to the host os filesystem in the volumes section.
Here my declaration - note, I use a customized image and a .env file to define some of the environment variables; but this should not make a dfference:
I use visual studio code with the recommended docker extensions - this will help you to e.g. have a look at the logs and to open a shell inside the container; but there are other tools that provide good support as well … e.g. portainer.
Ignoring is not a good thing . Did you copy the configuration from an other machine? If so the server might be configured to bind to a defined IP. Search the userdatadirectory if the config file contains the IP of the previous machine (the container should be stopped while you do this). Then replace the IP with 0.0.0.0 (you can configure to what interface to bind later again in the UI.
Start the container again and do the netstat thingy again …
Interesting … It is strange that it finds more than one IP address for your machine (192.168.65.6 & 192.168.65.9). I wonder why that’s the case …
You can try to bind OH with the environment var as shown above - but I do not know to which address … do you have wired & wlan connection active? If so I recommend to disable wifi on the host and use the wired connect.
If that does not help we need to dig some more …
What do you get when you type ip a on the host (note: do not post the MAC’s here, only the rest of the info).
Also the this output might be interesting:
docker network ls
NETWORK ID NAME DRIVER SCOPE
15c0b2c93f5e bridge bridge local
42168d95b3b2 host host local
5a135460cb37 laptop_zwave bridge local
3ff621a56cdf none null local
Digged a big arround - and not sure if OPENHAB_HTTP_ADDRESSwill have an effect; but the following config file might be of interest userdate/org/openhab/network.config:
How are you trying to connect to port 8080? Are you connecting from the local docker host, or from a remote host?
Install netcat if necessary:
sudo apt-get install netcat
On the Ubuntu docker host, I’d try
nc -zv localhost 8080
On a remote host I’d try the same command:
Linux:
nc -zv localhost 8080
Windows Powershell:
Test-NetConnection -ComputerName IPADDR_HERE -Port 8080
i.e.
Test-NetConnection -ComputerName 192.168.250.128 -Port 8080
Check the Ubuntu firewall:
sudo ufw status
Create a rule if necessary:
sudo ufw allow 8080/tcp
What output are you getting from docker ps (or docker ps -a)?
OpenHAB tends to use a lot of different ports, and some bindings use additional ports, and so I just allocated a separate local IP to OpenHAB. I’m happy to listen to the purists rant about this being an anti-pattern for containers.
Here is the approach that I use:
docker network create lan -d ipvlan
–subnet=192.168.250.0/24
–gateway=192.168.250.1
-o ipvlan_mode=l2
Where my home subnet is 192.168.250.x/24
I run the container with a static IP:
docker run
–name openhab
–net=lan
–ip=192.168.250.128
-v /etc/localtime:/etc/localtime:ro
-v /etc/timezone:/etc/timezone:ro
-v /container-data/openhab/addons:/openhab/addons
-v /container-data/openhab/conf:/openhab/conf
-v /container-data/openhab/userdata:/openhab/userdata
-e “CRYPTO_POLICY=unlimited”
-e “EXTRA_JAVA_OPTS=-Duser.timezone=America/New_York”
-d
–restart=always
openhab/openhab:latest
So there are some troubleshooting steps and some food for thought steps.
Networking with docker can definitely be a little tricky!
Not sure if you‘ve seen this one, but on my end it worked exactly like this some weeks ago (I killed my system and luckily could follow my own step-by-step).
I run oh on a dedicated nuc sized pc (ASUS) running Ubuntu. I surmise that your nuc is dedicated to OH? I’ve had zero issues running OH installed with apt. Are you planning to run additional server apps? I don’t see the value of docker in a dedicated box