一、Cloudreve 是什么?
Cloudreve 是个公有网盘程序,你可以用它快速搭建起自己的网盘服务,公有云/私有云都可。Cloudreve 底层支持 本机存储、从机存储、阿里云OSS、又拍云、腾讯云COS、七牛云存储、OneDrive(国际版/世纪互联版),每种存储方式的上传下载都是客户端直传。你可以为不同用户组绑定不同存储策略,捐助获得Pro版后,可以为一个用户组分配多个存储方式,用户可以在前台自由切换。
特性列表
- 支持本机、从机、七牛、阿里云 OSS、腾讯云 COS、又拍云、OneDrive (包括世纪互联版) 作为存储端
- 上传/下载 支持客户端直传,支持下载限速
- 可对接 Aria2 离线下载(支持所有存储策略,下载完成后自动中转)
- 在线 压缩/解压缩、多文件打包下载(支持所有存储策略)
- 覆盖全部存储策略的 WebDAV 协议支持
- 拖拽上传、目录上传、流式上传处理
- 文件拖拽管理
- 多用户、用户组
- 创建文件、目录的分享链接,可设定自动过期
- 视频、图像、音频、文本、Office 文档在线预览
- 自定义配色、黑暗模式、PWA 应用、全站单页应用
- All-In-One 打包,开箱即用
截图与演示

演示站点:https://demo.cloudreve.org 可以用QQ登录体验一下。
一、准备工作
1.购买VPS服务器
2.在VPS服务器上搭建宝塔面板
3.域名购买(非必要)
4.VPS搭建Aria2离线下载(非必要)
二、开始搭建
1.进入宝塔面板创建网站
1.1 创建网站

1.2 为网站申请SSL证书


1.3 为网站设置反向代理

1.4 在【安全】里面打开端口

2.打开SSH工具安装Cloudreve
2.1 切换到网站根目录
cd /www/wwwroot/cloud.unvone.com

2.2 下载解压和执行Cloudreve
项目下载地址:Releases · cloudreve/Cloudreve · GitHub
下载Cloudreve压缩包
wget https://github.com/cloudreve/Cloudreve/releases/download/3.2.1/cloudreve_3.2.1_linux_amd64.tar.gz

解压Cloudreve压缩包
tar -zxvf cloudreve_3.2.1_linux_amd64.tar.gz

赋予执行权限&启动Cloudreve
chmod +x ./cloudreve && ./cloudreve

三、进入网盘&功能完善
1.网盘访问
浏览器打开网站,输入账号&密码就可以访问。

2.Systemd进程守护
这里只讲第一种简单的方式,第二种进作者教程自己看,我觉得第一种简单。
# 编辑配置文件
vim /usr/lib/systemd/system/cloudreve.service
将下文 PATH_TO_CLOUDREVE
更换为程序所在目录:
注意!!!
将下面的 PATH_TO_CLOUDREVE 改成网盘根目录/www/wwwroot/cloud.unvone.com,如果你装在其他文件夹就改成其他文件夹的名字。
[Unit]
Description=Cloudreve
Documentation=https://docs.cloudreve.org
After=network.target
Wants=network.target
[Service]
WorkingDirectory=/PATH_TO_CLOUDREVE
ExecStart=/PATH_TO_CLOUDREVE/cloudreve
Restart=on-abnormal
RestartSec=5s
KillMode=mixed
StandardOutput=null
StandardError=syslog
[Install]
WantedBy=multi-user.target
# 更新配置
systemctl daemon-reload
# 启动服务
systemctl start cloudreve
# 设置开机启动
systemctl enable cloudreve
管理命令:
# 启动服务
systemctl start cloudreve
# 停止服务
systemctl stop cloudreve
# 重启服务
systemctl restart cloudreve
# 查看状态
systemctl status cloudreve
3.对接GoogleDrive扩容
谷歌网盘挂载可以参考?
使用谷歌网盘下的一个目录作为cloudreve网盘文件的存储目录,使其成为无限空间的网盘。

4.离线下载Aria2设置


然后就可以了。可以在用户主页右下角添加下载任务。用途自己发挥想象力~

注意事项
- 如果你有宝塔等带防火墙的记得把5212端口放开
- 想绑定域名的话就反代,作者的反代教程,程序是自带web的,但是不能开启https,想挂载onedrive是需要开启HTTPS的,这里可以用宝塔反代,开启https也简单。我应该在博客刚创建的时候讲过宝塔如何反代。
- 具体的流程以及docker搭建可以去作者那里看,作者的文档:https://docs.cloudreve.org/
文章转载自:https://www.unvone.com/72900.html