Easy Self Host Icon

File Browser: Self-hosted File Managing Web App That Helps You Manage Files With Ease

Video

Transcript

Hello, this is channel Easy Self Host. In this video we are going to run FileBrowser,

one of my favorite self-hosted apps. FileBrowser can be used as a cloud drive service to manage

your personal files. It can also be used as a web UI to manage files on your server or volumes of

other apps. It supports multi-user and file sharing so it can be used among family members

or small organizations. Overall it's a simple yet powerful tool to manage your files. Let's get

started to run it using Docker Compose. This is the Docker Compose file we are going to use.

You can find the GitHub link in the description below. Like the other Docker Compose we'll be

using on this channel, it starts with declaring the Docker network for our proxy server. The proxy

server will handle HTTPS for us. We are going to create two Docker volumes. The root volume is for

storing directories managed by the FileBrowser. The database volume is for FileBrowser to store

its app data. Then let's define the FileBrowser service. The image is the official FileBrowser

image. Then there're some common parameters like container name, restart policy, and exposed ports.

We also need to bind the FileBrowser service to the proxy network since by default it won't

connect to any external network. The volume section is very useful for FileBrowser since

you can mount virtually anything to manage by the FileBrowser and we are going to explore this

later. To get started, let's first map the configuration file in this directory to the

container. You will see this JSON file later. Then let's bind the database volume to the database

directory in the container. And lastly let's bind the root volume to the /srv directory which we are

going to use as a FileBrowser root directory. The configuration file for FileBrowser is very simple.

It defines the port number the server will listen on and it defines the file path for the database.

Remember that we map the database volume to this directory. The root field defines the root

directory the FileBrowser will manage. We've mapped our root volume to this directory.

And then we need to set up the proxy server for the FileBrowser. I'm using Caddy so I'll add this

new caddy rule to map the new subdomain to the FileBrowser service. You can watch my last video

to see how the caddy server is set up. Now everything is ready we can go to the command

line and find the docker-compose directory. And here we run the command 'docker compose up -d'.

Now the FileBrowser service is up and running. We also need to bring up or restart the caddy service

to let it update its proxy config. If your caddy server is not started you can run 'docker compose up -d'.

But for mine it's already running so I'll run docker compose restart. Now we can go to the

browser and go to the subdomain we defined. Please also make sure the DNS is pointed to your

server before accessing it. Now we are in the FileBrowser web app. The initial username and

password are both 'admin'. After logging in you are seeing an empty directory here. You can start

adding folders or adding files. But I think the first thing to do is to go to the setting and

change the password for the admin user. It's under user management and you can edit the user here.

Let's only edit the password for now. You can of course do anything with the admin user but I think

it's better that we create a normal user with less privilege to make the system more secure.

We can take the auto creating user home directory in the setting to make the user have their own

directories. Then let's go to the user management again and create a new user. Let's define its

username and password and then click save to create a user. Now we can log in as the new user.

We can start doing something meaningful here like creating a document directory.

And in the directory we can drag and drop some files here. The FileBrowser has support for many

file formats so we can view the file content within the FileBrowser app. We can also share

our files to other people even without logging in and we can restrict the duration for this

file sharing to be valid and also secure the link with a password. Now to try if this link works

we can try to sign out our account and then go to this link instead. Then we'll be directed to this

file sharing web page and after we put in the password we can see the file. Let's try to open

the file in the browser. We can see the pdf we just shared. Then let's log in our account again

and let's try something new. With the flexibility of Docker Compose and Linux file system we can

mount any directory or file system we want to the FileBrowser. Here we mount the current Linux user's

home directory to a path in FileBrowser and this path is actually inside the ESH user scope. Then

let's go to the command line and run 'docker-compose up -d' again to refresh the Docker Compose file

and back to the web page we can refresh and then we see our home directory and inside this

directory we can see our files in the Linux file system. For example our Docker Compose file actually

lives in this directory and we can navigate to that directory and open the file. As you can see

the FileBrowser also has a file editor that you can edit files here which is very convenient if

you just want to edit a few files on your server and now you don't need to go to the command line.

I also use FileBrowser to manage files for other self-hosted services for example the media files

of my Jellyfin server. Jellyfin is a self-hosted service that can stream media to any of your

devices. Here on its web page we can see the media files in it but its web app doesn't have the

capability to manage files so instead I use FileBrowser to manage my media files. I store

Jellyfin media in a docker volume and I can mount it here to a directory under my user scope

and since this volume is an external volume we need to declare in the volume section.

Here I add a Jellyfin media volume and then I'll provide its original volume name and also tell

Docker Compose it's an external volume. With this setup let's refresh our Docker Compose file again

using the command docker compose up -d. Back to the FileBrowser app let's refresh the page again

and here we can see the media directory which contain the media file that's already on the

Jellyfin server. Let's add some new video files to this directory and you can see there is also

a nice progress indicator for file uploads. With all the files uploaded we can head to the Jellyfin

server. Now in the library you can see my new edited videos and we can play the video files

inside the Jellyfin web app. I'll create a video about Jellyfin later. There are some other

smaller features that I want to show you. If you are logging in using admin account you can see

all the user directories but the normal user can't see the root directory if you don't give them

permission. In the setting you can actually allow users to sign up by themselves and then you can

see the create account option in the login page. You can also configure customized branding for

the FileBrowser server. For example I have this logo file in a branding directory and then I can

set up the customized branding in the setting by giving the directory of my assets. We can also

customize the instance name and the theme. With all this set up the next time you go to the login

page will see the new look of your FileBrowser. That's all for this video. Please consider

subscribing for content like this. You can find the configuration files in this video on github

and the link is in description below. Thank you for watching!

Resources