CLI Commands
FileBrowser provides a minimal CLI for setup and user management.
Available Commands
Start Server
Default command - runs the server:
./filebrowser
With custom config:
./filebrowser -c /path/to/config.yaml
Setup
Create new configuration file:
./filebrowser setup
Generates config.yaml
with defaults.
Version
Check version information:
./filebrowser version
User Management
Add or update user:
./filebrowser set -u username,password
With custom config:
./filebrowser set -u username,password -c config.yaml
Create admin user:
./filebrowser set -u username,password -a
Important Notes
Always shut down the server before CLI operations
Only one process can access the database at once.
# Stop service first
systemctl stop filebrowser
# Run CLI command
./filebrowser set -u admin,newpass -c config.yaml
# Start service
systemctl start filebrowser
Docker Usage
Stop Running Container
docker compose down
Run CLI in Container
docker run -it \
-v $(pwd)/database.db:/home/filebrowser/database.db \
-v $(pwd)/config.yaml:/home/filebrowser/config.yaml \
--entrypoint="" \
gtstef/filebrowser sh
Inside container:
./filebrowser set -u admin,newpass -c config.yaml
exit
One-Line Docker Commands
Password reset:
docker run -it --rm \
-v $(pwd)/database.db:/home/filebrowser/database.db \
-v $(pwd)/config.yaml:/home/filebrowser/config.yaml \
--entrypoint="" \
gtstef/filebrowser \
./filebrowser set -u admin,newpassword -c config.yaml
Create user:
docker run -it --rm \
-v $(pwd)/database.db:/home/filebrowser/database.db \
-v $(pwd)/config.yaml:/home/filebrowser/config.yaml \
--entrypoint="" \
gtstef/filebrowser \
./filebrowser set -u newuser,password -c config.yaml
Common Operations
Password Reset
Password reset also disables 2FA for the user.
./filebrowser set -u admin,newpassword -c config.yaml
Create New User
./filebrowser set -u joe,password -c config.yaml
Always include config path so user defaults are applied.
Promote User to Admin
./filebrowser set -u joe,newpassword -a -c config.yaml
Promoting also resets password.
Initial Admin Setup
After first install:
# Option 1: Use CLI
./filebrowser set -u admin,secure-password -a -c config.yaml
# Option 2: Use environment variable
export FILEBROWSER_ADMIN_PASSWORD="secure-password"
./filebrowser -c config.yaml
Command Reference
filebrowser
Start server with optional config.
Syntax:
./filebrowser [-c config.yaml]
Options:
-c
- Config file path (default:config.yaml
)
Examples:
./filebrowser
./filebrowser -c /etc/filebrowser/config.yaml
filebrowser setup
Create default configuration file.
Syntax:
./filebrowser setup
Output: Creates config.yaml
in current directory.
filebrowser version
Display version information.
Syntax:
./filebrowser version
Output:
FileBrowser version: v0.10.0
Built: 2025-01-15
Go version: go1.23
filebrowser set
Add or update users.
Syntax:
./filebrowser set -u username,password [-a] [-c config.yaml]
Options:
-u
- Username and password (comma-separated)-a
- Make user admin-c
- Config file path
Examples:
# Create user
./filebrowser set -u john,pass123 -c config.yaml
# Create admin
./filebrowser set -u admin,secure-pass -a -c config.yaml
# Reset password
./filebrowser set -u john,newpass -c config.yaml
Troubleshooting
For common issues and solutions, see the Troubleshooting guide.