1.官方网站/文档
2.使用 docker-compose 安装
(推荐,支持离线下载)
2.1创建目录结构
mkdir -vp /home/opt/cloudreve/{uploads,avatar} \
&& touch /home/opt/cloudreve/conf.ini \
&& touch /home/opt/cloudreve/cloudreve.db \
&& mkdir -p /home/opt/cloudreve/aria2/config \
&& mkdir -p /home/opt/cloudreve/data/aria2 \
&& chmod -R 777 /home/opt/cloudreve/data/aria2
2.2 docker-compose.yml
version: "3.8"
services:
cloudreve:
container_name: cloudreve
image: cloudreve/cloudreve:latest
restart: unless-stopped
ports:
- "5212:5212"
volumes:
- temp_data:/data
- /home/opt/cloudreve/uploads:/cloudreve/uploads
- /home/opt/cloudreve/conf.ini:/cloudreve/conf.ini
- /home/opt/cloudreve/cloudreve.db:/cloudreve/cloudreve.db
- /home/opt/cloudreve/avatar:/cloudreve/avatar
depends_on:
- aria2
aria2:
container_name: aria2
image: p3terx/aria2-pro
restart: unless-stopped
environment:
- RPC_SECRET=your_aria_rpc_token
- RPC_PORT=6800
volumes:
- /home/opt/cloudreve/aria2/config:/config
- temp_data:/data
volumes:
temp_data:
driver: local
driver_opts:
type: none
device: /home/opt/cloudreve/data
o: bind
2.3 启动
cp docker-compose.yml /home/opt/cloudreve
docker-compose up -d
2.4 更新版本
//关闭当前运行的容器,此步骤不会删除挂载的配置文件以及相关目录
docker-compose down
//如果此前已经拉取 docker 镜像,使用以下命令获取最新镜像
docker pull cloudreve/cloudreve
3.查看初始密码
docker logs cloudreve
___ _ _
/ __\ | ___ _ _ __| |_ __ _____ _____
/ / | |/ _ \| | | |/ _ | '__/ _ \ \ / / _ \
/ /___| | (_) | |_| | (_| | | | __/\ V / __/
\____/|_|\___/ \__,_|\__,_|_| \___| \_/ \___|
V3.7.1 Commit #f172220 Pro=false
================================================
[Info] 2023-05-26 22:56:13 Initializing database connection...
[Info] 2023-05-26 22:56:13 Start initializing database schema...
[Info] 2023-05-26 22:56:14 Admin user name: admin@cloudreve.org
[Info] 2023-05-26 22:56:14 Admin password: ********
[Info] 2023-05-26 22:56:14 Start executing database script "UpgradeTo3.4.0".
[Info] 2023-05-26 22:56:14 Finish initializing database schema.
[Info] 2023-05-26 22:56:14 Initialize task queue with WorkerNum = 10
[Info] 2023-05-26 22:56:14 Initialize crontab jobs...
[Info] 2023-05-26 22:56:14 Current running mode: Master.
[Info] 2023-05-26 22:56:14 Listening to ":5212"
[Info] 2023-05-26 23:00:00 Crontab job "cron_garbage_collect" complete.
4.初始化设置
http://127.0.0.1:5212
4.1登录管理后台
4.2设置系统语言
4.3 管理面板设置网站信息(站点url)
4.4配置离线下载
[不可修改] RPC 服务器地址 => http://aria2:6800
[可修改, 需保持和 docker-compose.yml 文件一致] RPC 授权令牌 => your_aria_rpc_token
[不可修改] Aria2 用作临时下载目录的 节点上的绝对路径 => /data
4.5修改用户组容量
4.6关闭允许新用户注册
5.nginx 反向代理配置
#PROXY-START/
location ^~ /
{
proxy_pass http://127.0.0.1:5212;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_http_version 1.1;
# proxy_hide_header Upgrade;
# 支持分片传输--视频快进
proxy_set_header Range $http_range;
proxy_set_header If-Range $http_if_range;
proxy_redirect off;
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
set $static_fileL39DWwRH 0;
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
{
set $static_fileL39DWwRH 1;
expires 1m;
}
if ( $static_fileL39DWwRH = 0 )
{
add_header Cache-Control no-cache;
}
}
#PROXY-END/