Install Gladys on Qnap NAS

Hello,

As a Home Assistant user, I have just discovered Gladys and, as Pierre-Gilles suggests in his comparison video, I am tempted to use both solutions in parallel.

To date, Home Assistant runs on my QNAP NAS in a virtual machine. In parallel, the Container Station package is installed.

Can Gladys be installed on a QNAP NAS and, if so, how?

Thanks for your help,

Yann.

Hello and welcome to the forum.
I don’t know whether anyone has already installed Gladys on a QNAP NAS, but it has already been done on a Synology.

The prerequisite is to install Docker, because Gladys runs in a Docker container.

Here’s the link to the documentation if that can help you.

Hi @Yann_Gourrier, welcome aboard :slight_smile:
As @_Will_71 indicated, the install on QNAP should (normally) be as simple as on Syn

Hello and thank you both.

I was looking in vain for a link to download the image…

Thanks to your help it’s installed and I can find Gladys in Container Station.

Now I’m going to tinker to see how it goes.

I have a doubt about the storage folder. I created it and modified the script from the manual, but it’s empty… How can I check that everything is correct?

I don’t use Zigbee modules; I have quite a few bulbs, smart plugs and Hue remotes, and Meross Wi‑Fi modules recognized in Apple Home and Home Assistant.

Thanks again for your help.

Sincerely,

Yann.

You should have things like this:
![image|426x500, 75%](upload://lNafYvBdj

None of that.

I think QNAP’s Container Station must be different from Synology’s, and as a result the script is probably not suitable even though I modified the path like this:

\-v /DataVol1/docker/gladysassistant/:/var/lib/gladysassistant \\\

And since I don’t know anything about creating Docker containers, I’d rather not venture further.

Have a good evening.

Sincerely,

Yann.

My very personal opinion: I don’t recommend using the command line (I’m not good with it and I prefer to be able to modify what I want in docker compose without having to rewrite everything).
Now QNAP needs to support docker compose graphically — is that the case?
… I just saw that it’s called Applications in Container Station:

By the way this site explains very well the complete installation of Container Station and Portainer, which allows managing docker compose very well (called Stack).

So either you use a QNAP Application that you name GladysAssistant, or you use Portainer (which I recommend because it’s independent of the NAS you use and it’s what I have at home), and you put this code (in accordance with your storage directory for persistent data):

version: "3"

services:
  gladys:
    image: gladysassistant/gladys:v4
    container_name: gladys
    restart: always
    privileged: true
    network_mode: host
    cgroup: host
    logging:
      driver: "json-file"
      options:
        max-size: 10m
    environment:
      NODE_ENV: production
      SQLITE_FILE_PATH: /var/lib/gladysassistant/gladys-production.db
      SERVER_PORT: 8420 # port changed to avoid overlapping with the NAS ports
      TZ: Europe/Paris
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /DataVol1/docker/gladysassistant/:/var/lib/gladysassistant # to verify and validate
      - /dev:/dev
      - /run/udev:/run/udev:ro
  watchtower:
    image: nickfedor/watchtower
    restart: always
    container_name: watchtower
    command: --cleanup --include-restarting
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

To check:

  • path of the directory because I found /share/Container/ on several sites including the one mentioned above
  • make sure to give read-write (RW) rights on the directory to your user who created the docker to avoid write permission issues.

If needed, I can guide you on Portainer because I use this service a lot.
Here’s the example on my setup:
image

Hello and thank you for the time spent and these tips.

The integration of Portainer on the QNAP as explained in the link went smoothly.

Note that it was done inside Container Station by creating an application.

Then I pasted the script (thanks) into Portainer after checking the storage path.

Then deployed it as in the example from the link.

After that I found Gladys and Watchtower in Container Station with a message telling me that the Docker containers will have limitations because they come from outside.

I noticed that there is neither an IP address nor a MAC address linked to the containers, unlike the virtual machine that hosts Home Assistant (HA).

While digging around in Gladys, I realized that IPv6 addresses are required, which are not enabled in my setup.

And finally, no way to connect Gladys to Apple Home — the procedure after scanning the QR code on my iPhone failed several times in a row. A pity; for Hue everything was very smooth.

So I give up with regret, being taken with Gladys’s philosophy and its French origin.

If a QNAP owner more skilled than me would be willing to write a tutorial, I’m all for it.

Thanks again for your help and best of luck to Gladys.

Regards,

Yann.

PS: One last point about the paths for storage.

I have the impression that CACHEDEV1/_DATA /Container is the path to specify and that DataVol1 is a display name in File Station. Indeed, here’s what I see in the terminal:

Good news, glad you managed to get all that working.

Yes, because it’s Portainer that manages Docker Compose and therefore the containers.

That’s normal: VMs have IPs assigned by your router (usually via DHCP), and the containers are linked to the machine’s IP — in this case your QNAP.

This part is only for Matter, but we need to look again at whether IPv6 is essential or not, because I manage to pair Matter devices with Apple Home without IPv6…

That’s odd because I had already done it about a year ago and it worked.
I just tried again (iOS 18.7.2) and there is indeed an issue because no pairing is possible but without a crash :thinking: @pierre-gilles if you’re around.
However the HomeKit integration allows you to "see" Gladys in Apple Home, not the other way around. Is that what you want to do?

Haaaa good news! Well I don’t have any Hue devices so I won’t be able to help on that topic.

I have a question: do you use only Apple Home to manage your devices, only HA (Home Assistant), or a mix of both?
The goal with Gladys (at least in my opinion) would be to be able to control everything directly from Gladys.
And if an integration is missing (like Meross, which seems well managed by HA (Home Assistant) apparently) then I expose those devices via MQTT from HA to retrieve them later in Gladys.

So I retested and it works.
The scenario:

  • create a new home in Apple Home
  • in this new home click on Add or +
  • go to the Apple HomeKit integration on Gladys and click Relaunch
  • scan the new QR code with the phone
    Then it works and I get all my devices.

@bertrandda apparently HomeKit pairing seems to be crashing since the dependency update: Upgrade hap dependency to latest stable version by bertrandda · Pull Request #2379 · GladysAssistant/Gladys · GitHub

I’ll look into that

I just tried re-pairing HomeKit, it went well. I suspect the mDNS part. Is it possible to check:

  • that the container’s Network configuration is set to Host
  • that there aren’t multiple network interfaces on the NAS
  • did you try resetting the integration before pairing by clicking on image in the HomeKit integration configuration?

I see that Homebridge is running on a QNAP NAS so we should be able to find a solution

An image with a fix for adding Gladys to Apple Home is available, bertrandda/gladys:homekit-mdns. Is it possible to see if that fixes your problem?

Hello,
I’m reviving this topic because I’m also trying to install Gladys on my QNAP server to test this solution that looks pretty cool. I want something simpler than HA on a daily basis, I don’t want to do maintenance once the work is done.

Well, I’m also stuck, but I finally managed to install Portainer, with a Gladys docker and a Watchtower docker.
I can connect to the Gladys interface via my NAS’s IP (network-mode:host), but I have the impression that Gladys doesn’t have access to the internet.
For example, when I want to display the list of community integrations, it shows me the message « Gladys could not reach the store Â».
Same type of message, indicating an internet problem if I search for updates.

I’m stuck now, does anyone using a QNAP NAS have an idea where the problem might be coming from?

Thanks in advance for your help

@wombo27 … I, I have two QNAP NAS, both running Gladys Assistant perfectly. One I use for testing, the other in real operation.

What’s the issue?

My hurdles: Due to painful experiences, I exclusively install via Container Station and there exclusively via applications and a YAML.

I avoid Portainer on the QNAP, it’s just another layer.

My hurdles: First and foremost: Enable IPv6, no matter … at some point Matter over Wifi or Matter over Thread will come.

If you already have a Matter Hub, for example IKEA DIRIGERA, then this hub appears on your router as IP4 when activated. This creates a kind of transition from Matter over Thread IP6 to the DIRIGERA to the router to the local LAN or the wide internet.
Problem: This IP6 must be manually added as a route.

After that, there are a few more minor hurdles. Here is my YAML for the current operating system version of QNPA. You should only adjust your paths to your conditions:

Here it is:

services:
gladys:
image: gladysassistant/gladys:v4
#image: ``ghcr.io/gladysassistant/gladys-preview:cursor-matter-ac-mode-management-fb55
container_name: gladys
restart: always
privileged: true
network_mode: host
cgroup: host
logging:
driver: "json-file"
options:
max-size: 10m
environment:
NODE_ENV: production
# The database is now stored in the secure host volume
SQLITE_FILE_PATH: /var/lib/gladysassistant/gladys-production.db
SERVER_PORT: 8060
TZ: Europe/Berlin
# CHANGED: Set to 0.0.0.0 so that all interfaces (including vSwitch) are used !!!! Important Important Important
MATTER_BIND_INTERFACE: 0.0.0.0
MDNS_INTERFACE: 0.0.0.0
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# Your absolutely secure QNAP path:
- /share/CACHEDEV2_DATA/dockerdaten/gladysassistant:/var/lib/gladysassistant
- /dev:/dev
- /run/udev:/run/udev:ro

Then my experiences with other Docker that belong to Gladys:

External installation of Node Red did not work even with AI support from mistral and perplexity. Only with installation from Gladys itself it works.

Some Gladys add-on Docker cannot reach Gladys, that’s due to the virtual switch, i.e. if a Docker from/to Gladys does not work as it should, then simply ask an AI, give it the YAML of the Docker and ask it to set up the network configuration in the YAML so that it runs in the same virtual switch network.

If you have any further questions, just let me know

Best regards

Tom

Hi @Yann_Gourrier,

here is the approach to error analysis. Start the « Network and Switch Â» app on the QNAP, then set « Advanced Â» at the bottom left.

Then click on « Overview Â» on the left. Result: QNAP shows you exactly which Docker uses which virtual switch and how the path to the internet is. If it doesn’t match, Gladys says … nothing reached …

Then turn off the firewall in QNAP, which is often present and active, for testing purposes.

It seems there is a routing problem on your Gladys. It runs, but it can’t find its way out. You can check this with the same app. Simply click on Route on the left in advanced mode and you get:

There you can see exactly how each interface (see above) is running…

Ultimately, there are two approaches: If Gladys works locally but cannot access the internet, then it is a network routing issue. That is, the virtual switch for the internal Docker network does not get out … Routing problem

Gladys runs in the Container Station, but for example is not accessible locally, then it is often due to the network configuration in the YAML.

Best regards

Tom

Thanks Tom for taking some of your time to help us.
I confirm… I have no doubt the problem comes from the man, not the machine! :face_with_hand_over_mouth:

I’m going to start from scratch, I need to get IPv6 running first, as far as I understand it’s surprisingly essential for Matter to work. Then we simplify, we forget about Portainer and start with something simpler.
I’ll keep you updated on my progress, thanks again!

@wombo27 If you’re starting fresh for your QNAP, my experience is:

Take the standard YAML for the Docker installation of Gladys as a starting point. Create an application in Container Station, then « validate Â» it there. If it’s okay, then install it.

If you have problems reaching the wider world in Gladys, like I did: copy the YAML, then also copy the log in the container management (Container Management - Applications/Volumes - click directly on the Gladys Docker - logs will appear - and take everything to an AI, whether Mistral, Perplexity, or Claude, and say:

Look, my Docker is running, but something’s wrong with my QNAP’s network configuration. Important: Don’t forget to mention QNAP.

Regarding IPv6… no activated IPv6… no Matter. No fixed IPv6 route in QNAP means no accessibility to your devices. I almost despaired with the pairing code; it never found anything until Claude said: You need a fixed IPv6 route to your border router on your QNAP, i.e., IKEA Dirigera… done and dusted, and it’s been running since then.

I hope I could help and not give up,
Best regards

Tom

@ruegerth something to say: Wow!!

I spent some time fiddling with the virtual switches without success.
Then I tried your solution by giving my YAML and logs to an AI. And on the first try, it worked!
I’m really impressed! Until now, my experiences with AI were often off the mark, so for something so complex without it having the full context, I didn’t believe it.

Thanks for the help :slight_smile:
Now I can move on to experimenting with integrating my devices on Gladys.
See you soon!