warning
v2.0.0 behavior change
Starting in v2.0.0, user CLI commands changed. Use user set <username> --password [value] instead of set -u username,password. Use user promote <username> to grant admin without changing the password. The old set -u form still works but prints a deprecation warning on stderr. Docker examples should mount a data directory (not a single database.db file) — see Docker setup.
FileBrowser provides a minimal CLI for setup and user management.
CLI migration (v2.0.0+) link
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| # User create
set -u john,pass -c cfg → user set john --password pass -c cfg
# User password reset
set -u john,newpass -c cfg → user set john --password newpass -c cfg
# or: echo 'newpass' | user set john --password -c cfg
# Create admin
set -u admin,pass -a -c cfg → user set admin --password pass -a -c cfg
# Promote to admin (preferred — no password change)
set -u joe,newpass -a -c cfg → user promote joe -c cfg
# Access rules — NO CHANGE
set rule -s access -p / -r user -v admin --allow -c cfg
# Server / setup / version — NO CHANGE
filebrowser -c cfg
filebrowser setup
filebrowser version
|
Available Commands link
Start Server link
Default command - runs the server:
With custom config:
1
| ./filebrowser -c /path/to/config.yaml
|
Create new configuration file:
Generates config.yaml with defaults.
Check version information:
User Management link
Create or update a password-authenticated user:
1
| ./filebrowser user set username --password secret -c config.yaml
|
Prompt for password on a TTY (omit the value):
1
| ./filebrowser user set username --password -c config.yaml
|
Read password from stdin (scripts):
1
| echo 'secret' | ./filebrowser user set username --password -c config.yaml
|
Create as admin:
1
| ./filebrowser user set username --password secret -a -c config.yaml
|
Promote an existing user to admin without changing their password:
1
| ./filebrowser user promote username -c config.yaml
|
info
user set … -a still resets the password and clears 2FA (same as the old set -u … -a). Prefer user promote when you only need to grant admin.
Deprecated (still works with stderr warning):
1
| ./filebrowser set -u username,password [-a] [-c config.yaml]
|
Access Rule Management link
Create or update access rules via CLI:
Allow user access:
1
| ./filebrowser set rule -s access -p /secret -r user -v username --allow -c config.yaml
|
Deny user access:
1
| ./filebrowser set rule -s access -p /secret -r user -v username -c config.yaml
|
Allow group access:
1
| ./filebrowser set rule -s access -p /departments/sales -r group -v sales --allow -c config.yaml
|
Deny all users:
1
| ./filebrowser set rule -s access -p /restricted -r all -c config.yaml
|
Rule command options:
-s / --source - Source name from config (not the filesystem path)-p / --path - Index path (e.g. /secret)-r / --role - Rule category: user, group, or all (for deny only)-v / --value - Username or groupname (not required if -r is all)--allow - Allow access (default: false, which means deny)-c / --config - Config file path
Important Notes link
Always shut down the server before CLI operations
Only one process can access the database at once.
1
2
3
4
5
6
7
8
| # Stop service first
systemctl stop filebrowser
# Run CLI command
./filebrowser user set admin --password newpass -c config.yaml
# Start service
systemctl start filebrowser
|
Docker Usage link
Stop Running Container link
Run CLI in Container link
1
2
3
4
5
| docker run -it \
-v $(pwd)/database.db:/home/filebrowser/database.db \
-v $(pwd)/config.yaml:/home/filebrowser/config.yaml \
--entrypoint="" \
gtstef/filebrowser:stable sh
|
Inside container:
1
2
| ./filebrowser user set admin --password newpass -c config.yaml
exit
|
One-Line Docker Commands link
Password reset:
1
2
3
4
5
6
| docker run -it --rm \
-v $(pwd)/database.db:/home/filebrowser/database.db \
-v $(pwd)/config.yaml:/home/filebrowser/config.yaml \
--entrypoint="" \
gtstef/filebrowser:stable \
./filebrowser user set admin --password newpassword -c config.yaml
|
Create user:
1
2
3
4
5
6
| docker run -it --rm \
-v $(pwd)/database.db:/home/filebrowser/database.db \
-v $(pwd)/config.yaml:/home/filebrowser/config.yaml \
--entrypoint="" \
gtstef/filebrowser:stable \
./filebrowser user set newuser --password password -c config.yaml
|
Common Operations link
Password Reset link
warning
Important: Resetting a user’s password via CLI also clears their Two-Factor Authentication (2FA). The user will need to set up 2FA again after logging in with the new password.
1
2
| ./filebrowser user set admin --password newpassword -c config.yaml
# or: echo 'newpassword' | ./filebrowser user set admin --password -c config.yaml
|
This is useful if:
- A user forgot their password
- A user lost access to their 2FA device and needs both password and 2FA reset
- You need to reset an account for security reasons
Create New User link
1
| ./filebrowser user set joe --password password -c config.yaml
|
info
Always include config path, so user defaults are applied.
1
| ./filebrowser user promote joe -c config.yaml
|
To promote and reset password at the same time:
1
| ./filebrowser user set joe --password newpassword -a -c config.yaml
|
Initial Admin Setup link
After first install:
1
2
3
4
5
6
| # Option 1: Use CLI
./filebrowser user set admin --password secure-password -a -c config.yaml
# Option 2: Use environment variable
export FILEBROWSER_ADMIN_PASSWORD="secure-password"
./filebrowser -c config.yaml
|
Command Reference link
filebrowser link
Start server with optional config.
Syntax:
1
| ./filebrowser [-c config.yaml]
|
Options:
-c - Config file path (default: config.yaml)
Examples:
1
2
| ./filebrowser
./filebrowser -c /etc/filebrowser/config.yaml
|
filebrowser setup link
Create default configuration file.
Syntax:
Output: Creates config.yaml in current directory.
filebrowser version link
Display version information.
Syntax:
Output:
1
2
3
| FileBrowser version: v0.10.0
Built: 2025-01-15
Go version: go1.23
|
filebrowser user set link
Create or update a password-authenticated user.
Syntax:
1
| ./filebrowser user set <username> --password [value] [-a] [-c config.yaml]
|
Options:
--password - Password (inline value, TTY prompt when omitted, or read from stdin when piped)-a / --admin - Grant admin permissions-c / --config - Config file path--no-input - Disable interactive prompts (fail if password value is required)
Examples:
1
2
3
4
5
6
7
8
| # Create user
./filebrowser user set john --password pass123 -c config.yaml
# Create admin
./filebrowser user set admin --password secure-pass -a -c config.yaml
# Reset password (piped)
echo 'newpass' | ./filebrowser user set john --password -c config.yaml
|
Grant admin permissions without changing the password.
Syntax:
1
| ./filebrowser user promote <username> [-c config.yaml]
|
Example:
1
| ./filebrowser user promote joe -c config.yaml
|
filebrowser set (deprecated user syntax) link
Deprecated user syntax (prints stderr warning):
1
| ./filebrowser set -u username,password [-a] [-c config.yaml]
|
Use user set instead. This form remains available in v2.0.0 for compatibility.
filebrowser set rule link
Syntax:
1
| ./filebrowser set rule -s <sourceName> -p <indexPath> -r <user|group|all> [-v <value>] [--allow] [-c config.yaml]
|
Access Rule Options:
-s / --source - Source name from config (required)-p / --path - Index path (required)-r / --role - Rule category: user, group, or all (for deny only) (required)-v / --value - Username or groupname (required when -r is user or group)--allow - Allow access (default: false, which means deny)-c / --config - Config file path
Access Rule Examples:
1
2
3
4
5
6
7
8
| # Allow user access to a path
./filebrowser set rule -s access -p /documents -r user -v john --allow -c config.yaml
# Deny group access
./filebrowser set rule -s access -p /restricted -r group -v guests -c config.yaml
# Deny all users
./filebrowser set rule -s access -p /private -r all -c config.yaml
|
Troubleshooting link
For common issues and solutions, see the Troubleshooting guide.
Next Steps link