Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://github.com/dani-garcia/bitwarden_rs

https://medium.com/swlh/set-up-your-own-personal-password-vault-313d76374046

WD=/opt/bitwarden
mkdir -p $WD/{bitwarden_sql,bitwarden_data,setup}
cd $WD/setup
cat << 'EOF' >docker-compose.yaml
version: '3.7'

services:
 bitwarden:
    container_name: bitwarden
    image: bitwardenrs/server:latest
    hostname: bitwarden
    networks:
      - bitwardennet
    ports:
      - '8217:80'
    volumes:
      - type: bind
        source: /opt/bitwarden/bitwarden_data/
        target: /data

    environment:
      - 'TZ=${TZ}'
      - 'SIGNUPS_ALLOWED=${SIGNUPS_ALLOWED}'
      - 'WEBSOCKET_ENABLED=${WEBSOCKET_ENABLED}'
      - 'DOMAIN=${DOMAIN}'
      - 'LOG_FILE=/data/bitwarden.log'
      - 'DATABASE_URL=postgresql://${DB_USER}:${DB_PWD}@bitwarden_sql:5432/${DB_NAME}'       
      - 'SMTP_HOST=${SMTP_HOST}'
      - 'SMTP_FROM=${SMTP_FROM}'
      - 'SMTP_PORT=${SMTP_PORT}'
      - 'SMTP_SSL=${SMTP_SSL}'
      - 'SMTP_USERNAME=${SMTP_USERNAME}'
      - 'SMTP_PASSWORD=${SMTP_PASSWORD}'
      - 'WEB_VAULT_FOLDER=${WEB_VAULT_FOLDER}'
      - 'WEB_VAULT_ENABLED=${WEB_VAULT_ENABLED}'

 bitwardendb:
    container_name: bitwarden_sql
    hostname: bitwarden_sql
    networks:
      - bitwardennet
    image: postgres
    volumes:
      - type: bind
        source: /opt/bitwarden/bitwarden_sql/
        target: /var/lib/postgresql/data

    environment:
      - 'POSTGRES_USER=${DB_USER}'
      - 'POSTGRES_PASSWORD=${DB_PWD}'
      - 'POSTGRES_DB=${DB_NAME}'
      - 'POSTGRES_ENCODING=UTF8'
      - 'POSTGRES_COLLATE=C'
      - 'POSTGRES_COLLATE_TYPE=C'

networks:
  bitwardennet:
    driver: bridge
EOF
chmod +x docker-compose.yaml

cd $WD/setup
cat << 'EOF'>.env
#BWarden
SIGNUPS_ALLOWED=false
WEBSOCKET_ENABLED=false
DOMAIN=https://domain.com WEB_VAULT_FOLDER=/web-vault
WEB_VAULT_ENABLED=true 

#SQL
DB_NAME=bitwardendb
DB_USER=bitwardenuser
DB_PWD=bitwardenpwd

#SMTP
SMTP_HOST=smtp.gmail.com
SMTP_FROM=user@gmail.com
SMTP_PORT=587
SMTP_SSL=true
SMTP_USERNAME=user@gmail.com
SMTP_PASSWORD="Password"  

#General
TZ=America/Whitehorse

EOF
chmod +x .env
  • No labels