Install & testing
First we have to set up some folders and download and install filebrowser (change the ip address to that of your rpi and a port of your choosing):
cd /opt
sudo mkdir filebrowser
cd filebrowser
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
sudo filebrowser -r /opt/filebrowser -a 192.168.0.10 -p 8083
And head over to your browser and hit up 192.168.0.10:8083/ to confirm it's working, you can login with admin:admin
Setting up as a service
If we are happy it's working, return to the command line and cancel (ctrl-C) out of filebrowser, then:
sudo nano filebrowser.json
and paste this configuration:
{ "port": 8083, "baseURL": "", "address": "192.168.0.10", "log": "stdout", "database": "/opt/filebrowser/filebrowser.db", "root": "/var/www/files/" }
Ctrl-O, [enter] and Crtl-X to save and exit, now we can set a few permissions:
cd .. sudo chown pi:www-data -R filebrowser sudo chmod 775 -R filebrowser
This assumes you already have www-data user and group setup and user pi is a member of the www-data group. Now onto setting filebrowser as a service:
sudo nano /etc/systemd/system/filebrowser.service
then paste inthe following:
[Unit] Description=File Browser After=network.target [Service] User=www-data ExecStart=/usr/local/bin/filebrowser -c /opt/filebrowser/filebrowser.json [Install] WantedBy=multi-user.target
Ctrl-O, [enter] and Crtl-X to save and exit, now we can start up the server:
sudo systemctl enable filebrowser.service sudo systemctl start filebrowser.service
give it a few seconds and we can check it's working:
systemctl status filebrowser.service
You don't have to worry about creatng a folder before hand, just create a test/file when you get there so head over to your browser to check it out (and change the password).