A complete production-ready reverse proxy and observability stack built using Traefik v3, Docker Compose, and Grafanaβs monitoring ecosystem β seamlessly integrating Cloudflare (default) or Namecheap DNS APIs for automated DNS-based SSL certificates via Letβs Encrypt (ACME).
Designed as a DevOps-grade system for managing secure HTTPS routing, metrics, logs, and visualization β all automated, modular, and easy to scale.
This project provides a secure and observable infrastructure platform for your containerized applications:
- Traefik v3 acts as a reverse proxy with automatic SSL, HTTPS redirection, and middleware-based hardening.
- Cloudflare / Namecheap integration enables zero-downtime SSL management via DNS-01 challenges.
- Grafana + Prometheus + Loki provide full observability β metrics, logs, and visualization.
- Node Exporter, Promtail, and cAdvisor collect and expose system and container metrics.
- Grafana Alloy extends observability to remote servers for distributed environments.
- Fully managed with a single, intelligent automation system using
deploy_v2.shandstack.list.
π§ Built and tested on Ubuntu Server 24.04 LTS using Docker Compose, with all services isolated into
frontendandmonitoringnetworks.
One of the most powerful features of TraeSentinel is its modular scaling capability.
The deploy_v2.sh script automatically reads from a stack.list file, which defines all the Docker Compose stacks to be launched.
Each line in stack.list represents a path to a compose file β allowing you to add or remove entire stacks with ease.
Example:
Traefik/docker-compose.yaml
Portainer-Server/docker-compose.yaml
Prometheus/docker-compose.yaml
Grafana/docker-compose.yaml
Loki/docker-compose.yaml
Promtail/docker-compose.yaml
To include a new service (e.g., n8n), simply add:
n8n/docker-compose.yaml
and redeploy with:
sudo ./deploy_v2.sh upThe script will automatically integrate the new service, attach it to the appropriate network, and provision SSL via Traefik β no manual edits required.
π§© The combination of
deploy_v2.shandstack.listmakes TraeSentinel infinitely extensible, suitable for production or personal DevOps labs.
Below are some example views from the live stack (replace with your hosted image links when publishing):
# Clone and enter the repository
git clone https://github.com/Anganba/TraeSentinel.git
cd TraeSentinel
# Create required Docker networks
sudo docker network create frontend
sudo docker network create monitoring
# Copy the example environment file for your DNS provider
# π For Cloudflare:
cp Traefik/.env.cloudflare.example Traefik/.env.cloudflare
# Edit it to include your domain, email, and Cloudflare API token
# π For Namecheap:
cp Traefik/.env.namecheap.example Traefik/.env.namecheap
# Edit it to include your Namecheap API credentials
# Make the deploy script executable
sudo chmod +x deploy_v2.sh
# Deploy using your selected provider
sudo ./deploy_v2.sh up cloudflare
# or
sudo ./deploy_v2.sh up namecheapTraeSentinel automatically provisions HTTPS, secure headers, and DNS-based SSL certificates.
HTTP is globally redirected to HTTPS using Traefikβs native redirection and middleware.
Before starting the stack, make sure your domain DNS records are correctly configured on Cloudflare.
Youβll need to create the following A records under your root domain, all pointing to your serverβs public IP:
| Type | Name | Value | Proxy Status |
|---|---|---|---|
| A | traefik | your_server_ip | DNS only |
| A | mon | your_server_ip | DNS only |
| A | portainer | your_server_ip | DNS only |
| A | prometheus | your_server_ip | DNS only |
| A | loki | your_server_ip | DNS only |
β οΈ Make sure Proxy Status is set to βDNS onlyβ, not proxied (the gray cloud icon).
This allows Letβs Encrypt (ACME) to validate your DNS records via the DNS-01 challenge.
| Component | Role | Access URL |
|---|---|---|
| Traefik Dashboard | Reverse proxy, SSL & routing control | https://traefik.anganba.me |
| Grafana | Visualization and alerting hub | https://mon.anganba.me |
| Prometheus | Metrics collector backend | Internal only |
| Loki | Centralized logs from all containers | Internal only |
| Portainer | Docker management UI | https://portainer.anganba.me |
| Node Exporter | Host-level metrics exporter | Internal only |
| cAdvisor | Container metrics exporter | Internal only |
| Promtail | Log shipper to Loki | Internal only |
| Grafana Alloy | Remote monitoring agent for external targets | Deployed separately |
TraeSentinel ships with secure, hardened defaults:
- Automatic HTTP β HTTPS redirection
secure-headersmiddleware applied globally (HSTS, XSS filter, content-type nosniff)- TLS certificates auto-issued via DNS-01 challenge (Cloudflare or Namecheap)
- Optional Basic Auth middleware for dashboards
Example Traefik security labels:
- "traefik.http.middlewares.secure-headers.headers.STSSeconds=31536000"
- "traefik.http.middlewares.secure-headers.headers.STSIncludeSubdomains=true"
- "traefik.http.middlewares.secure-headers.headers.STSPreload=true"Together they form the backbone of TraeSentinelβs observability layer:
- Prometheus scrapes metrics from Traefik, Node Exporter, cAdvisor, and Alloy.
- Loki aggregates logs collected by Promtail.
- Grafana visualizes metrics and logs through unified dashboards.
Your custom dashboards are located in:
Grafana_Dashboards/
You can import them into Grafana manually:
- Go to Grafana β Dashboards β Import.
- Upload the JSON file from
Grafana_Dashboards/. - Set the data source to Prometheus.
- Save β your tailored monitoring views are ready.
| Exporter | Purpose | Data Source |
|---|---|---|
| Node Exporter | CPU, RAM, Disk, IO, Network metrics | Host system |
| cAdvisor | Container-level stats | Docker runtime |
| Promtail | Log collection | Local Docker & system logs |
These are automatically discovered by Prometheus in the internal monitoring network.
TraeSentinel supports Grafana Alloy, the new unified agent for collecting metrics, logs, and traces from remote servers.
Follow Grafanaβs setup guide:
π Grafana Alloy Installation Guide
- Install Grafana Alloy on your remote host using the link above.
- Configure Alloy to scrape local system metrics and send them to your main TraeSentinel server:
- Point its Prometheus remote_write URL to your Prometheus endpoint (internal or via VPN/tunnel).
- Configure Loki logs endpoint (optional).
- Restart Alloy and confirm that metrics appear in Grafana under your configured dashboard.
β‘ Tip: You can reuse
Grafana_Alloy/config.alloyas a reference configuration for your targets.
sudo ./deploy_v2.sh up # Start the full stack
sudo ./deploy_v2.sh down # Stop all containers
sudo ./deploy_v2.sh restart # Restart everything
sudo ./deploy_v2.sh status # Show container health summarydeploy_v2.sh automatically:
- Detects Docker / Podman Compose
- Loads provider-specific environment files
- Dynamically composes all services listed in
stack.list - Prints colored logs with timestamps
| Resource | Minimum |
|---|---|
| OS | Ubuntu Server 24.04 LTS |
| RAM | 2 GB |
| vCPUs | 2 |
| Disk | 10 GB+ (SSD recommended) |
| Docker | β₯ 27 |
| Docker Compose | β₯ 2.23 |
TraeSentinel/
βββ Traefik/
β βββ docker-compose.yml
β βββ .env.cloudflare.example
β βββ .env.namecheap.example
β βββ data/
β βββ logs/
β
βββ Grafana/
β βββ docker-compose.yml
β βββ Grafana_Dashboards/
β
βββ Grafana_Alloy/
β βββ config.alloy
β
βββ Prometheus/
β βββ docker-compose.yml
β βββ config/
β
βββ Loki/
β βββ config/
β
βββ node-exporter/
βββ cadvisor/
βββ Portainer-Server/
βββ Promtail/
βββ Tempo/
βββ deploy_v2.sh
βββ stack.list
βββ LICENSE
βββ README.md
docker logs traefik | grep acmeEnsure your .env file credentials and domain names are correct.
dig +short mon.anganba.mesudo ./deploy_v2.sh statuschmod 600 Traefik/data/*.json- Change default credentials in Grafana (
admin / changeme). - Protect Traefik and Portainer dashboards using BasicAuth.
- Enable UFW or firewalld rules for
80and443only. - Use Cloudflare Access or reverse VPN for production-grade isolation.
License: MIT
Developed by Anganba Singha
DevOps | Linux | Cloud Infrastructure | Security
π§ anganba.sananu@gmail.com
π Grafana Alloy Docs
β If you find TraeSentinel helpful, star the repo and share your dashboards!





