How to install File Browser on Ubuntu

File Browser is a web file browser that provides you with a web interface to upload, create, preview, rename, edit or delete your files and folders on your Ubuntu server.

It also allows the creation of multiple users, and each user can have their own directory.
I use it on some of my servers, such as Web or NGINX server, it is a simple was to create, access, update or preview your files.

Although File Browser supports multiple platforms, in this article we concentrate on Ubuntu, getting it installed and running on Boot.

1 – Install File Browser

Once connected to your server via SSH run “sudo -i“, otherwise, please add “sudo” before each of the commands in instructions below.

To install File Browser, simply run the below command:

curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash

2 – Run File Browser

To test it run the command below:

filebrowser -p 8080 -a 192.168.10.22 -r /path/to/your/folder
  • -p is the port it will listen on
  • -a is the IP address to listen on (your server’s IP)
  • -r is the root directory that you’d like to access. On a web server that would often be “/var/www/html/

Now test it, go to “http://yourServersIP:8080” and login with below:

  • Username: admin
  • Password: admin

You may notice that you cannot type any other commands o your SSH session, just push “CTRL + C” on your keyboard, unfortunately this will also stop File Browser.

Continue reading, so to configure File Browser to run as a service.

3 – Configure File Browser

By configuring File Browser we do not need to enter all the details at every start, to do that we will save all the configuration in a “.json” file, then call it when starting File Browser.

Create a new file, the “.json” configuration file in “/etc/“, and add your configuration to it.

Start by running the command below;

nano /etc/filebrowser.json

– If you get “-bash: nano: command not found“, then run “apt install nano” to install “nano“.

This will open the nano editor, then paste the below into it, and edit “port“, “address” and “root” accordingly;

{
  "port": 8080,
  "baseURL": "",
  "address": "192.168.10.22",
  "log": "stdout",
  "database": "/etc/filebrowser.db",
  "root": "/var/www/html"
}

To save your file press “CTRL + O“, to close the editor press “CTRL + X“.

Now you can run the below command to start File Browser using the settings stored in the file above.

filebrowser -c /etc/filebrowser.json

Again, you cannot type any other commands o your SSH session, just push “CTRL + C” on your keyboard, unfortunately this will also stop File Browser.

Follow the next steps to configure File Browser to run as a service.

4 – Run File Browser on Startup/Boot

To start File browser as a service, start by creating “filebrowser.service” in “/etc/systemd/system” by running the below;

nano /etc/systemd/system/filebrowser.service

Then paste into it the below;

[Unit]
Description=File Browser
After=network.target
[Service]
ExecStart=/usr/local/bin/filebrowser -c /etc/filebrowser.json
[Install]
WantedBy=multi-user.target

Now save your file press “CTRL + O“, to close the editor press “CTRL + X“.

Finally, run the below to enable this service to start at boot.

systemctl enable filebrowser.service

Before you reboot your machine, you can start and stop your File Browser service using the commands below for testing;

systemctl start filebrowser.service
systemctl stop filebrowser.service

And that is it, go ahead and reboot your machine, the service should start and be available once Ubuntu has booted.

If you need to access multiple directories, and not expose the root directory, see article below:
Using File Browser with multiple paths or directories

Buy me a coffee

You may also like...

1 Response

  1. Ashkan says:

    Awesome tutorial. Thanks!!

Leave a Reply

Your email address will not be published. Required fields are marked *