Skip to content

Commit 407b766

Browse files
committed
fix:修复二进制部署的升级说明
1 parent e8fd98b commit 407b766

File tree

2 files changed

+353
-325
lines changed

2 files changed

+353
-325
lines changed

docs/en/guide/oneclickvirt/oneclickvirt_install.md

Lines changed: 175 additions & 165 deletions
Original file line numberDiff line numberDiff line change
@@ -26,165 +26,11 @@ Hardware requirements include at least 1G of free memory and 2G of free disk spa
2626

2727
| Installation Method | Application Scenario | Advantages | Disadvantages |
2828
|---------|---------|------|------|
29-
| Docker Deployment (Pre-built Image) | Quick deployment, larger footprint | One-click installation, data persistence | Requires Docker environment, large image download |
3029
| Separate Front-end and Back-end Deployment | High performance, minimal footprint | Best performance, flexible configuration | Complex configuration, requires reverse proxy setup |
3130
| Integrated Deployment | Works with or without public IPv4 address | Simple deployment, no reverse proxy needed | Poor performance |
31+
| Docker Deployment (Pre-built Image) | Quick deployment, larger footprint | One-click installation, data persistence | Requires Docker environment, large image download |
3232
| Dockerfile Self-compilation | Suitable for secondary development and source code release | Highly customizable | Requires Docker environment, long compilation time |
3333

34-
### Installation via Docker
35-
36-
:::tip
37-
Since the database starts together with the container, do not operate immediately after the container starts. Wait at least 12 seconds.
38-
:::
39-
40-
Available image tags can be queried at:
41-
42-
https://hub.docker.com/r/spiritlhl/oneclickvirt
43-
44-
https://github.com/oneclickvirt/oneclickvirt/pkgs/container/oneclickvirt
45-
46-
#### Method 1: Deploy Using Pre-built Image
47-
48-
**Image Tag Description**
49-
50-
| Image Tag | Description | Application Scenario |
51-
|---------|------|---------|
52-
| `spiritlhl/oneclickvirt:latest` | Integrated version (built-in database) latest | Quick deployment |
53-
| `spiritlhl/oneclickvirt:20251023` | Integrated version specific date | Requires fixed version |
54-
| `spiritlhl/oneclickvirt:no-db` | Separate database version latest | Without built-in database |
55-
| `spiritlhl/oneclickvirt:no-db-20251023` | Separate database version specific date | Without built-in database |
56-
57-
All images support both `linux/amd64` and `linux/arm64` architectures.
58-
59-
##### Deploy in Fresh Environment
60-
61-
Use pre-built ```amd64``` or ```arm64``` images, which will automatically download the corresponding version based on the current system architecture:
62-
63-
Without domain configuration:
64-
65-
```bash
66-
docker run -d \
67-
--name oneclickvirt \
68-
-p 80:80 \
69-
-v oneclickvirt-data:/var/lib/mysql \
70-
-v oneclickvirt-storage:/app/storage \
71-
--restart unless-stopped \
72-
spiritlhl/oneclickvirt:latest
73-
```
74-
75-
Configure domain access:
76-
77-
If you need to configure a domain, set the `FRONTEND_URL` environment variable:
78-
79-
```bash
80-
docker run -d \
81-
--name oneclickvirt \
82-
-p 80:80 \
83-
-e FRONTEND_URL="https://your-domain.com" \
84-
-v oneclickvirt-data:/var/lib/mysql \
85-
-v oneclickvirt-storage:/app/storage \
86-
--restart unless-stopped \
87-
spiritlhl/oneclickvirt:latest
88-
```
89-
90-
The above methods are only for new installations.
91-
92-
##### Upgrade Only Front-end and Back-end in Existing Environment
93-
94-
First backup the configuration file to the current path:
95-
96-
```shell
97-
docker cp oneclickvirt:/app/config.yaml .
98-
```
99-
100-
Delete only the container without removing the mounted volumes:
101-
102-
```shell
103-
docker rm -f oneclickvirt
104-
```
105-
106-
Then delete the original image:
107-
108-
```shell
109-
docker image rm -f spiritlhl/oneclickvirt:latest
110-
```
111-
112-
Pull the container image again:
113-
114-
```shell
115-
docker pull spiritlhl/oneclickvirt:latest
116-
```
117-
118-
Then follow the steps for deployment in a fresh environment. Note that after waiting 12 seconds and opening the front-end, you will find it automatically skips the initialization interface because the data has been persisted and imported.
119-
120-
Then overwrite the original configuration file:
121-
122-
```shell
123-
docker cp config.yaml oneclickvirt:/app/config.yaml
124-
```
125-
126-
##### Redeploy in Existing Environment
127-
128-
This will completely delete the original data before redeployment. You need to delete not only the container but also the corresponding mount points:
129-
130-
```shell
131-
docker rm -f oneclickvirt
132-
docker volume rm oneclickvirt-data oneclickvirt-storage
133-
```
134-
135-
Then delete the original image:
136-
137-
```shell
138-
docker image rm -f spiritlhl/oneclickvirt:latest
139-
```
140-
141-
Pull the container image again:
142-
143-
```shell
144-
docker pull spiritlhl/oneclickvirt:latest
145-
```
146-
147-
Then follow the steps for deployment in a fresh environment. This will prompt for reinitialization, as all original data has been deleted.
148-
149-
#### Method 2: Self-compile and Deploy via Dockerfile
150-
151-
This method is suitable for self-modifying source code and custom builds:
152-
153-
##### Integrated Version (Built-in Database)
154-
155-
```bash
156-
git clone https://github.com/oneclickvirt/oneclickvirt.git
157-
cd oneclickvirt
158-
docker build -t oneclickvirt .
159-
docker run -d \
160-
--name oneclickvirt \
161-
-p 80:80 \
162-
-v oneclickvirt-data:/var/lib/mysql \
163-
-v oneclickvirt-storage:/app/storage \
164-
--restart unless-stopped \
165-
oneclickvirt
166-
```
167-
168-
##### Separate Database Version (Without Built-in Database)
169-
170-
```bash
171-
git clone https://github.com/oneclickvirt/oneclickvirt.git
172-
cd oneclickvirt
173-
docker build -f Dockerfile.no-db -t oneclickvirt:no-db .
174-
docker run -d \
175-
--name oneclickvirt \
176-
-p 80:80 \
177-
-e FRONTEND_URL="https://your-domain.com" \
178-
-e DB_HOST="your-mysql-host" \
179-
-e DB_PORT="3306" \
180-
-e DB_NAME="oneclickvirt" \
181-
-e DB_USER="root" \
182-
-e DB_PASSWORD="your-password" \
183-
-v oneclickvirt-storage:/app/storage \
184-
--restart unless-stopped \
185-
oneclickvirt:no-db
186-
```
187-
18834
### Installation via Pre-compiled Binary Files
18935

19036
There are also two methods here:
@@ -195,30 +41,30 @@ There are also two methods here:
19541

19642
##### Linux
19743

198-
Download and execute
199-
200-
International:
44+
###### Download Script
20145

20246
```shell
20347
curl -L https://raw.githubusercontent.com/oneclickvirt/oneclickvirt/refs/heads/main/install.sh -o install.sh && chmod +x install.sh
20448
```
20549

206-
Domestic:
207-
208-
```shell
209-
curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/oneclickvirt/refs/heads/main/install.sh -o install.sh && chmod +x install.sh
210-
```
50+
###### Environment Installation
21151

21252
Interactive environment installation:
21353

21454
```
215-
./install.sh
55+
./install.sh env
21656
```
21757

21858
Non-interactive environment installation:
21959

22060
```
221-
noninteractive=true ./install.sh
61+
noninteractive=true ./install.sh env
62+
```
63+
64+
###### Body Installation
65+
66+
```
67+
./install.sh install
22268
```
22369

22470
Installation directory: ```/opt/oneclickvirt```
@@ -261,6 +107,16 @@ Restart service:
261107
systemctl restart oneclickvirt
262108
```
263109

110+
###### Upgrade frontend and backend
111+
112+
```
113+
./install.sh upgrade
114+
```
115+
116+
In addition to configuration files, both backend and frontend files will be upgraded.
117+
118+
###### Deploy the frontend
119+
264120
The installation script will extract static files to:
265121

266122
```shell
@@ -356,6 +212,160 @@ If you're on a Windows system, you need to start the exe file with administrator
356212

357213
The all-in-one deployment mode is suitable for situations where the local machine doesn't have a public IP. Your IP address can be ```localhost``` or ```127.0.0.1```, or it can be the corresponding public IPv4 address. Test in your specific deployment environment.
358214

215+
### Installation via Docker
216+
217+
:::tip
218+
Since the database starts together with the container, do not operate immediately after the container starts. Wait at least 12 seconds.
219+
:::
220+
221+
Available image tags can be queried at:
222+
223+
https://hub.docker.com/r/spiritlhl/oneclickvirt
224+
225+
https://github.com/oneclickvirt/oneclickvirt/pkgs/container/oneclickvirt
226+
227+
#### Method 1: Deploy Using Pre-built Image
228+
229+
**Image Tag Description**
230+
231+
| Image Tag | Description | Application Scenario |
232+
|---------|------|---------|
233+
| `spiritlhl/oneclickvirt:latest` | Integrated version (built-in database) latest | Quick deployment |
234+
| `spiritlhl/oneclickvirt:20251023` | Integrated version specific date | Requires fixed version |
235+
| `spiritlhl/oneclickvirt:no-db` | Separate database version latest | Without built-in database |
236+
| `spiritlhl/oneclickvirt:no-db-20251023` | Separate database version specific date | Without built-in database |
237+
238+
All images support both `linux/amd64` and `linux/arm64` architectures.
239+
240+
##### Deploy in Fresh Environment
241+
242+
Use pre-built ```amd64``` or ```arm64``` images, which will automatically download the corresponding version based on the current system architecture:
243+
244+
Without domain configuration:
245+
246+
```bash
247+
docker run -d \
248+
--name oneclickvirt \
249+
-p 80:80 \
250+
-v oneclickvirt-data:/var/lib/mysql \
251+
-v oneclickvirt-storage:/app/storage \
252+
--restart unless-stopped \
253+
spiritlhl/oneclickvirt:latest
254+
```
255+
256+
Configure domain access:
257+
258+
If you need to configure a domain, set the `FRONTEND_URL` environment variable:
259+
260+
```bash
261+
docker run -d \
262+
--name oneclickvirt \
263+
-p 80:80 \
264+
-e FRONTEND_URL="https://your-domain.com" \
265+
-v oneclickvirt-data:/var/lib/mysql \
266+
-v oneclickvirt-storage:/app/storage \
267+
--restart unless-stopped \
268+
spiritlhl/oneclickvirt:latest
269+
```
270+
271+
The above methods are only for new installations.
272+
273+
##### Upgrade Only Front-end and Back-end in Existing Environment
274+
275+
First backup the configuration file to the current path:
276+
277+
```shell
278+
docker cp oneclickvirt:/app/config.yaml .
279+
```
280+
281+
Delete only the container without removing the mounted volumes:
282+
283+
```shell
284+
docker rm -f oneclickvirt
285+
```
286+
287+
Then delete the original image:
288+
289+
```shell
290+
docker image rm -f spiritlhl/oneclickvirt:latest
291+
```
292+
293+
Pull the container image again:
294+
295+
```shell
296+
docker pull spiritlhl/oneclickvirt:latest
297+
```
298+
299+
Then follow the steps for deployment in a fresh environment. Note that after waiting 12 seconds and opening the front-end, you will find it automatically skips the initialization interface because the data has been persisted and imported.
300+
301+
Then overwrite the original configuration file:
302+
303+
```shell
304+
docker cp config.yaml oneclickvirt:/app/config.yaml
305+
```
306+
307+
##### Redeploy in Existing Environment
308+
309+
This will completely delete the original data before redeployment. You need to delete not only the container but also the corresponding mount points:
310+
311+
```shell
312+
docker rm -f oneclickvirt
313+
docker volume rm oneclickvirt-data oneclickvirt-storage
314+
```
315+
316+
Then delete the original image:
317+
318+
```shell
319+
docker image rm -f spiritlhl/oneclickvirt:latest
320+
```
321+
322+
Pull the container image again:
323+
324+
```shell
325+
docker pull spiritlhl/oneclickvirt:latest
326+
```
327+
328+
Then follow the steps for deployment in a fresh environment. This will prompt for reinitialization, as all original data has been deleted.
329+
330+
#### Method 2: Self-compile and Deploy via Dockerfile
331+
332+
This method is suitable for self-modifying source code and custom builds:
333+
334+
##### Integrated Version (Built-in Database)
335+
336+
```bash
337+
git clone https://github.com/oneclickvirt/oneclickvirt.git
338+
cd oneclickvirt
339+
docker build -t oneclickvirt .
340+
docker run -d \
341+
--name oneclickvirt \
342+
-p 80:80 \
343+
-v oneclickvirt-data:/var/lib/mysql \
344+
-v oneclickvirt-storage:/app/storage \
345+
--restart unless-stopped \
346+
oneclickvirt
347+
```
348+
349+
##### Separate Database Version (Without Built-in Database)
350+
351+
```bash
352+
git clone https://github.com/oneclickvirt/oneclickvirt.git
353+
cd oneclickvirt
354+
docker build -f Dockerfile.no-db -t oneclickvirt:no-db .
355+
docker run -d \
356+
--name oneclickvirt \
357+
-p 80:80 \
358+
-e FRONTEND_URL="https://your-domain.com" \
359+
-e DB_HOST="your-mysql-host" \
360+
-e DB_PORT="3306" \
361+
-e DB_NAME="oneclickvirt" \
362+
-e DB_USER="root" \
363+
-e DB_PASSWORD="your-password" \
364+
-v oneclickvirt-storage:/app/storage \
365+
--restart unless-stopped \
366+
oneclickvirt:no-db
367+
```
368+
359369
## Database Initialization
360370

361371
After installing and starting ```mysql```, create an empty database ```oneclickvirt```, using type ```utf8mb4```, preferably accessible only locally via ```127.0.0.1```. Save the corresponding username and password. (If you're using the all-in-one Docker deployment container, the database is included and you don't need to create an empty database yourself. By default, the corresponding database has already been started in the container and is available.)

0 commit comments

Comments
 (0)