How to Install Filebrowser from https://filebrowser.org/ on Debian Latest
Filebrowser is a simple web-based file management tool that allows users to manage files and folders through a graphical web interface. In this tutorial, we will explain how to install Filebrowser on Debian Latest.
Prerequisites
Before you start, you need to have the following:
- A server running Debian Latest
- A user account with sudo privileges
- A web browser
Step 1: Update the System
Before installing any new packages, it's important to update your system to the latest version.
sudo apt update
sudo apt upgrade
Step 2: Install Dependencies
Filebrowser requires some dependencies to be installed. To install these dependencies, run the following command:
sudo apt install curl wget apt-transport-https gnupg2 software-properties-common
Step 3: Install Nginx
Next, we need to install Nginx web server to host the Filebrowser. Run the following command to install Nginx:
sudo apt install nginx
Once installation is complete, start the Nginx service:
sudo systemctl start nginx
Step 4: Install Filebrowser
To install Filebrowser, first download the latest release of Filebrowser using the following command:
wget https://github.com/filebrowser/filebrowser/releases/download/v2.15.0/linux-amd64-filebrowser.tar.gz
Next, extract the downloaded file using the following command:
tar -xvf linux-amd64-filebrowser.tar.gz
Next, move the extracted file to the /usr/bin directory using the following command:
sudo mv filebrowser /usr/bin
Step 5: Configure Filebrowser
Next, we need to create a systemd service file to configure Filebrowser. Create a new file with the following command:
sudo nano /etc/systemd/system/filebrowser.service
Paste the following contents into the file:
[Unit]
Description=File Browser
After=syslog.target network.target
[Service]
User=root
Group=root
Environment=FB_ROOT=/home/user/files
ExecStart=/usr/bin/filebrowser -c /home/user/.filebrowser.json
[Install]
WantedBy=multi-user.target
Make sure to change the following variables:
UserandGroupto the user and group you want to run Filebrowser as.FB_ROOTto the path of the directory you want to serve files from.ExecStartto the path of the configuration file you want to use.
Save the file and close it.
Then, reload the systemd service with the following command:
sudo systemctl daemon-reload
Enable the Filebrowser service to start at boot:
sudo systemctl enable filebrowser.service
Finally, start the Filebrowser service:
sudo systemctl start filebrowser.service
Step 6: Configure Nginx
Next, we need to configure Nginx to work with Filebrowser. Create a new Nginx configuration file with the following command:
sudo nano /etc/nginx/conf.d/filebrowser.conf
Paste the following contents into the file:
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Make sure to replace example.com with your domain name.
Save and close the file.
Then, test Nginx configuration and restart Nginx with the following commands:
sudo nginx -t
sudo systemctl restart nginx
Step 7: Access Filebrowser
Finally, we can access Filebrowser through a web browser. Open your web browser and navigate to http://example.com. You should see the Filebrowser login page.
Log in with a user account that has access to the directories specified in the configuration file.
Congratulations! You have successfully installed Filebrowser on Debian Latest.