Overview
Dokploy leverages Docker networking and Traefik to provide flexible, secure networking for your applications. Understanding networking is crucial for multi-container applications, microservices, and production deployments.Automatic Routing
Traefik automatically routes traffic to your services
Service Discovery
DNS-based discovery for inter-service communication
Network Isolation
Isolated networks for security and organization
Network Types
Docker provides several network drivers:- Bridge (Default)
- Overlay (Swarm)
- Host
- None
Default network for standalone containers:
- Isolated from host network
- Containers can communicate by name
- Suitable for single-host deployments
- Port mapping required for external access
Dokploy Network Architecture
Dokploy creates these networks automatically:dokploy-network
The main network for all Dokploy services:- Traefik runs on this network
- Applications attach to this network for routing
- Enables communication between projects
Project Networks
Each project can have isolated networks:Service Communication
Internal Communication
Services in the same network communicate using service names:docker-compose.yml
Cross-Project Communication
Services in different projects can communicate if they share a network:Project A
Project B
Traefik Routing
Traefik is Dokploy’s built-in reverse proxy and load balancer.Automatic Routing
Dokploy automatically configures Traefik labels:Custom Routing Rules
Advanced routing based on:- Host
- Path
- Headers
- Query Parameters
Route by domain:
Multiple Domains
Route multiple domains to one service:Path-Based Routing
Route different paths to different services:Higher priority rules are evaluated first.
Network Security
Internal Networks
Create internal-only networks for sensitive services:Firewall Rules
Use Docker’s built-in firewall (iptables):Network Policies
For advanced control, use Docker’s network policies:Load Balancing
Traefik provides automatic load balancing:Round Robin (Default)
Weighted Load Balancing
Sticky Sessions
Route users to the same backend:Health Checks
Configure health checks for automatic recovery:Custom DNS
Add custom DNS entries:IPv6 Support
Enable IPv6 in Docker daemon:/etc/docker/daemon.json
Debugging Network Issues
Inspect Networks
Test Connectivity
View Traefik Configuration
Access Traefik dashboard:Performance Optimization
Use Host Network for High Performance
Use Host Network for High Performance
For latency-sensitive applications:Trade-offs: No isolation, port conflicts
Enable MTU Optimization
Enable MTU Optimization
Match your network’s MTU:
Use Overlay with IPSec for Security
Use Overlay with IPSec for Security
Encrypt overlay network traffic:
Optimize DNS Resolution
Optimize DNS Resolution
Use custom DNS servers:
Common Networking Patterns
Frontend-Backend Separation
Service Mesh Pattern
Troubleshooting
Container can't reach other containers
Container can't reach other containers
- Verify both containers are on the same network
- Check network exists:
docker network ls - Inspect network:
docker network inspect network_name - Try using IP address instead of hostname
DNS resolution failing
DNS resolution failing
- Check container’s DNS config:
docker exec container cat /etc/resolv.conf - Verify service name is correct
- Restart Docker daemon:
systemctl restart docker - Check for DNS conflicts with host
Traefik not routing traffic
Traefik not routing traffic
- Verify container has correct labels
- Check Traefik logs:
docker logs traefik - Ensure container is on dokploy-network
- Verify domain DNS points to server
- Check firewall rules allow ports 80/443
Network performance issues
Network performance issues
- Check MTU settings
- Monitor network usage:
docker stats - Consider host network mode
- Check for DNS resolution delays
- Verify no packet loss:
ping -c 100 service_name
Next Steps
Domains & Routing
Configure domain routing
Multi-Node
Deploy across multiple servers
Docker Swarm
Swarm networking configuration
Security
Network security best practices