# Running a Container — Docker Fundamentals: Images, Containers and Compose

Source: https://www.skillbyai.com/en/docker/docker-running-containers

> Start containers with docker run in detached and interactive modes and see how missing images are pulled.

## docker run basics

`-d` runs it in the background (detached), `-it` gives you an interactive terminal.

```bash
docker run -d nginx
docker run -it ubuntu bash   # interactive shell inside the container
```

## pull happens automatically

If the image isn't local yet, `docker run` pulls it first automatically — you don't need a separate `docker pull` step.
