使用filebrowser搭建文件管理器

本文详细介绍如何在Linux环境下安装和配置FileBrowser,包括创建文件夹、下载与解压二进制包、设置监听地址与端口、配置数据库、用户添加及后台运行等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值