
Change our Uptime Kuma update steps using Docker Compose
After using more Docker Containers you learn more about them. ๐ค
We are gonna change a few things on our demo machine regarding Docker and the Uptime Kuma Docker Container.
Table of Contents
Add user to the Docker group
With the current setup showing the Docker Container overview and status is not possible with our demo user. All Docker commands need more privileges to be executed which is not ideal. Check out the example below before and after the current user is added to the Docker group.
โจ Enter the command below๐ป
docker container ps๐ Example output ๐
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$ docker container ps
permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.47/containers/json": dial unix /var/run/docker.sock: connect: permission deniedThis command does work using the sudo command:
โจ Enter the command below๐ป
sudo docker container ps๐ Example output ๐
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$ sudo docker container ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5b44c3736861 portainer/portainer-ce:latest "/portainer" 4 months ago Up 29 minutes 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp, 9000/tcp portainer
a4953c7db586 louislam/uptime-kuma:1 "/usr/bin/dumb-init โฆ" 5 months ago Up 29 minutes (healthy) 0.0.0.0:3001->3001/tcp, :::3001->3001/tcp uptime-kumaNow let's add the the current user to the Docker group:
โจ Enter the command below๐ป
sudo usermod -aG docker $USER๐ Example output ๐
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$ sudo usermod -aG docker $USER
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$No error or other notification which is the expected result.
Now first log off and on again to make this change effective
Now execute the command again:
โจ Enter the command below๐ป
docker container ps๐ Example output ๐ after logging off and on again:
techfossa@techfossa-demo-01:~$ docker container ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5b44c3736861 portainer/portainer-ce:latest "/portainer" 4 months ago Up 47 minutes 0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 0.0.0.0:9443->9443/tcp, :::9443->9443/tcp, 9000/tcp portainer
a4953c7db586 louislam/uptime-kuma:1 "/usr/bin/dumb-init โฆ" 5 months ago Up 47 minutes (healthy) 0.0.0.0:3001->3001/tcp, :::3001->3001/tcp uptime-kumaSucces! ๐ฏ
Only use Docker Compose commands to update the Uptime Kuma Container
As you have seen we were working in the /data/dockerdata/uptimekuma directory before.
This directory contains the Uptime Kuma yaml configuration file and the Volume directory to save data.
Navigate to the folder containing the Docker Compose file, in this case /data/dockerdata/uptimekuma
โจ Enter the command below๐ป
cd /data/dockerdata/uptimekumaโจ Enter the command below๐ป
ls๐ Example output ๐
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$ ls
data uptime-kuma.yamlWe are gonna change the name of the file uptime-kuma.yaml to docker-compose.yml using the mv command.
โจ Enter the command below๐ป
sudo mv uptime-kuma.yaml docker-compose.yml๐ Example output ๐
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$ sudo mv uptime-kuma.yaml docker-compose.yml
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$Again: no error or other notification which is the expected result.
Show the directory content again:
โจ Enter the command below๐ป
ls๐ Example output ๐
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$ ls
data docker-compose.ymlBefore updating
Before updating (if there is any update) first check if Uptime Kuma is functioning properly.
Update the Uptima Kuma container
Navigate to the folder containing the Docker Compose file, in this case /data/dockerdata/uptimekuma
โจ Enter the command below๐ป
cd /data/dockerdata/uptimekuma๐ Example output ๐
techfossa@techfossa-demo-01:/$ cd /data/dockerdata/uptimekuma
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$We can now bring down/stop the Uptime Kuma Container
โจ Enter the command below๐ป
docker compose down๐ Example output ๐
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$ docker compose down
[+] Running 1/1
โ Network uptimekuma_default Removed 0.3s
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$Use the docker compose pull command to pull/download a new version of the image file of Uptime Kuma (if available)
โจ Enter the command below๐ป
docker compose pull๐ Example output ๐
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$ docker compose pull
[+] Pulling 13/13
โ uptime-kuma Pulled 10.2s
โ b338562f40a7 Pull complete 1.8s
โ 874bf4d93720 Pull complete 1.9s
โ b16337721583 Pull complete 2.9s
โ 7d955db85b85 Pull complete 3.0s
โ 2c706596bd17 Pull complete 3.0s
โ 88a5c59ed14f Pull complete 3.0s
โ 5a1d0a896c33 Pull complete 3.9s
โ e68c2f25b946 Pull complete 4.2s
โ 2e6c90f010d6 Pull complete 4.2s
โ ff15b10fabb8 Pull complete 4.3s
โ 4f4fb700ef54 Pull complete 4.3s
โ d2a400cc8adb Pull complete 8.5s
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$In my case for some reason the Uptime Kuma Container was not stopped. An extra command was needed to stop/bring down the Container and continue the update ๐คฏ
โจ Enter the command below๐ป
docker container stop uptime-kuma๐ Example output ๐
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$ docker container stop uptime-kuma
uptime-kuma
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$Now remove the current Uptime Kuma container.
โจ Enter the command below๐ป
docker rm uptime-kuma๐ Example output ๐
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$ docker rm uptime-kuma
uptime-kuma
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$Start the Uptime Kuma container in detachedย (-d) mode which means it will keep running after you log off.
โจ Enter the command below๐ป
docker compose up -d๐ Example output ๐
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$ docker compose up -d
[+] Running 2/2
โ Network uptimekuma_default Created 0.1s
โ Container uptime-kuma Started 0.3s
techfossa@techfossa-demo-01:/data/dockerdata/uptimekuma$After refreshing the Uptime Kuma interface the New Update notification is gone and the About section is showing that version 1.23.16 is now active. ๐ฏ




