# Vaultwarden

## Setup using Docker Compose

This is installed using docker compose version 2 see [this page](docker-compose) on how to install it.

#### Files and variables

Create `ADMIN_TOKEN`:

```bash
» echo -n "<SOME-PASSWORD-HERE>" | argon2 "$(openssl rand -base64 32)" -e -id -k 65540 -t 3 -p 4 | sed 's#\$#\$\$#g'
$$argon2id$$v=19$$m=65540,t=3,p=4$$bEsrUWdpcEx5ZDNjVWhDWU5wZXRsYmJ1Sk9ucFFzdTJ5anpMZENNRTZVcz0$$ZzQrnAqa0MiJmKkMPPZMWng0koLZDIpaIDWdP7B1218
```

`.env` file:

```bash
ADMIN_TOKEN=$$argon2id$$v=19$$m=65540,t=3,p=4$$b0hObnBLeWQ4QmpaMjVkMTJBWnJYa2VVUDVsbDYraGczWjhnOUQrSE1zdz0$$1ZlUa9UR557IqxUZkTjGit0PTXJx3GObhFh9q+xFVL8
WEBSOCKET_ENABLED=true
SIGNUPS_ALLOWED=true
SMTP_ENABLED=false
YUBIKEY_ENABLED=false
DUO_ENABLED=false
EMAIL_2FA_ENABLED=false
DOMAIN=https://vault.mydomain.local
```

`docker-compose.yml` file:

```yaml
volumes:
  vault-data: { driver: local }
networks:
  proxy:
    name: proxy_network

services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: unless-stopped
    ports:
     - 9445:80
    volumes:
     - vault-data:/data
    environment:
     - DOMAIN=${DOMAIN}
     - ADMIN_TOKEN=${ADMIN_TOKEN}
     - WEBSOCKET_ENABLED=${WEBSOCKET_ENABLED}
     - SIGNUPS_ALLOWED=${SIGNUPS_ALLOWED}
     - SMTP_ENABLED=${SMTP_ENABLED}
     - YUBYKEY_ENABLED=${YUBIKEY_ENABLED}
     - DUO_ENABLED=${DUO_ENABLED}
     - EMAIL_2FA_ENABLED=${EMAIL_2FA_ENABLED}
    networks:
      - proxy
```

#### Build container

```
docker compose up -d
```

Reach the service at `http://localhost:9445` and the admin interface at `/admin`.

