# Bitwarden (Docker)

<table border="1" id="bkmrk-root-disk-100-g-ram-" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; width: 77.7778%; height: 178.781px;"><tbody><tr style="height: 29.7969px;"><td style="width: 39.3963%; height: 29.7969px;">ID</td><td class="align-right" style="width: 60.6096%; height: 29.7969px;">103</td></tr><tr><td style="width: 39.3963%;">Name</td><td class="align-right" style="width: 60.6096%;">Bitwarden</td></tr><tr style="height: 29.7969px;"><td style="width: 39.3963%; height: 29.7969px;">OS</td><td class="align-right" style="width: 60.6096%; height: 29.7969px;">Debian 10</td></tr><tr style="height: 29.7969px;"><td style="width: 39.3963%; height: 29.7969px;">Root Disk</td><td class="align-right" style="width: 60.6096%; height: 29.7969px;">20 G</td></tr><tr style="height: 29.7969px;"><td style="width: 39.3963%; height: 29.7969px;">RAM</td><td class="align-right" style="width: 60.6096%; height: 29.7969px;">4 G</td></tr><tr style="height: 29.7969px;"><td style="width: 39.3963%; height: 29.7969px;">Cores</td><td class="align-right" style="width: 60.6096%; height: 29.7969px;">2</td></tr><tr style="height: 29.7969px;"><td style="width: 39.3963%; height: 29.7969px;">Netzwerk</td><td class="align-right" style="width: 60.6096%; height: 29.7969px;">192.168.1.222</td></tr></tbody></table>

### Insatallation

#### Obligatorisches Update  


```shell
apt update && sudo apt upgrade -y
```

#### Installation von Docker und Docker Compose

```shell
apt install ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update && apt install docker-ce docker-ce-cli containerd.io
curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
```

#### Installation von Portainer

```shell
cd /home
mkdir portainer-ce && cd portainer-ce/
nano docker-compose.yml
```

Inhalt der docker-compose.yml:

```shell
version: '3'
services:
  portainer:
    image: portainer/portainer-ce:latest
    container_name: portainer-ce
    restart: always
    ports:
      - 9000:9000
      - 8000:8000
      - 9443:9443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - portainer_data:/data
volumes:
  portainer_data:
```

```shell
docker-compose up -d
```

##### Update Portainer

```shell
cd /home/portainer-ce
docker-compose stop
docker-compose pull
docker-compose up -d
```

---

#### Installation von Vaultwarden

```shell
cd /home
mkdir bitwarden
cd /home/bitwarden
nano docker-compose.yml
```

Inhalt der docker-compose.yml:

```shell
version: '3'
services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: always
    environment:
      - LOG_LEVEL=info
      - TZ=Europe/Berlin
      - ADMIN_TOKEN=###adminToken###
      - INVITATIONS_ALLOWED=false
      - SHOW_PASSWORD_HINT=false
    ports:
      - 80:80
      - 443:443
    volumes:
      - /vw-data:/data/
```

```shell
docker-compose up -d
```

#### Update Vaultwarden

```shell
cd /home/bitwarden
docker-compose stop
docker-compose pull
docker-compose up -d
```