Conflict. The container name "/x" is already in use by container …
A container (running or stopped) already has that name; Docker won’t create a second one with the same name.
Seen on:
Docker
Meaning
Stopped containers keep their names until removed. Scripts that use docker run --name x fail on the second run unless they remove the old container first.
Common causes
- Old stopped container with the same name
- Script/CI re-running
docker run --namewithout cleanup - Compose project renamed, leaving old containers
⚡ Quick fix
- Remove it:
docker rm -f x - Use
docker run --rmfor one-off containers - Use Compose, which replaces containers on
up
Detailed fix by platform
Docker
- Idempotent run in scripts:bash
docker rm -f api 2>/dev/null || true docker run -d --name api -p 8080:8080 ghcr.io/acme/api:latest
How to diagnose
- Existing —
docker ps -a --filter name=x - Script — Does it clean up before run?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026