# Naming Containers — Docker

Source: https://www.geekswithgeeks.com/en/docker/docker-naming-containers

> Give containers memorable names instead of referring to random IDs.

## --name

Without `--name`, Docker assigns a random name like `happy_curie`. Naming it yourself makes later commands readable.

```bash
docker run -d --name web -p 8080:80 nginx
docker logs web
docker stop web
```

## Names must be unique

You can't reuse a name while another container (even a stopped one) still holds it — remove the old one first with `docker rm`.
