Vaultwarden基本搭建使用与备份

碎碎念

最近折腾了很多东西逐一记录一下吧。主要是为了不让高价小鸡吃灰。

介绍

Alternative implementation of the Bitwarden server API written in Rust and compatible with upstream Bitwarden clients, perfect for self-hosted deployment where running the official resource-heavy service might not be ideal.

在我看来就是Yet another Bitwarden server,自带Rust光环加持。我也是第一次用密码管理器选择大多数人(应该)选择的Bitwarden。

安装

作者使用Debian12,使用Docker的安装方式

安装Docker

1
apt -y install docker.io docker-compose

编写Compose.yaml

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
version: "3.8"
services:
  vaultwarden:
    image: vaultwarden/server:latest
    container_name: vaultwarden
    restart: always
## For more environment plz see the wiki below
## https://github.com/dani-garcia/vaultwarden/wiki
    environment:
      - SIGNUPS_ALLOWED=false
      - DOMAIN=your-domain
    volumes:
      - vaultwarden-data:/data/
  backup:
    image: ttionya/vaultwarden-backup:latest
    container_name: vaultwarden-backup
    restart: always
    environment:
      - TIMEZONE=Asia/Shanghai
    volumes:
      - vaultwarden-data:/bitwarden/data/
      - vaultwarden-rclone-data:/config/
volumes:
  vaultwarden-data:
    name: vaultwarden-data
  vaultwarden-rclone-data:
    external: true
    name: vaultwarden-rclone-data

这是笔者最基础的配置,可以结合文档自行修

备份相关

配置备份

1
2
3
4
docker run --rm -it \
  --mount type=volume,source=vaultwarden-rclone-data,target=/config/ \
  ttionya/vaultwarden-backup:latest \
  rclone config

还原备份

1
2
3
4
5
docker run --rm -it \
  --mount type=volume,source=vaultwarden-data,target=/bitwarden/data/ \
  --mount type=bind,source=$(pwd),target=/bitwarden/restore/ \
  ttionya/vaultwarden-backup:latest restore \
  --zip-file your-zipfile-name

注意 container_name 需修改为自己的容器名称

引用

Vaultwarden

vaultwarden-backup

comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计