Container Operations
Listing Containers
Dokploy can retrieve containers from both local Docker instances and remote servers:Container Restart
Restart containers with a single API call:Container IDs must match the regex pattern:
^[a-zA-Z0-9.\-_]+$Container Configuration
Inspect detailed container configurations including:- Network settings
- Volume mounts
- Environment variables
- Resource limits
- Port mappings
Application Container Queries
By Application Name
Dokploy supports querying containers by application name with support for different deployment types:Query by App Label
Find containers using Dokploy-specific labels for both standalone and swarm deployments:
Container Types Support
Dokploy automatically detects and manages different container deployment types:Standalone
Individual Docker containers running independently
Docker Compose
Multi-container applications defined in compose files
Docker Swarm
Clustered service deployments across multiple nodes
Security & Permissions
All container operations enforce strict security controls:Authorization Flow
- User requests container operation
- System validates serverId (if provided)
- Server organization is checked against user’s active organization
- SSH key authentication is verified
- Operation is executed via Docker API
Container Monitoring
Dokploy provides real-time container metrics through its monitoring service:- CPU Usage - Percentage and core allocation
- Memory - Usage, limits, and available memory
- Network I/O - Incoming and outgoing traffic
- Block I/O - Disk read/write operations
Container metrics are collected at configurable intervals (default: 60 seconds) and stored in a local SQLite database.
Metrics Collection
The monitoring service uses Docker stats API to collect:Remote Docker Connection
Dokploy connects to remote Docker daemons using SSH:If no serverId is provided, operations default to the local Docker instance.
Best Practices
Container Naming Conventions
Container Naming Conventions
Use consistent naming patterns that include:
- Application name
- Environment (dev/staging/prod)
- Version or deployment ID
myapp-prod-v1-abc123Resource Management
Resource Management
Always set resource limits for containers:
- Memory limits prevent OOM issues
- CPU shares ensure fair resource allocation
- Disk quotas prevent storage exhaustion
Monitoring Configuration
Monitoring Configuration
Configure monitoring to track specific services:
- Include critical application containers
- Exclude development/temporary containers
- Set appropriate refresh rates based on needs
Multi-Server Deployments
Multi-Server Deployments
When managing multiple servers:
- Use consistent SSH key management
- Implement proper network segmentation
- Monitor cross-server dependencies
Troubleshooting
Container Not Found
If a container cannot be found:- Verify the container ID or name is correct
- Check if the container exists on the specified server
- Ensure you have permissions to access the server
Connection Issues
For remote server connection problems:- Verify SSH credentials are valid
- Check network connectivity to the server
- Ensure Docker daemon is running on the remote host
- Confirm firewall rules allow SSH connections
Monitoring Data Missing
If container metrics are not appearing:- Check that the container is included in monitoring configuration
- Verify the monitoring service is running
- Ensure the container is running (stopped containers don’t generate metrics)
- Review monitoring service logs for errors