- 项目简介
- 安装目录
mkdir -p /opt/filebrowser/data && cd /opt/filebrowser
- 安装包下载
wget https://github.com/filebrowser/filebrowser/releases/download/v2.24.2/linux-amd64-filebrowser.tar.gz 注意:https://github.com/filebrowser/filebrowser/releases获取下载链接并替换
- 安装包解压
for file in *.tar.gz; do tar -zxvf "$file"; done
- 环境变量
echo -e "\n# 设置filebrowser环境变量" >> /etc/profile echo -e "export FILEBROWSER_HOME=/opt/filebrowser" >> /etc/profile echo -e "export PATH=\$FILEBROWSER_HOME:\$PATH" >> /etc/profile source /etc/profile
- 配置文件
sudo tee /opt/filebrowser/config.json <<-'EOF' { "address": "0.0.0.0", "port": 8181, "log": "/opt/filebrowser/filebrowser.log", "database": "/opt/filebrowser/filebrowser.db", "root": "/opt/filebrowser/data", "authMethod": "builtin" } EOF
- 常用命令
启动:nohup filebrowser -c /opt/filebrowser/config.json > /opt/filebrowser/filebrowser.log & 查看:ps -ef | grep -i filebrowser 关闭:pkill -f "filebrowser" 注意:启动后光标复原Ctrl+C
- 开机启动
#---------------------------------------------------------- sudo tee /usr/bin/filefrowser.sh <<-'EOF' #! /bin/bash /opt/filebrowser/filebrowser -c /opt/filebrowser/config.json EOF chmod +x /usr/bin/filefrowser.sh #---------------------------------------------------------- sudo tee /etc/systemd/system/filefrowser.service <<-'EOF' [Unit] Description=filefrowser After=syslog.target network.target [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/filefrowser.sh [Install] WantedBy=multi-user.target EOF #---------------------------------------------------------- systemctl enable filefrowser #---------------------------------------------------------- reboot
- 访问路径
http://your-server-ip:8181 用户名:admin 密码:admin