Prerequisites
Required
- Docker Engine installed and running (version 20.10+ recommended)
- Access to
/var/run/docker.sock - Root or sudo access to run privileged containers
- API Key from KloudMate Settings
Docker Installation
If Docker is not installed, follow the official Docker installation guide. Verify Docker is running:Quick Installation
Install and run the agent with a single command:Replace
<YOUR_API_KEY> with your actual API key.Installation Process
Download and Execute Installation Script
The script validates Docker installation and environment variables:The installer will:
- Verify Docker is installed and running
- Validate required environment variables
- Optionally prompt for additional directories to monitor
- Pull the latest agent image
- Stop and remove any existing
km-agentcontainer - Start the new container with proper configuration
Configure Additional Log Directories (Optional)
During installation, you’ll be prompted:If you answer These directories will be:
y, you can specify custom directories:- Mounted as read-only volumes into the container
- Added to the filelog receiver configuration
Manual Docker Installation
For environments where you prefer manual control:Pull the Image
Run the Container
With Additional Log Directories
Container Configuration
Environment Variables
| Variable | Required | Description | Default |
|---|---|---|---|
KM_API_KEY | Yes | Authentication key for KloudMate platform | - |
KM_COLLECTOR_ENDPOINT | Yes | OTLP endpoint for data export | - |
FILELOG_PATHS | No | Comma-separated glob patterns for log files | - |
DOCKER_SOCK_PATH | No | Path to Docker socket | /var/run/docker.sock |
Volume Mounts
The container requires these volume mounts for full functionality:| Host Path | Container Path | Mode | Purpose |
|---|---|---|---|
/var/run/docker.sock | /var/run/docker.sock | rw | Docker API access for container metrics |
/var/log | /var/log | rw | System log collection |
/var/lib/docker/containers | /var/lib/docker/containers | ro | Container log files |
/ | /hostfs | ro | Host filesystem access for metrics |
Container Flags
| Flag | Purpose |
|---|---|
--privileged | Required for accessing host-level metrics (CPU, disk, network) |
--pid host | Share host PID namespace for process monitoring |
--network host | Use host networking for accurate network metrics |
--restart always | Auto-restart container on failure or system reboot |
Docker Image Details
Image Repository
Supported Tags
latest- Latest stable releasev1.2.0- Specific version tagdevelop- Development builds (not recommended for production)
Image Layers
The image is built using multi-stage builds:Dockerfile
gcr.io/distroless/static-debian11 (minimal, secure base)
Exposed Ports:
4317- OTLP gRPC receiver4318- OTLP HTTP receiver
Container Management
View Logs
Restart Container
Stop Container
Start Container
Update to Latest Version
Inspect Container
Uninstallation
Automated Uninstall
Use the installation script with theuninstall argument:
- Stop the
km-agentcontainer - Remove the container
- Remove the Docker image
Manual Uninstall
Troubleshooting
Docker Not Installed Error
Permission Denied on Docker Socket
Container Fails to Start
Check logs:- Invalid API key or collector endpoint
- Port conflicts (4317, 4318 already in use)
- Missing required volume mounts
- Insufficient permissions (need
--privileged)
No Metrics Being Collected
Verify mounts:/var/run/docker.sock/→/hostfs/var/lib/docker/containers
Directory Does Not Exist Error
Container Exits Immediately
Check exit code:- Missing required environment variables (
KM_API_KEY,KM_COLLECTOR_ENDPOINT) - Invalid configuration file
- Network connectivity issues
Docker Compose
For Docker Compose deployments:docker-compose.yml
Next Steps
Configure Agent
Customize OpenTelemetry receivers and log collection
Monitor Containers
Learn about Docker container monitoring features
Support
For Docker installation issues:- 📧 Email: [email protected]
- 🐛 GitHub: Report an issue
- 🐳 Docker Hub: Image details