This works on Debian and Debian-based distributions.

  1. Create a configuration file named filebrowser.json. Here you specify the IP address, port, and directory:

    {
              "port": 8080,
              "baseURL": "",
              "address": "000.000.000.000",
              "log": "stdout",
              "database": "/etc/filebrowser.db",
              "root": "/var/www"
    }
  2. Create a systemd service file named filebrowser.service. This ensures Filebrowser starts automatically on server boot or restart:

    [Unit]
    Description=File Browser
    After=network.target
    
    [Service]
    ExecStart=/usr/local/bin/filebrowser -c /etc/filebrowser.json
    
    [Install]
    WantedBy=multi-user.target
  3. Create a shell script (e.g. example.sh) in the same directory as the other two files and insert the following content:

    #!/bin/bash
    
    echo "This script will automatically install Filebrowser!"
    sleep 1
    echo "Updating package sources..."
    sleep 0.5
    
    apt update && apt full-upgrade -y && apt install curl -y
    sleep 1
    
    echo "Updates complete."
    sleep 0.5
    echo "Downloading and installing Filebrowser..."
    sleep 0.5
    
    curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
    
    sleep 0.5
    echo "Copying configuration file to /etc/filebrowser.json ..."
    sleep 0.5
    
    cp filebrowser.json /etc/filebrowser.json
    
    echo "Copying service file to /etc/systemd/system/filebrowser.service ..."
    sleep 0.5
    
    cp filebrowser.service /etc/systemd/system/filebrowser.service
    
    echo "Enabling and starting the Filebrowser service..."
    sleep 0.5
    
    systemctl enable filebrowser.service
    systemctl start filebrowser.service
    
    sleep 0.5
    
    echo "DONE! Filebrowser is now running!"
    sleep 0.5
    echo "After changes to /etc/filebrowser.json, run:"
    echo "systemctl restart filebrowser.service"
    
    echo "Default login:"
    echo "User: admin"
    echo "Password: admin"
    echo "Please change the password after the first login!"
  4. Make sure you are logged in as root. Then execute the script with the following command:

    bash example.sh

You can now access Filebrowser via the IP address and port in your web browser.

Default login:

Please change the password after the first login!