Appdaemon setup using docker

I’m using a bridged Network.

The problem I seem to have is half the SSH commands don’t work that I follow from guides, im guessing this is due to running HA in docker?

I’m not running SSL I tried to get that running as well but hit a brick wall due to HA on docker. This isn’t really a major issue as I wanted SSL so I could get Google Assistant working with HA but it works great with HA cloud.

I’ll give this a shot later, thanks for the URL. Once I get appdaemon working is the process of getting HADashboard up and running the same as the guide or will I be hitting more brick walls?

if you follow the docs, you normally will have HADashboard up and running.

the only thing i came accross here on the forum is that someone did get an error in the “testing system” part.
if that happens just go on with the “persistent configuration” and make sure that you do use the link in the last paragraph

At this point forward, you can edit configurations on your conf folder and Appdaemon will load them see the AppDaemon Installation page for full instrctions on AppDaemon configuration. Have fun!

So the first step I get a permission error when I run the following command when I SSH in to my Synology NAS, from the documentation I meant to do this from here and not SSH in to the container?

docker run --rm -it -p 5050:5050 \
  -e HA_URL="<192.168.0.66:8123>" \
  -e DASH_URL="http://$HOSTNAME:5050" \
  acockburn/appdaemon:latest

This is the error I get:

Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.29/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
-sh: docker:: command not found

Have you done the post install steps for linux?
https://docs.docker.com/install/linux/linux-postinstall/

1 Like

thx @gpbenton for looking into this.
i really have no experience with docker :wink:

Tried this just get “command not found” when I try and run the first command in that guide after SSH to synology NAS and logging in, helps if I understand the reason for doing these steps which I don’t. Is there a docker image I can get with appdameon already installed? This docker thing is a nightmare!

From the first paragraph of that guide

The docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can only access it using sudo. The docker daemon always runs as the root user.

Which seemed to be the problem you were having, judging from the error message.

But if there is really an error from sudo groupadd docker, the Synology implementation of Linux seems very limited.

You could try adding sudo to the start of the docker command to run it as root, but this may have security implications I am not aware of.

Someone else said they were using some gui to add the docker image to a Synology. Do you have access to that?

Yes I used the Synology GUI to setup docker and add Home Assistant to Docker.

All I have done is enabled SSH on my Synology NAS and SSH to it. I login with the Admin account of my Synology NAS which I believe is a root user as it’s in the Administrator group. I’m then at a prompt admin@DATASERVER:~$ when I try to run the command sudo groupadd docker it asks me for the password again and then I get “sudo: groupadd command not found”. As you can see I know nothing about Linux.

Is there some reason why you can’t use that to start an appdaemon container?

Is there some reason why you can’t use that to start an appdaemon container?
[/quote]

I searched the registry in docker for HADashBoard and found 18 results, I tried to launch a couple of them but they just keep restarting…

HADashboard is a part from AppDaemon.

so you need to search for appdaemon.

To be specific, this is the one you want
https://hub.docker.com/r/acockburn/appdaemon/

2 Likes

Thanks for that, got it running ok, now I have the appdaemon container running am I back at the guide below and what step should I be at? I’m guessing I need to configure the HA URL.

[Docker tutorial — AppDaemon 4.4.3 documentation](http://Appdaemon with Docker)

1 Like

i think you are at that point now:

http://appdaemon.readthedocs.io/en/latest/DOCKER_TUTORIAL.html#testing-your-system

So I SSH in to the snology NAS and run the command and I’m back to getting the same permissions error:

docker run --rm -it -p 5050:5050 \
  -e HA_URL="<192.168.0.66:8123>" \
  -e DASH_URL="http://$HOSTNAME:5050" \
  acockburn/appdaemon:latest

docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.29/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See ‘docker run --help’.

I noticed in the Synology there’s an option to “execute the container using high privilege” do I need to enable this?

I ended up buying Raspberry Pi and have appdaemon and duckdns working now

the commands I used when installing Appdaemon on Synology are:

sudo docker run --name=appdaemon -d -p 5050:5050
–restart=always
–net=host
–privileged
-e HA_URL=“http://10.0.0.147:8123
-e DASH_URL=“http://10.0.0.147:5050
-v /volume1/docker/appdaemon/conf:/conf
-v /etc/localtime:/etc/localtime:ro
acockburn/appdaemon:latest

When I need to update I use the following:

sudo docker stop appdaemon
sudo docker rm appdaemon
sudo docker pull acockburn/appdaemon:latest
sudo docker run --name=appdaemon -d -p 5050:5050
–restart=always
–net=host
–privileged
-e HA_URL=“http://10.0.0.147:8123
-e DASH_URL=“http://10.0.0.147:5050
-v /volume1/docker/appdaemon/conf:/conf
-v /etc/localtime:/etc/localtime:ro
acockburn/appdaemon:latest