[Tutorial] Installing Gladys on a Synology NAS

Hello everyone,

I’m proposing a tutorial to install Gladys on a Synology NAS via a project (Docker Compose) to facilitate future modifications if needed.

→ We will end up with 1 project with 2 containers that will be Gladys (for home automation) and Watchtower (for updates).

1. Prerequisites

  • Synology NAS compatible with Container Manager
  • Container Manager package installed
    image

2. Creating directories for Gladys

→ The goal is to create the directory for storing Gladys’ data

Once you have installed Container Manager, a new directory docker has been created on the Synology:


We then continue by creating a storage directory for Gladys:

Finally, we retrieve the path of the directory (which we will use later) by displaying its properties:

3. Creating the Gladys project
In Container Manager, go to Project then Create:


Then we fill in the fields and copy/paste the following docker compose:

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
      TZ: Europe/Paris
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /volume1/docker/gladysassistant:/var/lib/gladysassistant
      - /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

You will need to modify /volume1/docker/gladysassistant (if necessary) with the path of the directory retrieved earlier.
The port 8420 of SERVER_PORT: 8420 can be changed according to your configuration or if it is already in use. Avoid ports used by Synology and some native applications.

We validate with Next.

After that, there is no obligation to select the Web Portal (unless needed but you will normally have to install the Web Station package):


Finally, we can validate the project which will start right after:

The creation of the project with the download and launch of the files will be visible in real-time, this will take several minutes:

Once finished, the Gladys and Watchtower containers start:

→ We now have 1 project and 2 containers:



And the data files of Gladys:

4. Accessing Gladys
Access to Gladys is now done with the IP of your Synology and port 8420 (which we specified in the project): http://NAS_IP:8420

Then it’s just a matter of having fun :stuck_out_tongue_winking_eye:

Thanks for this tutorial, very clear!

Thanks @GBoulvin :grin: