Dokploy includes a built-in monitoring service written in Go that collects system and container metrics in real-time.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dokploy/dokploy/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The monitoring service provides:Server Metrics
CPU, memory, disk, and network statistics for your servers
Container Metrics
Resource usage for individual Docker containers and services
Alerting
Threshold-based notifications via webhook callbacks
Architecture
The monitoring stack consists of:- Go Service: Lightweight metrics collector (dokploy/monitoring)
- SQLite Database: Local storage for metrics data
- HTTP API: RESTful endpoints for querying metrics
- Webhook Integration: Alert delivery to Dokploy control plane
Installation
Monitoring is automatically configured during server setup:The monitoring service uses host networking mode to accurately collect system metrics.
Configuration
Metrics Configuration
Configure monitoring via the server’smetricsConfig object:
Configuration Options
- Server Metrics
- Container Metrics
| Option | Type | Description |
|---|---|---|
type | string | Server type: “Remote” or “Dokploy” |
refreshRate | number | Collection interval in seconds |
retentionDays | number | Days to retain metrics |
port | number | HTTP API port (default: 3001) |
token | string | Authentication token |
urlCallback | string | Webhook URL for alerts |
cronJob | string | Cleanup schedule (cron format) |
thresholds.cpu | number | CPU alert threshold (0-100%) |
thresholds.memory | number | Memory alert threshold (0-100%) |
Setting a threshold to 0 disables alerting for that metric.
Server Metrics
Collected Metrics
The monitoring service collects comprehensive system information:Example Response
Querying Server Metrics
Retrieve metrics via the API:Container Metrics
Supported Container Types
The monitoring service tracks all Docker container types:- Standalone Containers: Individual Docker containers
- Docker Compose: Multi-container applications
- Docker Swarm Stacks: Clustered service deployments
Collected Metrics
Querying Container Metrics
The
appName parameter is required. Without it, an empty array is returned.Service Filtering
Include Services
Specify which containers to monitor:Exclude Services
Exclude specific containers:Alerting
Threshold Configuration
Set alert thresholds for CPU and memory:Alert Payload
When thresholds are exceeded, alerts are sent to the callback URL:Example Alert
Webhook Delivery
Alerts are sent via HTTP POST to the configured callback URL:Data Retention
Automatic Cleanup
Metrics are automatically deleted based on retention policy:- Runs on configured cron schedule
- Deletes metrics older than
retentionDays - Maintains database size
- Logs cleanup operations
Manual Cleanup
Metrics are stored in SQLite:API Endpoints
Health Check
Verify monitoring service is running:The health endpoint does not require authentication.
Get Server Metrics
limit: Number of metrics or “all” (default: 50)
Get Container Metrics
appName: Container/service name (required)limit: Number of metrics or “all” (default: 50)
Performance Considerations
Resource Usage
The monitoring service is designed to be lightweight:- Memory: ~50-100MB typical usage
- CPU: Minimal impact (metrics collection runs periodically)
- Disk: SQLite database grows with retention period
- Network: Negligible (local collection only)
Refresh Rates
Choose appropriate collection intervals:| Interval | Use Case | Impact |
|---|---|---|
| 15-30s | High-frequency monitoring | Higher resource usage |
| 60s | Standard monitoring | Balanced |
| 300s | Low-frequency checks | Minimal overhead |
Best Practices
Metric Collection
Metric Collection
- Use 30-60 second refresh rates for most use cases
- Monitor only critical containers to reduce overhead
- Set appropriate retention periods (7-30 days)
- Configure cleanup to run during off-peak hours
Alerting
Alerting
- Set realistic thresholds (80-85% for CPU, 85-90% for memory)
- Test webhook endpoints before enabling
- Monitor alert frequency to avoid spam
- Document alert response procedures
Data Management
Data Management
- Backup monitoring database regularly
- Monitor database size growth
- Adjust retention based on storage capacity
- Export historical data before cleanup
Security
Security
- Use strong random tokens
- Rotate tokens periodically
- Secure webhook endpoints with authentication
- Restrict monitoring API access by IP
Troubleshooting
No Metrics Collected
Problem: Monitoring service not collecting data Solutions:- Check container is running:
docker ps | grep monitoring - Review container logs:
docker logs dokploy-monitoring - Verify configuration is valid JSON
- Ensure Docker socket is mounted
- Check file permissions on monitoring.db
Container Metrics Missing
Problem: Specific containers not appearing in metrics Solutions:- Verify container is in
includelist - Check container is not in
excludelist - Ensure container is running
- Validate container name matches exactly
- Check monitoring service logs
Alerts Not Sending
Problem: Threshold exceeded but no alerts received Solutions:- Verify threshold is set (not 0)
- Check callback URL is accessible
- Test webhook endpoint manually
- Review monitoring service logs for errors
- Ensure token is correct
- Verify server can reach callback URL
High Database Size
Problem: monitoring.db consuming too much space Solutions:- Reduce retention days
- Increase cleanup frequency
- Manually vacuum database:
sqlite3 monitoring.db "VACUUM;" - Delete old metrics
- Consider exporting and archiving data
Authentication Errors
Problem: API requests return 401/403 Solutions:- Verify token matches configuration
- Check Authorization header format:
Bearer <token> - Ensure token hasn’t been rotated
- Review middleware logs
- Test with health endpoint first (no auth required)