Last updated

Mailcow

Monitor Mailcow with Prometheus

Monitor Mailcow container health, mail queues, and spam stats with Prometheus.

Contents

  1. Enable Prometheus Metrics in Mailcow
  2. Add Prometheus Scrape Config
  3. Install Grafana (Docker)
  4. Key Metrics to Watch
  5. Set Up Alerts

Set up Prometheus and Grafana to monitor your Mailcow server health and mail metrics.

Enable Prometheus Metrics in Mailcow

sudo nano /opt/mailcow-dockerized/mailcow.conf
# Set:
WATCHDOG_VERBOSE=y

Mailcow’s watchdog-mailcow container exposes metrics on port 9099 by default.

Add Prometheus Scrape Config

# prometheus.yml
scrape_configs:
  - job_name: 'mailcow'
    static_configs:
      - targets: ['your-mail-server-ip:9099']
    metrics_path: /metrics

Install Grafana (Docker)

docker run -d   --name grafana   -p 3000:3000   -e GF_SECURITY_ADMIN_PASSWORD=yourpassword   grafana/grafana-oss:latest

Key Metrics to Watch

  • mailcow_container_up, container health per service
  • mailcow_postfix_queue_size, mail queue depth
  • mailcow_rspamd_spam_count, spam caught per hour
  • System-level: CPU, memory, disk I/O via node_exporter

Set Up Alerts

In Grafana, create alert rules for queue depth > 100, any container down, or disk usage > 80%. Configure notification channels (email, Slack, PagerDuty) under Alerting → Contact Points.

FAQ

What should I monitor on a mail server?

Disk space, container restarts, the mail queue, memory and certificate expiry.

Do exporters need to be public?

No. Keep them on a private network or VPN, or allow only your Prometheus server's IP.