Docker With File Browser#
What Is The File Browser?#
filebrowser
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.- More information
Create File Browser With Docker#
- Let's create a file name
docker-compose.yml
, then add scripts as below:
docker-compose.yaml | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
- Then run two commands below to create 2 empty files.
1 2 |
|
- In the
environment
, we have:PUID=$(id -u)
: Retrieves the user ID (UID) of the current user on the host system to ensure the container has the correct permissions.PGID=$(id -g)
: Retrieves the group ID (GID) of the current user on the host system to ensure the container has the correct group permissions.
- In the
volumes
, we have:/home/duc/share/:/srv
: Mounts the host directory/home/duc/share/
to/srv
in the container, allowing file access through the File Browser UI../filebrowser.db:/database.db
: Mounts the localfilebrowser.db
file to/database.db
in the container to persist the database between restarts../settings.json:/config/settings.json
: Mounts the localsettings.json
configuration file to/config/settings.json
in the container to customize File Browser settings.
- In the
security_opt
, we have:no-new-privileges:true
: Prevents the container from gaining additional privileges, even if it tries to do so, enhancing security by restricting privilege escalation.
Testing#
- Now you can use command
docker-compose up -d
to start yourFile Browser
server. - Then we can access browser at
localhost:7979
and login to access the dashboard.
- By default the username is
admin
and password isadmin
. - Next, we can test by upload a file and then you should see it in the shared folder.
- If your machine has many drive, you can mount that drive to machine and use
file browser
to link with it. Then if you are using VPN liketailscale
then you can access thefile browser
web page on any device and you can download and upload files from that drive.