How to fix Error response from daemon: This node is not a swarm manager in Docker

DockerBEGINNERLOWUpdated Dec 6, 2025ยท 263 views

This error occurs when you run a swarm management command on a Docker node that hasn't been initialized as a swarm manager. The fix is to either initialize a new swarm with `docker swarm init` or join an existing swarm as a manager node.

Quick fix

Fixes Error response from daemon: This node is not a swarm manager

docker info --format '{{.Swarm.LocalNodeState}}'
  1. Check current swarm status
  2. Initialize a new swarm (if not in any swarm)
  3. Join an existing swarm as a manager
  4. Promote a worker to manager
docker โ€” error
docker info --format '{{.Swarm.LocalNodeState}}'
Error response from daemon: This node is not a swarm manager

What this error means

Docker Swarm is Docker's native clustering and orchestration solution. In a swarm, nodes can have one of two roles: **manager** or **worker**. Manager nodes handle cluster management tasks like maintaining cluster state, scheduling services, and serving the swarm mode HTTP API. Worker nodes execute containers but cannot perform management operations. When you run swarm management commands like `docker node ls`, `docker service ls`, `docker stack deploy`, or `docker secret ls`, these commands must be executed on a manager node. If the Docker daemon you're connected to is either not part of any swarm or is only a worker node, you'll see this "This node is not a swarm manager" error. This commonly happens in these scenarios: - Running swarm commands on a fresh Docker installation that was never initialized as a swarm - Attempting to use overlay networks without swarm mode (overlay networks require swarm) - Running management commands while connected to a worker node instead of a manager - After a Mac/Windows system wakes from sleep (Docker Desktop may lose swarm state) - Trying to use Docker secrets outside of swarm mode (secrets require swarm)

Typical symptoms

  • Docker swarm commands fail with 'This node is not a swarm manager' error
  • Cannot list services with `docker service ls`
  • Cannot deploy stacks with `docker stack deploy`
  • Cannot create overlay networks
  • Cannot use Docker secrets or configs
  • `docker info` shows 'Swarm: inactive'
  • After Mac/Windows sleep, previously working swarm commands fail

Common causes

  1. Docker daemon is not initialized as part of any swarm (most common)
  2. Running swarm management commands on a worker node instead of a manager
  3. Docker Desktop lost swarm state after system sleep or restart
  4. Trying to use overlay networks without swarm mode enabled
  5. Attempting to use Docker secrets without swarm (secrets require swarm)
  6. Node was removed from swarm or swarm was forcefully left
  7. Swarm manager lost quorum and is no longer functioning as manager

How to fix "Error response from daemon: This node is not a swarm manager"

1Check current swarm status

First, check if your Docker node is part of a swarm and what its role is:

bash
docker info --format '{{.Swarm.LocalNodeState}}'

Possible outputs:
- inactive - Not part of any swarm
- active - Part of a swarm (check role next)
- pending - In process of joining a swarm
- locked - Swarm is locked, needs to be unlocked

If active, check if you're a manager:

bash
docker info --format '{{.Swarm.ControlAvailable}}'

Returns true for managers, false for workers.

2Initialize a new swarm (if not in any swarm)

If docker info shows Swarm: inactive, initialize a new swarm:

bash
docker swarm init

This creates a new single-node swarm with your current node as the manager.

If you have multiple network interfaces, specify which IP to advertise:

bash
docker swarm init --advertise-addr <YOUR_IP>

After initialization, your node becomes both a manager and a worker by default.

3Join an existing swarm as a manager

If a swarm already exists and you need to join it as a manager, get the join token from an existing manager:

On an existing manager node:

bash
docker swarm join-token manager

This outputs a command like:

bash
docker swarm join --token SWMTKN-1-xxx <MANAGER_IP>:2377

On the node you want to add:

Run the command output from above. Your node will join as a manager.

4Promote a worker to manager

If you're on a manager node and need to promote a worker:

bash
# List all nodes
docker node ls

# Promote a worker to manager
docker node promote <NODE_ID_OR_HOSTNAME>

You can also demote a manager to worker if needed:

bash
docker node demote <NODE_ID_OR_HOSTNAME>

Note: Always maintain an odd number of managers for proper quorum.

5Fix Docker Desktop swarm issues (Mac/Windows)

If swarm stopped working after system sleep or restart on Docker Desktop:

Option 1: Restart Docker Desktop
- Right-click the Docker icon in the system tray
- Select "Restart"

Option 2: Leave and reinitialize swarm

bash
docker swarm leave --force
docker swarm init

Option 3: Reset Docker Desktop to factory defaults
- Open Docker Desktop Settings
- Go to "Troubleshoot" or "Reset"
- Click "Reset to factory defaults" (this removes all containers, images, and volumes)

6Verify the fix

Confirm swarm is working:

bash
# Check swarm status
docker info | grep -A 5 "Swarm"

# List nodes (should work without error)
docker node ls

# Test service creation
docker service create --name test-nginx --replicas 1 nginx
docker service ls
docker service rm test-nginx

If all commands succeed, swarm mode is working correctly.

Advanced notes

### Using Overlay Networks Without Swarm

If you only need overlay networks for container communication and don't need full swarm orchestration, you still need to initialize swarm mode, but you can do so as a single-node swarm:

bash
docker swarm init

# Now you can create overlay networks
docker network create --driver overlay --attachable my-overlay

The --attachable flag allows standalone containers (not just swarm services) to connect to the overlay network.

### Using Secrets Without Swarm

Docker secrets require swarm mode. If you need secrets on a single node without full swarm orchestration, alternatives include:

1. Initialize a single-node swarm (simplest)
2. Use Docker Compose with secrets from files
3. Use environment variables or mounted config files (less secure)

### Swarm Manager Quorum

Swarm uses the Raft consensus algorithm. For a swarm with N managers:
- Tolerates (N-1)/2 manager failures
- 3 managers: tolerates 1 failure
- 5 managers: tolerates 2 failures
- 7 managers: tolerates 3 failures

If quorum is lost, you cannot manage the swarm until it's restored. You may see "This node is not a swarm manager" even on a manager node if the cluster has lost quorum.

### Recovering from Lost Quorum

If your swarm lost quorum:

bash
# Force a new cluster with this node as the only manager
docker swarm init --force-new-cluster

This recovers the swarm state from the current node. Other managers will need to rejoin.

### Ports Required for Swarm

Ensure these ports are open between swarm nodes:
- 2377/tcp: Cluster management communications
- 7946/tcp+udp: Container network discovery
- 4789/udp: Overlay network traffic (VXLAN)

Frequently asked questions

What does "Error response from daemon: This node is not a swarm manager" mean?
Docker Swarm is Docker's native clustering and orchestration solution. In a swarm, nodes can have one of two roles: manager or worker. Manager nodes handle cluster management tasks like maintaining cluster state, scheduling services, and serving the swarm mode HTTP API.
How do I fix "Error response from daemon: This node is not a swarm manager"?
This error occurs when you run a swarm management command on a Docker node that hasn't been initialized as a swarm manager. The fix is to either initialize a new swarm with docker swarm init or join an existing swarm as a manager node.
What causes "Error response from daemon: This node is not a swarm manager"?
Docker daemon is not initialized as part of any swarm (most common) Running swarm management commands on a worker node instead of a manager Docker Desktop lost swarm state after system sleep or restart
Is the "Error response from daemon: This node is not a swarm manager" error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading