Get Swarm Nodes
Query Parameters
The ID of the server to query. If not provided, queries the local server’s swarm.
Response
Returns an array of swarm node objects with detailed information including:- Node ID and hostname
- Role (manager or worker)
- Availability status
- Node state and version
- Resource information (CPU, memory)
- Labels and platform details
Get Node Information
Query Parameters
The ID of the swarm node to retrieve information for.
The ID of the server where the swarm is running.
Response
Returns detailed node information including:- Full node specification
- Current status and state
- Manager status (if applicable)
- Resource allocation
- Platform and engine details
- Labels and constraints
Get Node Applications
Query Parameters
The ID of the server to query.
Response
Returns information about applications (services and stacks) running in the swarm cluster, including:- Service names and IDs
- Replica counts and status
- Node placement
- Network configuration
- Resource allocation
Understanding Docker Swarm in Dokploy
Docker Swarm mode enables you to create and manage a cluster of Docker nodes, providing:High Availability
- Multiple manager nodes for fault tolerance
- Automatic leader election
- Service health monitoring and automatic recovery
Load Balancing
- Built-in ingress load balancing
- Service discovery across the cluster
- Automatic request routing
Scaling
- Easy horizontal scaling of services
- Rolling updates with zero downtime
- Resource constraints and reservations
Security
- Mutual TLS authentication between nodes
- Encrypted control plane communication
- Secret management for sensitive data
Node Roles
Manager Nodes- Orchestrate and manage the cluster
- Maintain cluster state
- Schedule services
- Should have odd number (3, 5, 7) for quorum
- Execute container workloads
- Receive tasks from managers
- Report status back to managers
Common Swarm Operations
Checking Cluster Health
- List all nodes to verify cluster membership
- Check node info for each manager to ensure reachability
- Review applications to confirm services are running
Service Distribution
Swarm automatically distributes service replicas across available nodes based on:- Node availability and state
- Resource requirements
- Placement constraints
- Spread preferences