Emoncms Docker...run Emoncms on your machine in 4 commands!

root@xen:/# docker ps | grep emon
438c4a303cb2        emoncms/apr                             "apache2-foreground"     4 months ago        Up 3 weeks          0.0.0.0:80->80/tcp                                                           emoncms
82544e7154f8        redis:alpine                            "docker-entrypoint..."   4 months ago        Up 3 weeks          6379/tcp                                                                     emoncms_redis
ff511ce35222        mysql:5.6                               "docker-entrypoint..."   4 months ago        Up 3 weeks          3306/tcp                                                                     emoncms_sql
root@xen:/#

I’ve been a very happy docker user for about a year. I managed to migrate from a basic emoncms install inside a VM to containers without losing anything.

I’ve learned a lot with @glyn.hudson post and as usual forgot to drop a simple thank you.

so… THANK YOU! :blush:

2 Likes

I’m glad to hear your finding the docker installation useful. Docker is fantastic.

Let me know if you have any suggestions on how to improve the emoncms docker setup. Git PR’s are best

2 posts were split to a new topic: Emoncms docker on DSM 6

The default web port port 8080 which clashes with OpenHAB can be changed by editing docker-compose.override.yml
(Answered my own question)

1 Like

That’s it! Emoncms should now be runnning, browse to http://localhost:8080

Very easy indeed! I get a login page of emoncms, but what is the default username and password? I found raspi-raspberry as combination on the web, but that doesn’t work on my system (Lubuntu).

I found it myself blush. I thought I couldn’t use register, because it would send an e-mail and that probably wouldn’t work. But it’s just used as an login name. But now I would like to use emonHUB and that doesn’t seem to be included in de docker image. I think I will go for a regular Ubuntu install, as docker is too new for me :-). And - as far as I understand - the docker image is (at the moment) only for development, not for real use.

For Ubuntu EmonScripts/readme.md at master · openenergymonitor/EmonScripts · GitHub

What are you going to use emonhub for? The 2 do not need to be on the same physical machine.

stupid Q… but does this mean that i can host emoncms on an open media vault machine?

I just tried to spin up a docker container using openenergymonitor/emoncms:latest but I am getting v10.1.13 when I login. From what I can tell, this image hasn’t been updated on Dockerhub for 2 years.

Is there a process to update this image after an EmonCMS release? Or do I just need to build it locally and use my own version of the image - i.e. is the version on Dockerhub obsolete and unused?

Hi Ben,

Looks like Docker development never really took off. More info at the link below:

According to that post, the build-script should be usable as the basis of a Docker image.

Thanks @Bill.Thomson - I will try building my own image using the Dockerfile in the emoncms-docker repo and see how I get on.

This has been working well for me for about 18 months, I rebuild it pretty often.

I don’t use very many features so the rather enthusiastic rm -rf might get rid of things you care about.

FROM openenergymonitor/emoncms

RUN rm -rf /var/www/emoncms

RUN mkdir /var/www/emoncms

RUN git clone https://github.com/emoncms/emoncms.git /var/www/emoncms

WORKDIR /var/www/emoncms/Modules

RUN git clone https://github.com/emoncms/dashboard.git
RUN git clone https://github.com/emoncms/graph.git
RUN git clone https://github.com/emoncms/app.git
RUN git clone https://github.com/emoncms/device.git

RUN chmod -R a+rx .

WORKDIR /var/www/emoncms/

COPY settings.ini .

Thanks for sharing. Any reason you don’t use the Dockerfile from the emoncms-docker repo? I guess if it ain’t broke…

I had to fix a typo on the device repo clone command, but other than that it has worked OK so far.

Good stuff @ben.jones12 - keep using the one from the repo if it’s doing what you need. It sounds like you are rocking now.

I use the stripped down one because I develop an app and wanted less things around to think about.

Just as an FYI - Please note that the systemd people are pretty strongly anti-Docker, because of Docker’s anti-systemd stance. So potentially expect difficult problems if you try to do anything complicated. Suppposedly Podman https://podman.io/ is a close to identical replacement. I don’t know much more than that; I haven’t used either.

I’ve got an odd issue, how do I backup my data? The build in Backup option doesn’t appear to show, even though the Component appears to be loaded:

image

I’ve been using this Docker build for a couple of years, want to migrate to a new VM and wanted to rebuild using the current recommended method.

Probably a daft questioin but then I am daft :wink:
I’m trying to install Emoncms in a docker container on an asutor nas.
I have docker installed on the nas ok.
So, here’s the daft bit. Do I need to install the Emoncms requirements (PHP, MySQL/MariaDB, Apache, Redis et al) on the NAS directly or in a docker container?

Following on from my question above. I started again fromm scratch following the instructions on this thread.
It seems to have gone ok but when I try to open it in a browser on another machine I get an Apache Error

Forbidden

You don’t have permission to access this resource.


Apache/2.4.38 (Debian) Server at

I have set up a Docker group. set access rights to rw.
Not sure what to try next.
Any pointers/ideas appreciated.
I attach a screenshot of portainer for info.

Can you get to the copyright file on this docker instance?, e.g. http://172.18.0.4/COPYRIGHT.txt

If that works fine, you need to have a look into the Apache logging.

1 Like

2 posts were split to a new topic: New hardware solution to replace Pi