Docker Core
A container claims the requested human name, and names must stay unique.
container-name-already-in-useReviewed for reference consistency: August 11, 2026
A container claims the requested human name, and names must stay unique.
What container-name-already-in-use Means
The container-name-already-in-use error on the Docker Core indicates a container claims the requested human name, and names must stay unique.. This typically occurs due to the previous container with that name still exists in stopped state.
Container names are unique across the daemon. Creating a new container with a name matching any existing container, running or stopped, is rejected with a conflict message that echoes the holder's ID. Auto-generated names avoid this by construction; explicit names collide on reuse.
How to fix container-name-already-in-use
General informational guidance, not professional advice. Commands can affect your system or data — back up first and proceed at your own risk. FixerCode is an independent reference, not affiliated with any vendor mentioned.
Find the container holding the name
Filtering the all-containers listing by name shows the holder and whether it is running or exited.
docker ps -a --filter name=webCompare creation times of the contenders
The inspect format prints the holder's creation timestamp, which settles which container is the stale claim.
docker inspect --format '{{.Name}} created {{.Created}}' <container>
Technical Background
Names exist so humans and networks can address containers deterministically, which is why the registry of names is strict: one name, one container, regardless of state.
The conflict is resolvable in two directions: remove or rename the holder, or pick a different name. Neither choice touches the holder's filesystem, since removal is the destructive operation and the conflict itself changed nothing.
Common Causes
- The previous container with that name still exists in stopped state
- A concurrent job created the same name moments earlier
- A compose project kept its containers from a prior invocation
Typical Scenarios
- Re-running a named docker run after the previous container was stopped, not removed
- Compose up against a service whose container persisted from an earlier run
- Two pipeline jobs racing to claim the same fixed container name
What to Know
The error embeds the existing holder's ID, making it direct to compare creation times of the two containers and decide which one is stale before any removal decision.
Frequently Asked Questions
Common questions about Docker container-name-already-in-use error
They do. Only removal frees a name; a stopped container keeps it exactly as a running one does.
No. Container names, image references, volume names, and network names are independent registries with separate rules.
Related Error Codes
The daemon could not bind the published host port because another holder keeps it.
A command addressed a container name or ID the daemon cannot resolve.
Removal was refused because the container's process is still alive.
Related Errors From Other Categories
Similar error codes documented across different platforms and systems