爱好者

Cloudreve:支持对接多家云存储的多功能网盘系统

说明:这几天在loc论坛上跟着大佬撸了很多网盘空间,放在手里也没多大用,于是想要搭建个网盘程序,最后选择了Cloudreve,作者使用Go语言开发,下面教大家如何搭建。教程更新于:2022-06-28

功能

项目地址:https://github.com/cloudreve/Cloudreve

截图

安装

1、安装宝塔

#Centos系统
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh ed8484bec

#Debian系统
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh ed8484bec

#Ubuntu系统
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh ed8484bec

2、新建网站

3、安装Cloudreve

[tabs]
[tab name="Linux" active="true"]

# 进入程序安装目录 并下载程序安装包
cd /www/wwwroot/xx.com 
wget https://github.com/cloudreve/Cloudreve/releases/download/3.5.3/cloudreve_3.5.3_linux_amd64.tar.gz

#解压获取到的主程序
tar -zxvf cloudreve_3.5.3_linux_amd64.tar.gz

# 赋予执行权限
chmod +x ./cloudreve

# 启动 Cloudreve
./cloudreve

[/tab]

[tab name="Windows"]

[link]
[item name="点击下载" link="https://github.com/cloudreve/Cloudreve/releases/download/3.5.3/cloudreve_3.5.3_windows_amd64.zip" desc="Cloudreve Windows版本下载" /]
[/link]
直接解压获取到的 zip 压缩包,启动 cloudreve.exe 即可。

[/tab]
[/tabs]

[scode type="yellow"]Cloudreve 在首次启动时,会创建初始管理员账号,请注意保管管理员密码,此密码只会在首次启动时出现。如果你忘记初始管理员密码,需要删除同级目录下的cloudreve.db,重新启动主程序以初始化新的管理员账户。[/scode]

反向代理

在网站管理中,点击刚刚我们刚刚创建的网站->找到反向代理->添加反向代理,配置如下:

如需要https访问,在添加反向代理之前,需要开启ssl

现在,我们就可以访问域名管理网站了

创建开机自启

这里新建一个简单的systemd配置文件,适用CentOS 7Debian 8+Ubuntu 16+

[hide]

#将下文 PATH_TO_CLOUDREVE 更换为程序所在目录:如 /www/wwwroot/www.87csn.com
#将以下代码一起复制到SSH运行
cat > /etc/systemd/system/cloudreve.service <<EOF
[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
EOF
#启动并设置开机自启
systemctl start cloudreve
systemctl enable cloudreve

[/hide]

管理命令:

# 启动服务
systemctl start cloudreve

# 停止服务
systemctl stop cloudreve

# 重启服务
systemctl restart cloudreve

# 查看状态
systemctl status cloudreve

创建开机自启(方式2)推荐

宝塔面板打开Supervisor管理器添加守护进程,看图:

[hide]


[scode type="yellow"]注意:设置守护进程之前,请先停止掉命令模式。
路径修改为自己的。添加完成后,守护进程就会启动成功,如图:[/scode]

[/hide]

[scode type="green"]到这里,整个的程序就已经安装完成了,尽情使用吧![/scode]

有任何问题,欢迎下方讨论!

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »