# 部署

## 部署 Vaultwarden <a href="#deploy-vaultwarden" id="deploy-vaultwarden"></a>

```shell
docker run -d --restart always --name vaultwarden \
  -e TZ=Asia/Shanghai
  -e LOG_FILE=/data/log/vaultwarden.log \
  -e ADMIN_TOKEN=some_random_token \
  -v /vaultwarden-data/:/data/ \
  -p 8443:80 \
  vaultwarden/server:latest
```

或者：

```shell
docker run -d --restart always --name vaultwarden -e TZ=Asia/Shanghai -e LOG_FILE=/data/log/vaultwarden.log -e ADMIN_TOKEN=some_random_token -v /vaultwarden-data/:/data/ -p 8443:80 vaultwarden/server:latest
```

参数解释：

* `-d`：指定容器运行于前台或者后台（默认为 `false` 表示运行于后台）
* `--restart always`：自动启动（在宿主机重启后或者 Docker 服务重启后）
* `--name vaultwarden`：指定容器名称为 `vaultwarden`
* `-e TZ=Asia/Shanghai`：设置时区为 `Asia/Shanghai`
* `-e LOG_FILE=/data/log/vaultwarden.log`：设置日志文件路径
* `-e ADMIN_TOKEN=some_random_token`：设置 `ADMIN_TOKEN` 环境变量以启用管理页面
* `-v /vaultwarden-data/:/data/`：挂载容器的 `data` 目录到宿主机的 `vaultwarden-data` 目录上
* `-p 8443:80`：指定容器的 `80` 端口暴露在宿主机的 `8443` 端口上

## 其他部署示例 <a href="#other-deployment-examples" id="other-deployment-examples"></a>

群晖上部署 Vaultwarden 请参阅[使用群晖搭建第三方 Bitwarden 密码服务器](https://ppgg.in/blog/10271.html)。更多请参阅 [Vaultwarden Wiki](https://rs.ppgg.in/) — [部署示例](https://rs.ppgg.in/deployment/deployment-examples)部分。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://host.ppgg.in/vaultwarden/deployment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
