filebrowser项目地址 https://github.com/filebrowser/filebrowser
filebrowser下载 https://github.com/filebrowser/filebrowser/releases
LINUX:
创建文件夹
mkdir filebrowser
cd filebrowser
下载linux版二进制包
wget https://github.com/filebrowser/filebrowser/releases/download/v2.0.3/linux-amd64-filebrowser.tar.gz
解压
tar zxvf linux-amd64-filebrowser.tar.gz
创建配置数据库:./filebrowser -d /etc/filebrowser.db config init
设置监听地址:./filebrowser -d /etc/filebrowser.db config set --address 0.0.0.0
设置监听端口:./filebrowser -d /etc/filebrowser.db config set --port 8081
设置云盘路径:./filebrowser -d /etc/filebrowser.db config set --root /root/test
设置语言环境:./filebrowser -d /etc/filebrowser.db config set --locale zh-cn
设置日志位置:./filebrowser -d /etc/filebrowser.db config set --log /var/log/filebrowser.log
添加一个用户:./filebrowser -d /etc/filebrowser.db users add root password --perm.admin,其中的root和password分别是用户名和密码,根据自己的需求更改。
配置修改好以后,就可以启动 File Browser 了,使用-d参数指定配置数据库路径。示例:./filebrowser -d /etc/filebrowser.db
打开浏览器访问你的IP:8081,登录你刚刚创建的用户名和密码就可以了。
后台启动 并开机自启
首先下载 File Browser 的 service 文件:curl https://diannaobos.com/gongju/config/filebrowser.service -o /lib/systemd/system/filebrowser.service
filebrowser.service文件如下
[Unit]
Description=File Browser
After=network.target
[Service]
ExecStart=/usr/local/bin/filebrowser -d /etc/filebrowser.db
[Install]
WantedBy=multi-user.target
如果你的运行命令不是/usr/local/bin/filebrowser -d /etc/filebrowser.db,需要对 service 文件进行修改,将文件的 ExecStart 改为你的运行命令,更改完成后需要输入systemctl daemon-reload。
运行:systemctl start filebrowser.service
停止运行:systemctl stop filebrowser.service
开机启动:systemctl enable filebrowser.service
取消开机启动:systemctl disable filebrowser.service
查看运行状态:systemctl status filebrowser.service
我推荐使用 systemd 的方法来后台运行,当然,前提是你所使用的操作系统支持 systemd。