Deploying Gatus
Introduction
Gatus is a developer-oriented health dashboard that monitors your services using HTTP, ICMP, TCP, and DNS queries. It evaluates the results using configurable conditions on response values like status codes, response times, certificate expiration, and response body content. Each health check can be paired with alerting via popular platforms like Slack, PagerDuty, Discord, and Twilio.
Built with Go, Gatus is lightweight, fast, and highly configurable through YAML configuration files. The modern dashboard provides real-time visibility into service health while supporting advanced features like incident management and uptime badges.
Key highlights of Gatus:
- Multiple Protocol Support: Monitor services using HTTP, HTTPS, TCP, DNS, and ICMP checks
- Flexible Conditions: Define custom conditions based on status codes, response times, body content, and more
- Rich Alerting: Integrate with Slack, Discord, PagerDuty, Twilio, email, and many more notification services
- SSL Monitoring: Track certificate expiration and receive alerts before certificates expire
- Incident Management: Built-in incident tracking and management capabilities
- Status Badges: Generate embeddable uptime badges for your README files
- External Endpoints: Define endpoints as external to track third-party service health
- Persistent History: Store health check history for trend analysis
- Developer-Friendly: Configuration-as-code approach with YAML
- Open Source: Licensed under Apache 2.0
This guide walks through deploying Gatus on Klutch.sh using Docker, configuring health checks for your services, and setting up alerting for production use.
Why Deploy Gatus on Klutch.sh
Deploying Gatus on Klutch.sh provides several advantages for monitoring your infrastructure:
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Gatus without complex orchestration or manual server configuration. Push to GitHub, and your status page deploys automatically.
Persistent Storage: Attach persistent volumes for your health check history and database. Your monitoring data survives container restarts and redeployments.
HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure access to your status dashboard from anywhere.
GitHub Integration: Connect your configuration repository directly from GitHub. Updates to your monitoring configuration trigger automatic redeployments.
Scalable Resources: Allocate CPU and memory based on the number of services you’re monitoring. Start small and scale up as needed.
Environment Variable Management: Securely store sensitive configuration like alerting credentials through Klutch.sh’s environment variable system.
Custom Domains: Assign a custom domain to your Gatus instance for a branded status page.
Always-On Monitoring: Your health checks run 24/7 without managing your own hardware or dealing with uptime concerns.
Prerequisites
Before deploying Gatus on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Gatus configuration
- Basic familiarity with Docker and containerization concepts
- (Optional) Alerting service credentials (Slack, Discord, PagerDuty, etc.)
- (Optional) A custom domain for your status page
Understanding Gatus Architecture
Gatus is built with simplicity and efficiency in mind:
Go Backend: The core application is written in Go, providing low resource consumption and fast execution of health checks.
YAML Configuration: All monitoring endpoints and alerting rules are defined in YAML configuration files, enabling version control and infrastructure-as-code practices.
SQLite/PostgreSQL Storage: Health check history is stored in SQLite (default) or PostgreSQL for persistent data retention.
HTTP Dashboard: A modern web interface displays service health, uptime history, and incident status.
Concurrent Checking: Health checks run concurrently based on configured intervals, with intelligent scheduling to prevent resource exhaustion.
Preparing Your Repository
To deploy Gatus on Klutch.sh, create a GitHub repository containing your Dockerfile and configuration.
Repository Structure
gatus-deploy/├── Dockerfile├── config/│ └── config.yaml├── README.md└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM twinproduction/gatus:latest
# Copy configuration fileCOPY config/config.yaml /config/config.yaml
# Set timezoneENV TZ=${TZ:-UTC}
# Expose the web interface portEXPOSE 8080
# The base image includes the default entrypointCreating the Configuration File
Create a config/config.yaml file with your monitoring configuration:
storage: type: sqlite path: /data/data.db
ui: title: "Service Status" header: "Service Health Dashboard"
endpoints: - name: Website group: core url: "https://example.com" interval: 60s conditions: - "[STATUS] == 200" - "[RESPONSE_TIME] < 1000"
- name: API group: core url: "https://api.example.com/health" interval: 30s conditions: - "[STATUS] == 200" - "[BODY].status == 'healthy'"
- name: Database group: infrastructure url: "tcp://db.example.com:5432" interval: 60s conditions: - "[CONNECTED] == true"
- name: DNS group: infrastructure url: "dns://example.com@1.1.1.1" interval: 300s conditions: - "[DNS_RCODE] == NOERROR"Advanced Configuration with Alerting
For production deployments with alerting:
storage: type: sqlite path: /data/data.db
ui: title: "Production Status" header: "System Health Dashboard" logo: "https://example.com/logo.png"
alerting: slack: webhook-url: "${SLACK_WEBHOOK_URL}" default-alert: enabled: true failure-threshold: 3 success-threshold: 2 send-on-resolved: true
discord: webhook-url: "${DISCORD_WEBHOOK_URL}" default-alert: enabled: true failure-threshold: 3 success-threshold: 2
pagerduty: integration-key: "${PAGERDUTY_INTEGRATION_KEY}" default-alert: enabled: true failure-threshold: 3 send-on-resolved: true
endpoints: - name: Production Website group: production url: "https://example.com" interval: 30s conditions: - "[STATUS] == 200" - "[RESPONSE_TIME] < 2000" - "[CERTIFICATE_EXPIRATION] > 720h" alerts: - type: slack - type: pagerduty
- name: API Gateway group: production url: "https://api.example.com/v1/health" interval: 15s conditions: - "[STATUS] == 200" - "[BODY].status == 'ok'" - "[RESPONSE_TIME] < 500" alerts: - type: slack failure-threshold: 2 - type: pagerduty failure-threshold: 5
- name: Staging Environment group: staging url: "https://staging.example.com" interval: 60s conditions: - "[STATUS] == 200" alerts: - type: discordCreating the .dockerignore File
Create a .dockerignore file:
.git.github*.mdREADME.mdLICENSE.gitignore*.log.DS_Store.env.env.localEnvironment Variables Reference
Gatus supports environment variable substitution in configuration:
| Variable | Required | Default | Description |
|---|---|---|---|
TZ | No | UTC | Container timezone |
GATUS_CONFIG_PATH | No | /config/config.yaml | Path to configuration file |
SLACK_WEBHOOK_URL | Conditional | - | Slack webhook for alerts |
DISCORD_WEBHOOK_URL | Conditional | - | Discord webhook for alerts |
PAGERDUTY_INTEGRATION_KEY | Conditional | - | PagerDuty integration key |
PUSHOVER_TOKEN | Conditional | - | Pushover application token |
TWILIO_ACCOUNT_SID | Conditional | - | Twilio account SID |
Deploying Gatus on Klutch.sh
Once your repository is prepared, follow these steps to deploy Gatus:
- Slack: Create an incoming webhook in your workspace
- Discord: Create a webhook in your channel settings
- PagerDuty: Create an integration and get the key
- Select HTTP as the traffic type
- Set the internal port to 8080 (Gatus’s default port)
- Detect your Dockerfile automatically
- Build the container image
- Attach the persistent volumes
- Start the Gatus container
- Provision an HTTPS certificate
Prepare Your Configuration
Review and customize your config.yaml with the endpoints you want to monitor. Ensure all URLs are accessible from Klutch.sh’s infrastructure.
Set Up Alerting Credentials
If using alerting, obtain the necessary credentials:
Push Your Repository to GitHub
Initialize your repository and push to GitHub:
git initgit add Dockerfile config/ .dockerignore README.mdgit commit -m "Initial Gatus deployment configuration"git remote add origin https://github.com/yourusername/gatus-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “gatus” or “status-page”.
Create a New App
Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Gatus Dockerfile.
Configure HTTP Traffic
Gatus serves its web interface over HTTP. In the deployment settings:
Set Environment Variables
In the environment variables section, add your alerting credentials:
| Variable | Value |
|---|---|
TZ | Your timezone (e.g., America/New_York) |
SLACK_WEBHOOK_URL | Your Slack webhook URL (if using) |
DISCORD_WEBHOOK_URL | Your Discord webhook URL (if using) |
PAGERDUTY_INTEGRATION_KEY | Your PagerDuty key (if using) |
Attach Persistent Volumes
Persistent storage preserves your health check history. Add the following volumes:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/data | 1 GB | SQLite database and health check history |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Access Gatus
Once deployment completes, access your Gatus dashboard at https://your-app-name.klutch.sh. Your configured endpoints will begin health checks immediately.
Configuring Health Checks
HTTP Endpoints
Monitor web services and APIs:
endpoints: - name: Website url: "https://example.com" interval: 60s conditions: - "[STATUS] == 200" - "[RESPONSE_TIME] < 2000" - "[BODY] contains 'Welcome'"TCP Endpoints
Monitor database and service ports:
endpoints: - name: PostgreSQL url: "tcp://db.example.com:5432" interval: 30s conditions: - "[CONNECTED] == true"DNS Endpoints
Monitor DNS resolution:
endpoints: - name: DNS Resolution url: "dns://example.com@8.8.8.8" interval: 300s conditions: - "[DNS_RCODE] == NOERROR"SSL Certificate Monitoring
Monitor certificate expiration:
endpoints: - name: Website SSL url: "https://example.com" interval: 3600s conditions: - "[CERTIFICATE_EXPIRATION] > 720h" # 30 daysConfiguring Alerts
Slack Alerting
alerting: slack: webhook-url: "${SLACK_WEBHOOK_URL}" default-alert: enabled: true failure-threshold: 3 success-threshold: 2 send-on-resolved: trueDiscord Alerting
alerting: discord: webhook-url: "${DISCORD_WEBHOOK_URL}" default-alert: enabled: true failure-threshold: 3PagerDuty Alerting
alerting: pagerduty: integration-key: "${PAGERDUTY_INTEGRATION_KEY}" default-alert: enabled: true failure-threshold: 5 send-on-resolved: trueEmail Alerting
alerting: email: from: "gatus@example.com" host: "smtp.example.com" port: 587 username: "${SMTP_USERNAME}" password: "${SMTP_PASSWORD}" to: "oncall@example.com" default-alert: enabled: true failure-threshold: 3Advanced Features
Endpoint Groups
Organize endpoints into logical groups:
endpoints: - name: API group: backend url: "https://api.example.com" ...
- name: Website group: frontend url: "https://example.com" ...Uptime Badges
Generate badges for your README:
External Endpoints
Mark third-party services as external:
endpoints: - name: GitHub group: external url: "https://api.github.com" interval: 60s external: true conditions: - "[STATUS] == 200"Production Best Practices
Security Recommendations
- Secure Webhooks: Keep alerting webhook URLs confidential
- HTTPS Only: Always use HTTPS for monitored endpoints
- Access Control: Consider adding authentication to your status page
- Credential Rotation: Regularly rotate alerting credentials
Monitoring Strategy
- Critical Services: Check frequently (15-30 seconds)
- Standard Services: Check regularly (1-5 minutes)
- Infrastructure: Check periodically (5-15 minutes)
- SSL Certificates: Check hourly
Alert Tuning
- Failure Threshold: Prevent alert fatigue with appropriate thresholds
- Success Threshold: Require multiple successes before resolving
- Escalation: Use different alert types for different severity levels
Troubleshooting Common Issues
Endpoints Always Failing
Solutions:
- Verify endpoint URLs are correct
- Check that endpoints are accessible from Klutch.sh
- Review condition syntax
- Check for firewall or network issues
Alerts Not Sending
Solutions:
- Verify alerting credentials
- Check webhook URLs are correct
- Ensure environment variables are set
- Review Gatus logs for errors
Dashboard Not Loading
Solutions:
- Verify container is running
- Check port configuration
- Review logs for startup errors
Additional Resources
- Gatus GitHub Repository
- Gatus Documentation
- Gatus Docker Hub
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying Gatus on Klutch.sh gives you a powerful, developer-oriented status page with automatic builds, persistent storage, and secure HTTPS access. The combination of Gatus’s flexible configuration and Klutch.sh’s deployment simplicity means you can have comprehensive monitoring running in minutes.
With support for multiple protocols, rich alerting integrations, and a clean dashboard interface, Gatus provides everything you need to monitor your infrastructure. Whether you’re tracking a few services or monitoring an entire platform, Gatus on Klutch.sh delivers reliable health monitoring without the operational overhead.