fix:增加一键全依赖裸机安装说明

This commit is contained in:
spiritlhl
2026-06-03 18:32:25 +08:00
parent 105290cabc
commit 9a1d5dacaf
2 changed files with 90 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ Hardware requirements include at least 1G of free memory and 2G of free disk spa
| Docker Deployment (Pre-built Image) | Quick deployment, larger resource usage | One-click installation, data persistence | Requires Docker environment, large image download |
| Docker Compose Deployment | Suitable for source code updates and maintenance | Highly customizable | Requires Docker environment, lengthy compilation time |
| Dockerfile Self-Compilation | Suitable for source code updates and maintenance | Highly customizable | Requires Docker environment, lengthy compilation time |
| One-Click Full-Stack Script | Bare-metal quick deployment | Fully automated: DB, reverse proxy, TLS, frontend & backend | Higher hardware requirements (10G disk/2G memory) |
### Installation via Pre-compiled Binary Files
@@ -493,6 +494,46 @@ docker run -d \
oneclickvirt:no-db
```
### One-Click Full-Stack Installation Script
`install_full.sh` installs the database, reverse proxy, TLS configuration, frontend, backend, and system service in one flow. It supports MySQL or MariaDB and Caddy, Nginx, or OpenResty.
The domain input auto-detects protocol prefixes: enter `https://panel.example.com` to auto-enable TLS, `http://panel.example.com` to auto-disable TLS, or a plain domain to be prompted interactively.
#### Download Script
```shell
curl -fsSL https://raw.githubusercontent.com/oneclickvirt/oneclickvirt/main/install_full.sh -o install_full.sh
```
#### Interactive Installation
```bash
bash install_full.sh
```
#### Non-Interactive Deployment
```bash
# HTTPS with auto TLS
bash install_full.sh \
--non-interactive \
--domain https://panel.example.com \
--email admin@example.com \
--db-type mariadb \
--proxy caddy
# HTTP only, no TLS
bash install_full.sh \
--non-interactive \
--domain http://192.168.1.100 \
--proxy caddy
```
:::warning
The installer requires at least 10 GB free disk and 2 GB memory by default. It writes the generated database password to the final installation summary; save it before closing the terminal.
:::
## Database Initialization
If you install via the Docker all-in-one image, you **do not need** to manually install ```mysql```. The included database eliminates the need to create an empty database yourself; the corresponding database is already started and available within the container by default, so you can proceed directly to the subsequent initialization steps. For other installation methods that do not include a pre-installed database (such as those using non-all-in-one images, scripts, or custom compilation), you **must** install `mysql` yourself. After installing and starting `mysql`, create an empty database named `oneclickvirt` with the `utf8mb4` character set. It is recommended that this database be accessible only locally via `127.0.0.1`. Be sure to keep the corresponding username and password secure.

View File

@@ -29,6 +29,7 @@ outline: deep
| Docker部署(预构建镜像) | 快速部署,占用较大 | 一键安装、数据持久化 | 需要Docker环境下载镜像较大 |
| DockerCompose部署 | 适合源码更新维护 | 高度自定义 | 需要Docker环境编译耗时长 |
| Dockerfile自编译 | 适合源码更新维护 | 高度自定义 | 需要Docker环境编译耗时长 |
| 一键全栈安装脚本 | 裸金属快速部署 | 全自动安装数据库/反向代理/TLS/前后端 | 硬件要求较高(10G磁盘/2G内存) |
### 通过预编译二进制文件安装
@@ -505,6 +506,54 @@ docker run -d \
oneclickvirt:no-db
```
### 通过一键全栈安装脚本
`install_full.sh` 可一键安装数据库、反向代理、TLS 配置、前端、后端及系统服务,支持 MySQL/MariaDB 以及 Caddy/Nginx/OpenResty。
域名输入支持自动识别协议前缀:输入 `https://panel.example.com` 自动启用 TLS输入 `http://panel.example.com` 自动禁用 TLS输入纯域名则交互式询问。
#### 下载脚本
国际
```shell
curl -fsSL https://raw.githubusercontent.com/oneclickvirt/oneclickvirt/main/install_full.sh -o install_full.sh
```
国内
```shell
curl -fsSL https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/oneclickvirt/main/install_full.sh -o install_full.sh
```
#### 交互式安装
```bash
bash install_full.sh
```
#### 非交互式部署
```bash
# HTTPS 自动 TLS
bash install_full.sh \
--non-interactive \
--domain https://panel.example.com \
--email admin@example.com \
--db-type mariadb \
--proxy caddy
# 仅 HTTP无 TLS
bash install_full.sh \
--non-interactive \
--domain http://192.168.1.100 \
--proxy caddy
```
:::warning
安装程序默认要求至少 10 GB 可用磁盘空间和 2 GB 内存。安装完成后,终端会输出生成的数据库密码,请在关闭终端前妥善保存。
:::
## 数据库初始化
通过docker一体化安装的**无需**手动再安装```mysql```,自带数据库无需自己创建空数据库,默认已在容器中启动了对应的数据库可用了,直接进入后续初始化环节;其他不自带数据库的安装方式(非一体化镜像安装的、脚本安装的、自己编译安装的)**需要**自行安装```mysql```,确保安装启动```mysql```后,创建一个空的数据库```oneclickvirt```,使用类型```utf8mb4```,最好仅本地```127.0.0.1```可访问,对应用户名和密码保存好。