Skip to main content

Install Gladys Assistant with Docker

In this tutorial, we go through the instructions for installing Gladys Assistant with Docker. This tutorial works for any system (Mini-PC, NAS, Linux Server, VM...).

Install Docker

To install Docker, simply run the command:

curl -sSL https://get.docker.com | sh

To verify that Docker is working as expected, type:

sudo docker ps

It should show an empty list of running containers.

If you have any issues installing Docker, have a look at the docker documentation. Look for instructions pertaining to your system.

Start Gladys

You can start a Gladys container with the command:

sudo docker run -d \
--log-driver json-file \
--log-opt max-size=10m \
--cgroupns=host \
--restart=always \
--privileged \
--network=host \
--name gladys \
-e NODE_ENV=production \
-e SERVER_PORT=80 \
-e TZ=Europe/Paris \
-e SQLITE_FILE_PATH=/var/lib/gladysassistant/gladys-production.db \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /var/lib/gladysassistant:/var/lib/gladysassistant \
-v /dev:/dev \
-v /run/udev:/run/udev:ro \
-v /run/dbus:/run/dbus:ro \
gladysassistant/gladys:v5

Note:

  • -d => Run container in background
  • --log-driver json-file => Configure container logging
  • --log-opt max-size=10m => Limit log file size to 10MB
  • --cgroupns=host => Use host's cgroup namespace
  • --restart=always => Automatically restart container
  • --privileged => Give extended privileges to container
  • --network=host => Use host network stack
  • -e => Set environment variables
  • -v => Mount volumes
  • -v /run/dbus:/run/dbus:ro => Gives Gladys access to the host's system bus. It is what lets you reboot or shut down the machine from the System settings, and it is the prerequisite for Bluetooth: pairing a Matter device over BLE and reading Bluetooth sensors both go through BlueZ, which is only reachable over that bus. The host needs BlueZ installed (sudo apt install bluez on Debian and Ubuntu).
  • TZ=Europe/Paris => Timezone used by container. Feel free to consult this list on wikipedia if you need to change this value.

Auto-Upgrade Gladys with Watchtower

You can use Watchtower to upgrade automatically Gladys when a new version is available. To do so, start a Watchtower container:

sudo docker run -d \
--name watchtower \
--restart=always \
-v /var/run/docker.sock:/var/run/docker.sock \
nickfedor/watchtower \
--cleanup --include-restarting

Accessing Gladys

Open http://gladysassistant.local in your browser. Gladys announces that name on your local network over mDNS, so you can reach it from any device on the same network without ever looking up an IP address.

note

You must be on the same network as the machine.

If you run several Gladys instances at home, you can rename each one from Settings → System → Local address (mDNS). The change takes effect immediately, no restart needed.

If gladysassistant.local does not open

mDNS is built into macOS, iOS and Windows 10 and later, and works on most home networks. A few setups still block it: some Android versions, guest networks, and routers with client isolation turned on. Gladys also only advertises itself when it runs on the host network, which is what the command above does.

In that case, use the machine's IP address in your browser instead. To find it on your local network, you can use applications like:

Set your own timezone

The command above uses TZ=Europe/Paris. Replace it with your own value (for example America/New_York or America/Toronto) from the timezone list so scenes and schedules run at the right local time.

Frequently asked questions

What systems can I run Gladys with Docker on?

The Docker install works on any system that runs Docker: a mini-PC, a NAS (Synology, Unraid), a Linux server, a Raspberry Pi or a virtual machine. The same single command starts Gladys on all of them.

How do I update Gladys running in Docker?

The easiest way is to run the Watchtower container shown above. It watches for new Gladys images and upgrades your container automatically when a new version is released, so you do not have to update by hand.

Can I run Gladys on a Synology or Unraid NAS?

Yes. As long as your NAS can run Docker containers, you can run Gladys on it with the same command. This is a popular way to self-host Gladys on hardware you already own.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂