How to fix Error response from daemon: plugin is in use in Docker

DockerINTERMEDIATEMEDIUMUpdated Dec 6, 2025ยท 141 views

The 'plugin is in use' error occurs when Docker prevents you from disabling or removing a plugin because volumes, networks, or other resources still reference it. Remove the dependent resources first, or use the force flag to override.

Quick fix

Fixes Error response from daemon: plugin is in use

# List all volumes and check their drivers
docker volume ls

# Find volumes using a specific driver (plugin)
docker volume ls --filter driver=PLUGIN_NAME

# List networks and their drivers
docker network ls

# Inspect the plugin to see references
docker plugin inspect PLUGIN_NAME
  1. List resources using the plugin
  2. Remove volumes using the plugin
  3. Remove networks using the plugin
  4. Use the force flag to disable
docker โ€” error
# List all volumes and check their drivers
docker volume ls
# Find volumes using a specific driver (plugin)
docker volume ls --filter driver=PLUGIN_NAME
# List networks and their drivers
docker network ls
# Inspect the plugin to see references
docker plugin inspect PLUGIN_NAME
Error response from daemon: plugin is in use

What this error means

The "plugin is in use" error in Docker appears when you try to disable or remove a Docker plugin (such as a volume driver or network plugin) while Docker resources still depend on it. Docker plugins extend the Docker Engine's functionality. Common plugins include volume drivers (like `rexray/s3fs`, `vieux/sshfs`, `loki` logging driver) and network drivers. When you create volumes or networks using a plugin, Docker maintains a reference to that plugin. Even after you stop all containers using plugin-managed resources, the plugin cannot be disabled or removed until those resources (volumes, networks) are explicitly deleted. In Docker Swarm mode, this becomes more complex because resources may exist across multiple nodes in the cluster, making the plugin appear "in use" even when no local containers reference it. This is a safety mechanism to prevent accidentally breaking containers or losing data by removing plugins that are still needed.

Typical symptoms

  • Running `docker plugin disable <plugin>` returns 'plugin is in use'
  • Running `docker plugin rm <plugin>` fails even after disabling
  • Plugin cannot be disabled despite no containers actively using it
  • `docker plugin ls` shows the plugin as enabled
  • Volumes created by the plugin still exist in `docker volume ls`
  • Docker Swarm volumes using the plugin exist on other cluster nodes
  • Plugin upgrade or reinstallation fails due to existing plugin

Common causes

  1. Volumes created by the plugin still exist (most common)
  2. Networks created by the plugin are still defined
  3. Stopped containers still reference plugin-managed volumes
  4. Docker Swarm volumes exist across the cluster even if not on current node
  5. The plugin is referenced in docker-compose.yml service definitions
  6. Stale references in Docker's internal state after crash or ungraceful shutdown

How to fix "Error response from daemon: plugin is in use"

1List resources using the plugin

First, identify what resources are keeping the plugin in use:

bash
# List all volumes and check their drivers
docker volume ls

# Find volumes using a specific driver (plugin)
docker volume ls --filter driver=PLUGIN_NAME

# List networks and their drivers
docker network ls

# Inspect the plugin to see references
docker plugin inspect PLUGIN_NAME

Replace PLUGIN_NAME with your plugin name (e.g., vieux/sshfs, rexray/s3fs, loki).

Common volume driver plugins include:
- rexray/s3fs - Amazon S3 storage
- vieux/sshfs - SSH file system
- grafana/loki-docker-driver - Loki logging

2Remove volumes using the plugin

Delete any volumes created by the plugin:

bash
# List volumes using the plugin driver
docker volume ls --filter driver=PLUGIN_NAME

# Remove a specific volume
docker volume rm VOLUME_NAME

# Remove multiple volumes at once
docker volume rm volume1 volume2 volume3

# Remove ALL volumes using a specific driver (use with caution)
docker volume ls --filter driver=PLUGIN_NAME -q | xargs docker volume rm

Important: If a volume contains important data, back it up first:

bash
# Create a temporary container to copy data
docker run --rm -v VOLUME_NAME:/source -v $(pwd):/backup alpine \
  tar czf /backup/volume-backup.tar.gz -C /source .

If you get "volume is in use" errors, find and remove dependent containers first:

bash
docker ps -a --filter volume=VOLUME_NAME
docker rm $(docker ps -a -q --filter volume=VOLUME_NAME)
3Remove networks using the plugin

If the plugin is a network driver, remove dependent networks:

bash
# List networks
docker network ls

# Inspect a network to see its driver
docker network inspect NETWORK_NAME | grep Driver

# Remove the network
docker network rm NETWORK_NAME

Note: You cannot remove networks with connected containers. Disconnect or remove containers first:

bash
# Disconnect a container from a network
docker network disconnect NETWORK_NAME CONTAINER_NAME

# Or stop and remove the container
docker stop CONTAINER_NAME && docker rm CONTAINER_NAME
4Use the force flag to disable

Once resources are removed (or if you're certain no critical resources depend on the plugin), use the force flag:

bash
# Disable the plugin with force
docker plugin disable -f PLUGIN_NAME

# Then remove the plugin
docker plugin rm PLUGIN_NAME

The -f (or --force) flag tells Docker to disable the plugin even if it detects references. Use this cautiously as it may affect running containers.

Important: You cannot remove an enabled plugin. Always disable first, then remove:

bash
docker plugin disable PLUGIN_NAME
docker plugin rm PLUGIN_NAME

Or combine with force flags:

bash
docker plugin disable -f PLUGIN_NAME && docker plugin rm PLUGIN_NAME
5Restart the Docker daemon

If the plugin still shows as "in use" after removing all resources, a Docker daemon restart may clear stale references:

bash
# Linux (systemd)
sudo systemctl restart docker

# Linux (service command)
sudo service docker restart

# macOS / Windows
# Restart Docker Desktop from the system tray/menu bar

After restart, try disabling and removing the plugin again:

bash
docker plugin disable PLUGIN_NAME
docker plugin rm PLUGIN_NAME

This works because Docker rebuilds its internal state on startup, clearing any stale references that may have persisted in memory.

6Handle Docker Swarm scenarios

In Docker Swarm mode, volumes may exist across multiple nodes, causing the "in use" error even when no local resources reference the plugin.

Option 1: Remove resources from all nodes

bash
# SSH to each node and remove volumes
ssh node1 "docker volume ls --filter driver=PLUGIN_NAME -q | xargs docker volume rm"
ssh node2 "docker volume ls --filter driver=PLUGIN_NAME -q | xargs docker volume rm"

Option 2: Leave the swarm temporarily

bash
# Leave the swarm (manager nodes need --force)
docker swarm leave --force

# Now disable and remove the plugin
docker plugin disable -f PLUGIN_NAME
docker plugin rm PLUGIN_NAME

# Rejoin the swarm
docker swarm join --token <TOKEN> <MANAGER-IP>:2377

Option 3: Remove swarm services using the plugin

bash
# List services
docker service ls

# Remove services using the plugin's volumes
docker service rm SERVICE_NAME

Advanced notes

### Understanding Docker Plugin Architecture

Docker plugins run as separate processes managed by the Docker daemon. They communicate with Docker via a well-defined API. When you install a plugin, Docker:

1. Pulls the plugin image from a registry
2. Creates a plugin rootfs and config
3. Starts the plugin process
4. Registers the plugin's capabilities (volume driver, network driver, etc.)

The "in use" error occurs because Docker tracks references between plugins and the resources they manage. This tracking happens at the daemon level, not per-container.

### Plugin Types and Their Resources

| Plugin Type | Creates | Common Examples |
|-------------|---------|-----------------|
| Volume Driver | Volumes | rexray/s3fs, vieux/sshfs, convoy |
| Network Driver | Networks | weave, calico, overlay |
| Log Driver | Log configs | loki, splunk, fluentd |
| Authorization | Auth policies | casbin, opa |

### Plugin State Management

Plugins have three key states:
- Installed: Plugin files exist but not running
- Enabled: Plugin is running and available for use
- In Use: Resources depend on the plugin

You can only remove a plugin that is:
1. Disabled (not enabled)
2. Not in use (no resources reference it)

### Troubleshooting Persistent "In Use" Errors

If the plugin remains "in use" after removing all visible resources:

bash
# Check Docker's internal plugin state
cat /var/lib/docker/plugins/*/config.json | jq '.

# List plugin rootfs
ls -la /var/lib/docker/plugins/

# Check for orphaned references in Docker's state
# (Requires Docker to be stopped)
sudo systemctl stop docker
sudo cat /var/lib/docker/network/files/local-kv.db | strings | grep PLUGIN_NAME

### Force Removal as Last Resort

If all else fails, you can manually remove plugin data (Linux only):

bash
# Stop Docker
sudo systemctl stop docker

# Find the plugin ID
PLUGIN_ID=$(docker plugin ls --filter reference=PLUGIN_NAME -q)

# Remove plugin directory
sudo rm -rf /var/lib/docker/plugins/$PLUGIN_ID

# Start Docker
sudo systemctl start docker

Warning: This bypasses Docker's safety checks and may leave orphaned resources.

### Preventing Future Issues

To avoid "plugin in use" errors:

1. Use named volumes explicitly: Track which volumes use which plugins
2. Document plugin dependencies: In your docker-compose.yml or README
3. Clean up before uninstalling: Always remove resources before plugins
4. Use `docker system prune`: Regularly clean up unused resources

bash
# Clean up unused volumes (including plugin-managed)
docker volume prune

# Full system cleanup
docker system prune --volumes

### Logging Plugins (Special Case)

Logging plugins like Loki or Splunk can be tricky because the reference is at the daemon level, not per-volume:

bash
# Check if the logging plugin is set as default
docker info | grep "Logging Driver"

# Containers may reference the plugin in their config
docker inspect CONTAINER | grep LogConfig

To remove a logging plugin:
1. Stop all containers using that log driver
2. Change containers to use a different log driver
3. Then disable and remove the plugin

Frequently asked questions

What does "Error response from daemon: plugin is in use" mean?
The "plugin is in use" error in Docker appears when you try to disable or remove a Docker plugin (such as a volume driver or network plugin) while Docker resources still depend on it. Docker plugins extend the Docker Engine's functionality. Common plugins include volume drivers (like rexray/s3fs, vieux/sshfs, loki logging driver) and network drivers.
How do I fix "Error response from daemon: plugin is in use"?
The 'plugin is in use' error occurs when Docker prevents you from disabling or removing a plugin because volumes, networks, or other resources still reference it. Remove the dependent resources first, or use the force flag to override.
What causes "Error response from daemon: plugin is in use"?
Volumes created by the plugin still exist (most common) Networks created by the plugin are still defined Stopped containers still reference plugin-managed volumes
Is the "Error response from daemon: plugin is in use" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading