Files
selfhosted-apps-docker/gatus
DoTheEvo 8cff3bc4d8 update
2025-08-25 01:01:17 +02:00
..
2025-08-25 01:01:17 +02:00

Gatus in docker

guide-by-example

logo

Purpose & Overview

Uptime monitoring and notifications.

Simple, light, modern uptime monitoring of sites, hosts, ports, DNS records,... with rich notification system.
What makes Gatus different, from the popular Uptime Kuma, is the way one declares what to monitor. Instead of clicking through a web site, filling text inputs, checking checkboxes, marking radio buttons,...
gatus uses a single config file which makes it easy to backup, or fast deploy somewhere, or even automate.
Written in golang, this deployment uses sqlite for database, but can work with postgress or just live in memory.


interface-pic

Files and directory structure

/home/
└── ~/
    └── docker/
        └── gatus/
            ├── 🗁 gatus_config/
            ├── 🗁 gatus_data/
            └── 🗋 compose.yml
  • gatus_config - where to place the config files
  • gatus_data - persistent data, contains sqlite database
  • .env - a file containing environment variables for the compose
  • compose.yml - a docker compose file, telling docker how to run the container

You need to create gatus_config directory with the config.yml and provide the two files - compose and .env

docker compose

Based on the sqlite example.
It's a simple, single container setup.
If using reverse proxy ports: can be changed to expose:, if they are on the same network.

compose.yml

services:
  gatus:
    image: twinproduction/gatus
    container_name: gatus
    hostname: gatus
    restart: unless-stopped
    env_file: .env
    ports:
      - "8080"
    volumes:
      - ./gatus_config:/config
      - ./gatus_data:/data/

networks:
  default:
    name: $DOCKER_MY_NETWORK
    external: true

.env

# GENERAL
TZ=Europe/Bratislava
DOCKER_MY_NETWORK=caddy_net

Reverse proxy

Caddy v2 is used, details here.

Caddyfile

gatus.{$MY_DOMAIN} {
  reverse_proxy gatus:8080
}

Configuration

Here only single config file is used, but one can use several.
Theres an extenstive documentation and github readmes.

Example config.yaml where ntfy is used for push notifications.

  • note - changes to the config do not require container up/down
ui:
  ui.dark-mode: "true"

storage:
  type: sqlite
  path: /data/data.db

alerting:
  ntfy:
    topic: "gatus"
    url: "https://ntfy.example.com"
    click: "https://gatus.example.com"
    default-alert:
      send-on-resolved: true
      failure-threshold: 2
      success-threshold: 1

endpoints:
  - name: test1
    url: "https://test1.lalala/"
    interval: 5m
    conditions:
      - "[STATUS] == 200"
      - "[RESPONSE_TIME] < 500"
    alerts:
       - type: ntfy

  - name: test2
    group: blabla
    url: "https://test2.lalala/"
    interval: 5m
    conditions:
      - "[STATUS] == 200"
      - "[RESPONSE_TIME] < 500"
    alerts:
       - type: ntfy

Manual image update:

  • docker-compose pull
  • docker-compose up -d
  • docker image prune

Backup and restore

Backup

should be just backup of uptimekuma_data directory

not tested yet

Restore