Docker: influxdb internal network usage?

Hi all,

so I installed influxdb using docker this weekend and one of the things I noticed that I don’t seem to be able to make openhab connect to the influxdb through a docker alias.

I created a network “influxdb” and added it to the influxdb container with an alias “influxdatabase”, OpenHAB is on the same network, when configuring influxdb.cfg with:


Openhab (and Chronograf as well) spit outs a “cannot resolve host influxdatabase” error.
As OpenHAB and Chronograf both can’t access the influxdb through the alias this is more of a docker config issue then a OpenHAB issue. Yet I know some people are running their influxdb in docker as well and was wondering how they got this configured?

Note: when I configure the host ip “” and expose the influxdb port to the outside world everything works fine. Yet it should be possible to keep this in the docker backend and to keep things a bit more secure :slight_smile:

PS: I’m using a cofnfiguration with a backend network and alias for my mqtt setup and this works fine. No idea why it gives problems for influxdb


I’m running OpenHab with Influx and Grafana on a Qnap NAS. In order to spin up my setup I do run these commands in Qnap SSH:

docker run -itd
-p 8086:8086
-v /etc/TZ:/etc/timezone:ro
-v /etc/localtime:/etc/localtime:ro
-v /share/Docker/influxdb:/var/lib/influxdb
-e INFLUXDB_DB=openhab
-e INFLUXDB_USER=grafana

docker run -itd
-p 8101:8101
-p 9443:9443
-v /etc/TZ:/etc/timezone:ro
-v /etc/localtime:/etc/localtime:ro
-v /share/Docker/openhab/userdata:/openhab/userdata
-v /share/Docker/openhab/addons:/openhab/addons
-v /share/Docker/openhab/conf:/openhab/conf
-e APPDIR=’/openhab’
-e ARCH=‘x86_64’
-e CRYPTO_POLICY=‘limited’
-e LANG=‘en_US.UTF-8’
-e LC_ALL=‘en_US.UTF-8’
-e TZ=‘Europe/Luxembourg’
-e PATH=’/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin’

docker run -itd
–link influxdb:influxdb
-p 3000:3000
-v /etc/TZ:/etc/timezone:ro
-v /etc/localtime:/etc/localtime:ro
-v /share/Docker/grafana:/var/lib/grafana
-e “GF_INSTALL_PLUGINS=grafana-clock-panel,grafana-simple-json-datasource,natel-discrete-panel”

Big difference might be that I run OpenHAB with net=host (in order to fetch broadcast/multicast messages). If you do not want to run it on the machine’s network, just try the link attribute, the same way I did between grafana and influx container.

Thanks, the grafana stuff will definitely help me to setup grafana in the future :slight_smile :slight_smile:
So, I had a look at the link flag and it seems that it’s legacy and might get removed in the future so I prefer not to use it… I’ll check if I can find some assistance on the influxdb forum perhaps. To be continued!