「FILE-BROWSER」- 网页文件浏览器 | Web File Browser

认识

官网:https://filebrowser.org/
文档:https://filebrowser.org/installation.html
仓库:https://github.com/filebrowser/filebrowser | 09/03/2025 | 🆘 Need Maintainers #4906 |

File Browser provides a file managing interface within a specified directory and it can be used to upload, delete, preview and edit your files. It is a create-your-own-cloud-kind of software where you can just install it on your server, direct it to a path and access your files through a nice web interface. 简而言之,File Browser 是个基于网页版的文件管理器,使用 Go 语言开发。

性质

具有以下特性:
1) you can install it on a server, direct it to a path and then access your files through a nice web interface.
2) Easy login system
3) Manage your files through a sleek interface
4) Manage users, add permissions, set scopes
5) Edit your files, of course!
6) Execute custom commands
7) Customize your installation

暂时不具备的功能:在线预览图片缩略图,图片只有打开才能看见。更多其他的特性可以参考官方的文档。界面 UI 可以查看官网

构建

部署方式

容器镜像

[I] SRC: docker.io/filebrowser/filebrowser:latest
[I] DST: ccr.ccs.tencentyun.com/d3rm-3rd/docker.io_filebrowser_filebrowser:latest

命令行直接运行

curl -fsSL https://filebrowser.github.io/get.sh | bash

该命令会在 /usr/local/bin 下安装 filebrower 命令。终端执行该命令会启动 HTTP 服务,然后监听一个端口(终端的输出日志中会显示端口号)。更多细节可以参考官方手册

卸载方法:
如果使用上面方法一的命令安装的,那直接删除 /usr/local/bin/filebrower 命令就可以了。
因为 get.sh 脚本本质上就是从 GitHub 上下载已经编译好的压缩包然后到本地解压。

通过 systemd 运行

1)在 Release 中,下载二进制文件;

2)使用 filebrowser.service 管理服务:

[Unit]
Description=File Browser
After=network.target remote-fs.target nss-lookup.target

[Service]
ExecStart=/path/to/filebrowser -a 127.0.0.1 -p 8080 -d /path/to/filebrowser.db -r /path/to/root

[Install]
WantedBy=multi-user.target

3)使用 Nginx 反向代理:

server {
        server_name filebrowser.example.com;
        listen 80;

        access_log /var/log/nginx/filebrowser.example.com.access.log;
        error_log /var/log/nginx/filebrowser.example.com.error.log;

        location / {
                proxy_pass http://127.0.0.1:8080;
        }

}

通过 Docker Compose 部署

version: '3'

services:
  filebrowser:
    image: "filebrowser/filebrowser"
    container_name: "filebrowser"
    hostname: "filebrowser"
    ports:
      - 8080:80
    restart: always
    volumes:
      - /etc/localtime:/etc/localtime
      - /srv/media:/srv
      - ./filebrowser.db:/database.db
      # - ./.filebrowser.json:/.filebrowser.json

https://github.com/filebrowser/filebrowser/issues/5253
cp: can’t create ‘/config/settings.json’: Permission denied
chown 1000:1000 ./file-browser/* -R

服务访问

https://filebrowser.org/installation#first-boot
默认账号密码 —— The automatically generated password for the user admin is only displayed once. If you fail to remember it, you will need to manually delete the database and start File Browser again. 简而言之,查看服务启动日志即可。

服务配置

通过 filebrowser config 等等命令进行配置,参考 Command Line Interface 文档。

但是,在配置前,需要先停止服务,才能执行配置命令。否则会返回如下错误:

# ./filebrowser config cat
2020/12/26 19:02:40 timeout

关闭登录界面(即关闭认证)

Authentication Method – File Browser

filebrowser config set --auth.method=noauth

参考

GitHub/filebrowser/filebrowser
File Brower/Welcome
Command Line Interface – File Browser