Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
  • News
  • Artificial Intelligence
  • Applications
  • Linux
No Result
View All Result
Cloudbooklet
No Result
View All Result
Home Linux

How to Install File Browser on Ubuntu 22.04 with Nginx

by Cloudbooklet
10 months ago
in Linux
How To Install File Browser On Ubuntu 22.04
ShareTweetSendShare
Readers like you help support Cloudbooklet. When you make a purchase using links on our site, we may earn an affiliate commission.

File Browser is a file managing application which provides a modern interface within a specified directory to upload, delete, preview, rename and edit your files. It also allows creation of multiple users and and assign each user their own directory. With this application you can eliminate the use of chroot setup which is used for […]

ADVERTISEMENT

File Browser is a file managing application which provides a modern interface within a specified directory to upload, delete, preview, rename and edit your files. It also allows creation of multiple users and and assign each user their own directory. With this application you can eliminate the use of chroot setup which is used for managing files alone.

In this guide you are going to learn how to install File browser on Ubuntu 22.04 and configure it with Nginx reverse proxy. We will also create a configuration file to specify the root directory and a systemd file to start file browser as a service using a specific user which Nginx uses www-data.

Initial Setup

Start by updating your server packages to the latest version available.

ADVERTISEMENT
sudo apt update
sudo apt upgrade -y

Install File Browser

Execute the below command to install File Browser.

You might also like

&Quot; Systemd Service On Linux

How to Create a New systemd Service on Linux: A Step-by-Step Guide

3 months ago
List Groups In Linux

How to List Groups in Linux: A Guide for Beginners

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

Once file browser is installed, you can start it using the filebrowser command to check how it works.

filebrowser -r /path/to/your/files

By default file browser runs on port 8080. You can use your IP address with port 8080 to view the user interface in your browser.

ADVERTISEMENT

Create Systemd Configuration

Now we shall create a systemd configuration file so that you can use File Browser as a service.

Create a new file named filebrowser.service

ADVERTISEMENT
sudo nano /etc/systemd/system/filebrowser.service

Add the following to the file.

[Unit]
Description=File browser: %I
After=network.target

[Service]
User=www-data
Group=www-data
ExecStart=/usr/local/bin/filebrowser -c /etc/filebrowser/default.json

[Install]
WantedBy=multi-user.target

Save and Exit the file.

ADVERTISEMENT

Create File Browser Configuration

Create a new directory mentioned in your systemd file for file browser.

sudo mkdir /etc/filebrowser

Create a new file named default.json

ADVERTISEMENT
sudo nano /etc/filebrowser/default.json

Add the following to the file.

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

Save the file and exit.

The filebrowser.db should be located in your home directory ~/

Move the file to the directory we created above.

sudo mv ~/filebrowser.db /etc/filebrowser

Configure correct permissions for database.

sudo chown -R www-data:www-data /etc/filebrowser/filebrowser.db

Now we have all configurations in place.

Start File browser

Enable file browser to start at system boot.

sudo systemctl enable filebrowser

Now you can start filebrowser.

sudo service filebrowser start

You can check the status using the below command.

sudo service filebrowser status
● filebrowser.service - File browser: 
     Loaded: loaded (/etc/systemd/system/filebrowser.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-11-21 09:12:33 UTC; 4min 21s ago
   Main PID: 462 (filebrowser)
      Tasks: 7 (limit: 1149)
     Memory: 14.0M
        CPU: 34ms
     CGroup: /system.slice/filebrowser.service
             └─462 /usr/local/bin/filebrowser -c /etc/filebrowser/default.json

Nov 21 09:12:33 filemanager systemd[1]: Started File browser: .
Nov 21 09:12:38 filemanager filebrowser[462]: 2022/11/21 09:12:38 Using config file: /etc/filebrowser/default.>
Nov 21 09:12:38 filemanager filebrowser[462]: 2022/11/21 09:12:38 Listening on [::]:8080
Nov 21 09:13:47 filemanager filebrowser[462]: 2022/11/21 09:13:47 /api/renew: 401 127.0.0.1 <nil>

Install and Configure Nginx

Install Nignx using the below command.

sudo apt install nginx

Remove default Nginx configuration.

sudo rm /etc/nginx/sites-available/default
sudo rm /etc/nginx/sites-enabled/default

Create new Nginx configuration

sudo nano /etc/nginx/sites-available/filebrowser.conf

We will use a subdomain to configure our file browser.

Paste the following

server {
     listen [::]:80;
     listen 80;

     server_name sub.domain.com;

     client_max_body_size 48M;

     location / {
         proxy_pass http://localhost:8080;
         proxy_http_version 1.1;
         proxy_set_header Upgrade $http_upgrade;
         proxy_set_header Connection 'upgrade';
         proxy_set_header Host $host;
         proxy_cache_bypass $http_upgrade;
    }
}

You can update the client_max_body_size 48M to whichever size you wish to have the upload size.

Save and exit the file.

Enable your configuration by creating a symbolic link

sudo ln -s /etc/nginx/sites-available/filebrowser.conf /etc/nginx/sites-enabled/filebrowser.conf

Check your Nginx configuration and restart Nginx

sudo nginx -t
sudo service nginx restart

Now you can visit your sub-domain name in browser, you should view the the login page.

These are the default login details.

user: admin
pass: admin
File Browser

Create SSL certificate and enable HTTP/2

HTTPS
HTTPS is a protocol for secure communication between a server (instance) and a client (web browser). Due to the introduction of Let’s Encrypt, which provides free SSL certificates, HTTPS are adopted by everyone and also provides trust to your audiences.

sudo apt install python3-certbot-nginx

Now we have installed Certbot by Let’s Encrypt for Ubuntu 22.04, run this command to receive your certificates.

sudo certbot --nginx --redirect --no-eff-email --agree-tos -m [email protected] -d sub.domain.com

Conclusion

Now you have learned how to install File Browser on Ubuntu 22.04 with Nginx reverse proxy.

Thanks for your time. If you face any problem or any feedback, please leave a comment below.

Tags: NginxUbuntu 22.04
Share8Tweet5SendShare
Cloudbooklet

Cloudbooklet

Comments 1

  1. Avatar Of Paul Paul says:
    3 months ago

    Thanks for the tutorial. Can you help to setup filebrowser with no authentication. I’ve tried adding
    “noauth”: true to default.jason and running filebrowser config set –auth.method=noauth
    but that didn’t work.

    Also, if you wanted to run the server at a different port (I’ve already have something running on 80 and 8080) what changes would I have to make in filebrowser and nginx config files.

    Reply

Leave a Reply Cancel reply

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

Related Posts

Hostname In Linux

How to Modify the Hostname in Linux

3 months ago
Linux Systems

Linux systems Hacked with OpenSSH Malware

3 months ago
Install Iptables On Ubuntu

How to Install Iptables on Linux

3 months ago
Open Port In Linux

How to Open Port in Linux: Simple Step-by-Step Guide

3 months ago

Follow Us

Trending Articles

Block Youtube Ads

How to Block YouTube Ads on Android TV in 2023 (6 Easy Methods)

September 20, 2023

How to Delete Netflix Account Permanently

Create a Professional Website with Wix AI Website Builder

10 Best AI Song Generator in 2023 (Free and Paid)

10 Best Minecraft Server Hosting Providers in 2023

7 Best AI Girl Generators for Creating Realistic and Beautiful AI Girls

Popular Articles

How To Use Midjourney Vary Region Editor To Create Stunning Images

How to Use Midjourney Vary Region Editor to Create Stunning Images

August 25, 2023

7 Best Deepswap AI Free Online Tools to Create FaceSwap Videos and Photos

9 Best AI YouTube Video Summarizers Online

How to Use Canva on ChatGPT: A Step-by-Step Guide

10 Best AI Drawing Generators to Create Stunning Art

Google Duet AI: A Powerful Tool for Gmail, Docs, Sheets, Slides, Meet

Subscribe Now

loader

Subscribe to our mailing list to receives daily updates!

Email Address*

Name

Cloudbooklet Logo

Welcome to our technology blog, where we explore the latest advancements in the field of artificial intelligence (AI) and how they are revolutionizing cloud computing. In this blog, we dive into the powerful capabilities of cloud platforms like Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure, and how they are accelerating the adoption and deployment of AI solutions across various industries. Join us on this exciting journey as we explore the endless possibilities of AI and cloud computing.

  • About
  • Contact
  • Disclaimer
  • Privacy Policy

Cloudbooklet © 2023 All rights reserved.

No Result
View All Result
  • News
  • Artificial Intelligence
  • Applications
  • Linux

Cloudbooklet © 2023 All rights reserved.