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 \
gladysassistant/gladys:v4
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 volumesTZ=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
You can access Gladys by entering the machine's IP address in your browser.
Note: You must be on the same network as the machine!
To find your machine's IP address on your local network, you can use applications like:
- Network Scanner on Android
- iNet - Network Scanner on iOS
:::tip 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.