Pushing Notifications Using Gotify
Gotify can be used to send push notifications to your smartphone. In this guide I'll show you how to set it up.
Gotify is a server-client application which enables apps to send push notifications. As not all services want to write their own app to handle push notifications, they can send API calls to Gotify. Gotify will then push those notifications to your device.
This application can be used by Uptime Kuma, which I've set up in this post, to send notifications when something is down.
Composed
version: "3"
networks:
default:
external:
name: ${NETWORK}
services:
gotify-app:
image: ghcr.io/gotify/server:latest
volumes:
- ${DATADIR}/gotify:/app/data
restart: always
environment:
GOTIFY_DEFAULTUSER_NAME: ${ADM_USR}
GOTIFY_DEFAULTUSER_PASS: ${ADM_PWD}
labels:
traefik.enable: true
traefik.http.routers.gotify.rule: Host(`${APP_URL}`)
traefik.http.services.gotify.loadbalancer.server.port: 80
As you can see, the setup isn't that difficult. We use the same network as our Traefik instance is running on so we don't have to expose ports. I've set this up in my previous post.
I advise creating an admin account using the GOTIFY_DEFAULTUSER_NAME
and GOTIFY_DEFAULTUSER_PASS
environment variables and then create personal accounts using the interface.
The volume will be used to store are configuration.
Our .env file will look something like this:
NETWORK=traefik
DATADIR=./data
ADM_USR=admin
ADM_PWD=changeme
APP_URL=changeme.krokantekrab.be
We can now launch the service using docker-compose up -d
. If Traefik is running correctly, you can now surf to the APP_URL
. If not, you'll have to open up a port in your compose file and connect to it using the ip of your host. Or set up your own reverse proxy.