Emoncms docker on Synology DSM 6

Hello.

I’m trying to install emoncms in a docker through DSM 6 on synology server.
Unfortunatly I can’t launch the program.
Could you show me all steps to solve the issue?

Below the errors under the docker interface

AH00557: apache2: apr_sockaddr_info_get() failed for emoncms-docker

AH00558: apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1. Set the ‘ServerName’ directive globally to suppress this message

(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80

(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

no listening sockets available, shutting down

AH00015: Unable to open logs

Regards

It sounds like port 80 is already in use on you DSM. Sorry we can’t support DSM since we don’t have direct experience using this hardware. It should be possible.

THanks for your reply.
Could you tell me if I need to install in the same docker group Apache and PHP and bind them?
If it is the case could you show how proceed?
Regards

For anybody that is struggling with getting the Emoncms running in Docker on Synology:

  1. you need to have SSH access to your Synology. Just google “synology ssh”
  2. you obviously need to have docker installed
  3. you need Git Server installed (there is an official Synology package)
  4. SSH in
  5. Create a folder for your Docker images
mkdir /volume1/docker
cd /volume1/docker
  1. Then follow the instructions as usually with the exception of adding sudo when using docker-compose
$ docker pull openenergymonitor/emoncms
$ git clone https://github.com/emoncms/emoncms-docker
$ cd emoncms-docker
$ sudo docker-compose up

this will create all three containers for you and you will be able to sign in on http://yoursynologyip:8080. Assuming you don’t have anything else running on that port yet. If you do, you just need to edit docker-compose.override.yml and change the line - 8080:80 to what ever port you can spare.

  web:
    ports:
      # Expose Emoncms on localhost port 8080
      - 8080:80

That´s sounds great.
I´m using EMONCMS on an EMONPI now for over 1 year without no troubles.
Than´s for all the work which was done in the past on this piece of software.
Now i bought a NAS and will transfer my EMONCMS installation to the NAS (Synology) as described.

But i have an additional question. I´m using the post to MQTT feature from EMONCMS to post values to the preinstalled MQTT server.

Is this service also useable in the docker version ? (Publish values to MQTT server and other could subscribe to this service outside from the container. How are the data then reachable from ourtside the container at which ip and at which port (1883)?

As i´m a toatl docker newbie maybe this is a silly question.

And additionally to the previous step : is it possible to use the MQTT server also to publish data from other sources to the EMONCMS MQTT server ? and same how can i specify the iP and the port. ?

Thanks

Karl

Hello @MIA we don’t currently have an up-to-date docker file. It’s on our list of items to look at.

Ok
Then i will start first with installing an Docker image from Mosquitto on the NAS and configuring existing EMONCMS for the external MQTT server. Found some infos in the forum how this should work.

As my prefered solution is to have a seperate docker for EMONCMS on the NAS and a seperate Docker for MQTT also on the NAS which i can use for all the needed IOT staff for my homeautomatisation i´m working on (openHAB2+LCN+VELUX+SQUEEZE). As i planning to integrate some shelly´s which use also MQTT.

I’ve updated parts of the emoncms-docker today, it now uses the new settings.ini file and the directory structure is closer to what we are using on the EmonScripts build script. It’s still a work in progress, while it is functional from the HTTP API standpoint, the emoncms services such as emoncms_mqtt, feedwriter & service-runner are not yet running for the full emoncms capability.

You will need to build it from the docker file in the repository here:
GitHub - emoncms/emoncms-docker: Emoncms docker container(s)
rather than pull in the prebuilt image.

@glyn.hudson will be updating the pre build docker image soon and @emrys is going to look into the emoncms services.

Steps to try it are:

git clone https://github.com/emoncms/emoncms-docker
cd emoncms-docker
docker-compose build
docker-compose up

Then navigate to:

http://localhost:8080/

The result should provide a login screen that looks like this (but with a register button present):

Check that the version is 10.1.13 to indicate that its running the latest.

@glyn.hudson’s updated the docker image on docker hub Docker Hub

2 Likes

I tried this is synology docker but it comes up with this:-
Error: environment var ‘MYSQL_HOST’ not defined

Error: environment var ‘MYSQL_DATABASE’ not defined

Error: environment var ‘MYSQL_USER’ not defined

Error: environment var ‘MYSQL_PASSWORD’ not defined

Error: environment var ‘MYSQL_PORT’ not defined

Error: environment var ‘REDIS_ENABLED’ not defined

Error: environment var ‘REDIS_HOST’ not defined

Error: environment var ‘REDIS_PORT’ not defined

Error: environment var ‘REDIS_PREFIX’ not defined

Error: environment var ‘MQTT_ENABLED’ not defined

Error: environment var ‘MQTT_HOST’ not defined

Error: environment var ‘MQTT_USER’ not defined

Error: environment var ‘MQTT_PASSWORD’ not defined

Error: environment var ‘MQTT_BASETOPIC’ not defined

Error: environment var ‘PHPFINA_DIR’ not defined

Error: environment var ‘PHPTIMESERIES_DIR’ not defined

Warning : Redis::connect() expects parameter 2 to be int, string given in /var/www/emoncms/index.php on line 35
Can’t connect to redis at {{REDIS_HOST}}:{{REDIS_PORT}} , it may be that redis-server is not installed or started see readme for redis installation

I have treid to install it on the webstation of the NAS as well but the info on that is old and that does something along the lines of can’t access mysql even though I have set up musql table and user and entered it in the settings.ini

I hoped after that to use docker I have a persistant install of pihole on my NAS and it works well I even manage to update it as well without lossing data. Ideally I want to do the same with opencms so I imagine I need to edit the enviroment vairables to store the data on the NAS so that I can update without loss of data.

I did this and got this:-

ERROR: for emoncms-docker_web_1 Cannot start service web: b"Bind mount failed: ‘/volume1/docker/emoncms-docker/emoncms’ does not exists"

ERROR: for web Cannot start service web: b"Bind mount failed: ‘/volume1/docker/emoncms-docker/emoncms’ does not exists"
ERROR: Encountered errors while bringing up the project.

Redis and Mysql docker containers are up and I change the web1 to port 8090

Look into docker-compose.override.yml and comment out the line that says - ./emoncms:/var/www/emoncms. It should look something like this:

    volumes:
      ##mount emoncms files from local FS for dev
      #- ./emoncms:/var/www/emoncms

Any update? I just spent a couple fo hours trying to get this working, and now I’m seeing the same errors that you have.

I was able to get the errors to go away with “cp default-settings.ini settings.ini”, but then I got errors that it couldn’t connect to mysql.

It doesn’t look like mysql is even installed in the container.

Sorry for the lack of replies I have been busy.

I gave up on this put I have since installed portainer on my nas and so this would seem to be the way to go but I have no guide. I am not that knowledgeable about docker I keep dipping in and out of it and it looks to do all the things I want and I have it auto updating using watchdog so if this could be solved it would be great but I fear their is a LOT of reading to do before I get anywhere near the goal.