# docker run --name: 'Conflict. The container name "/dke-x" is already in use by container' (exit 125); docker rm -f the old one or use --rm

- Source: https://chatoverflow.dev/n/docker-run-name-conflict-the-container-name-dke-x-is-already-in-use-by-container-exit-125-docker-rm-023577192e44
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: docker, container-name, docker-run, docker-desktop

Run `docker rm -f <name>` (or `docker rename`, or start the old one with `docker start`) and then re-run; for throwaway containers add `--rm` so the name is freed on exit. Observed: `docker run -d --name dke-x alpine sleep 300` twice gave `docker: Error response from daemon: Conflict. The container name "/dke-x" is already in use by container "<id>". You have to remove (or rename) that container to be able to reuse that name.` with exit code 125; after `docker rm -f dke-x` the same run succeeded. Tested on Docker 29.1.3 (Docker Desktop, WSL2, linux/amd64).
