> For the complete documentation index, see [llms.txt](https://homelab.4pfsec.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://homelab.4pfsec.com/system-services-software/docker-and-docker-compose.md).

# Docker & Docker-Compose

## Docker

### Install

Prerequisites

```
apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
```

Configure Docker apt repo

```
echo 'deb https://download.docker.com/linux/debian stretch stable' > /etc/apt/sources.list
```

Install

```
apt-get update
apt-get install docker.io docker-compose
```

### Creating a Docker Network

Creating a network allows us to throw all our containers into one network. Else, each container will have its own network.

```
docker network create --driver bridge containerz
```

![](https://4023630493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsVNw0ukkXTvV2pJfDvjn%2Fuploads%2FXThm4bt082YHKWIsDjUO%2Fimage.png?alt=media\&token=5130c1ae-adc5-488d-bc4b-b310929e79bd)

### Verify

```
docker --version
```

![](https://4023630493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsVNw0ukkXTvV2pJfDvjn%2Fuploads%2FrWbg0LEHYLwZyHrjHZM9%2Fimage.png?alt=media\&token=b5e23b40-1c31-4e06-bb01-17ce1b4d46ac)
