Conflict container name Docker Origin: Platform & cloud OSI layer 7 · Application Last updated 15 Oct 2026

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.

Exact message you may see is already in use by containercontainer name already in useYou have to remove (or rename) that container
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 --name without cleanup
  • Compose project renamed, leaving old containers

⚡ Quick fix

  1. Remove it: docker rm -f x
  2. Use docker run --rm for one-off containers
  3. Use Compose, which replaces containers on up

Detailed fix by platform

Docker

  1. 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

  1. Existing — docker ps -a --filter name=x
  2. Script — Does it clean up before run?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

ACR unauthorized — Azure Container Registry: unauthorized: authentication required, visit https://aka.ms/acr/authorization (AKS ErrImagePull 401) (Azure)ACR unauthorizedContainer failed to start — Cloud Run: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable (Google Cloud / Firebase)Container failed to s…daemon — Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (Docker)daemonEROFS — npm ERR! code EROFS — EROFS: read-only file system (npm)EROFSexec no such file or directory — exec /docker-entrypoint.sh: no such file or directory (CRLF line endings / missing interpreter) (Docker)exec no such file or …executable file not found in $PATH — OCI runtime create failed: exec: "x": executable file not found in $PATH (Docker)executable file not f…Exited (0) — Docker container exits immediately (Exited (0) / Exited (1) right after start) (Docker)Exited (0)is not running — Error response from daemon: Container X is not running (Docker)is not runningConflict …

Explore the map of this error Full error map →

🧠 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.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.