How to build VaultWarden/MariaDB on Portainer with Nginx

Vault warden is a password Manager, This app is the best I have and my company using this password manager. It is very helpful for team that can log in for our business and help employees to access instead of waiting for the leader or owner to respond to us for email or password or TOTP code. So, It better to build and make this for your small business or over 500 employees. It will save your headaches. And times.

Make sure you’re running the Portainer and Nginx Proxy Manager before we start this.

We will need to go open PhpMyAdmin to create Database and user for vault warden. If you don’t have one, then follow this instruction to set up PhpMyAdmin.

Login to PhpMyAdmin, then create a database

Login to your admin account

Then click new for database to create.

Create any name you prefer, only you need to make sure it matches on your docker-compose below.

Then now we have to create a user, so we have to go “privileges” in the Menu

Click Privileges on the top bar

Then click add user account

Make sure you create a username and password(I used generate password) since it is not exposed public, so my database is safe.

That it then now we go to create the vault warden on Portainer.

Open Portainer site → login admin → stacks → Add Stacks:

version: '3.3'
services:
  vaultwarden:
    networks:
      - nginx
      - mariadb
    container_name: vaultwarden
    image: vaultwarden/server:latest
    restart: unless-stopped
    environment:
      - ROCKET_PORT=80
      - DATABASE_URL=mysql://user:password@databasecontainer_name:3306/databasename
      - ADMIN_TOKEN=
      - TZ=America/los_Angeles
      - SMTP_HOST=my.richardapplegate.io
      - SMTP_FROM=bitwarden@richardapplegate.io
      - SMTP_PORT=465
      - SMTP_SECURITY=force_tls
      - SMTP_USERNAME=bitwarden@richardapplegate.io
      - SMTP_PASSWORD=PsoMEr,?,25
      - WEBSOCKET_ENABLED=true
    expose:
      - 80
      - 3012
    volumes:
      - /mnt/applegatebackup/vaultwarden/data/:/data/
networks:
  nginx:
   external: true
  mariadb:
   external: true

Posted

in

by

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: