1 filebrowser 如何设置自定义端口
wkdaily edited this page 2024-05-08 09:33:30 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

首先停止filebrowser所在进程

sudo pkill -f filebrowser

删除配置文件db

sudo rm -rf /root/filebrowser.db

设置新的端口 比如6060

sudo filebrowser config init -p 6060

重新启动

nohup sudo filebrowser -r / --address 0.0.0.0 >filebrowser.log 2>&1 &

另外可以修改一下自启动文件,也将端口修改为6060或者干脆不写

/etc/systemd/system/filebrowser.service

[Unit]
Description=File Browser Service
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/filebrowser -r / --address 0.0.0.0 --port 6060
Restart=always

[Install]
WantedBy=multi-user.target

我们安装的filebrowser 是一个可执行文件并非是docker版本。其实在它的官网有很多关于它的用法。系统的学习建议前往官网 https://filebrowser.org/cli