File Browser

File Browser provides a file managing interface within a specified directory and it can be used to upload, delete, preview, rename and edit your files. It allows the creation of multiple users and each user can have its own directory. It can be used as a standalone app or as a middleware.


Note

For this guide you should be familiar with the basic concepts of

License

File Browser is licensed under the Apache License 2.0

Installation

Download and extract the latest release

[isabell@stardust ~]$ cd ~/bin
[isabell@stardust bin]$ curl --location https://github.com/filebrowser/filebrowser/releases/latest/download/linux-amd64-filebrowser.tar.gz | tar -xzf - filebrowser

Initialize a new database

[isabell@stardust bin]$ mkdir ~/filebrowser && cd ~/filebrowser
[isabell@stardust filebrowser]$ filebrowser config init

Configuration

Note

You have to be in the same directory as the filebrowser.db file which you created before, in order to configurate it or else it will create a new one.

Create a folder where your files will be stored.

[isabell@stardust filebrowser]$ mkdir ~/my_files

Configure the address to listen on to and the root file directory, which you specified in the step before.

[isabell@stardust filebrowser]$ filebrowser config set --address 0.0.0.0
[isabell@stardust filebrowser]$ filebrowser config set --root $HOME/my_files

Create your admin account. Remember to replace <username> and <password> with your own values.

[isabell@stardust filebrowser]$ filebrowser users add '<username>' '<password>' --perm.admin

File Browser runs on port 8080 by default.

To make the application accessible from the outside, configure a web backend:

[isabell@stardust ~]$ uberspace web backend set / --http --port <port>
Set backend for / to port <port>; please make sure something is listening!
You can always check the status of your backend using "uberspace web backend list".
[isabell@stardust ~]$

Testing

At this point you should check if everything is working as expected by starting manually.

[isabell@stardust filebrowser]$ filebrowser --database $HOME/filebrowser/filebrowser.db
2022/10/03 19:31:02 Listening on [::]:8080

File Browser should now be accessible via https://isabell.uber.space. If everything is working fine, stop the command by pressing Ctrl-C.

Note

Changes to the configuration via the CLI can not be done while the server is running as the database access is blocked by the instance.

Add service

Create ~/etc/services.d/filebrowser.ini with the following content:

[program:filebrowser]
directory=%(ENV_HOME)s/filebrowser
command=filebrowser
startsecs=30
autostart=yes

After creating the configuration, tell supervisord to refresh its configuration and start the service:

[isabell@stardust ~]$ supervisorctl reread
SERVICE: available
[isabell@stardust ~]$ supervisorctl update
SERVICE: added process group
[isabell@stardust ~]$ supervisorctl status
SERVICE                            RUNNING   pid 26020, uptime 0:03:14
[isabell@stardust ~]$

DONE!


Tested with File Browser 2.22.4 on Uberspace 7.13.0

Written by: on4r <https://github.com/on4r>