# Running a Container — Docker

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

> docker run creates and starts a container from an image.

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