As root execute the following.
- curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
That’s it for installation!
- filebrowser -p 8080 -a 220.127.116.11 -r /path/to/your/files
-p is the port to listen on
-a is the IP address to listen on
-r is the root directory that you’d like to serve. In most cases on Unix, this is /var/www/html/
In a web browser, you can go to your IP address or domain name with the port that you specified. The default credentials are as follows.
AUTO START ON REST
Since the database is automatically created for us, let’s create a file in the /etc/ directory called filebrowser.json
Please update the configuration file with values that are appropriate for your system.
Now execute this command to activate filebrowser….
- filebrowser -c /etc/filebrowser.json
How to Run filebrowser on Boot
Let’s make a system daemon to startup filebrowser when the system starts up. These instructions were written with an Ubuntu operating systems in mind.
Create the following file at /etc/systemd/system/filebrowser.service
ExecStart=/usr/local/bin/filebrowser -c /etc/filebrowser.json
To enable and start the filebrowser service, run the following commands.
- systemctl enable filebrowser.service
- systemctl start filebrowser.service
How to Install an SSL Certificate for filebrowser
This can be a little fiddly.
You will need a Domain and in the A in records point it to a Public IP address, set up the port forwarding from port 80 to the internal IP port 80 (this is just for now)
Install a web server
- apt install apache2
Step 1 – Installing Certbot
Certbot is a tool to obtain certificates from Let’s Encrypt and configure on your web server. Snap package is the easist way for installing certbot on Ubuntu system.
You might have to run this first…
- sudo apt update
- sudo apt install snapd
- sudo snap install snap-store
- sudo snap install –classic certbot
if you get an error you can try
- sudo apt install fuse squashfuse
NOTE: Snaps rely on certain Linux kernel features which are not available under containerized servers like those running under openvz, so if you get an error use,
- sudo apt install certbot
- certbot certonly –apache -d your_domain_name
when installed copy the following…
Congratulations! Your certificate and chain have been saved at:
Your key file has been saved at:
Your certificate will expire on 2022-10-13. To obtain a new or
tweaked version of this certificate in the future, simply run
certbot again. To non-interactively renew *all* of your
certificates, run “certbot renew”
now add them to the filebrowser.json
- cd etc
- nano filebrowser.json
- systemctl restart filebrowser.service
- systemctl status filebrowser.service
Now change the port forwarding to
port 443 & port 8080
port 443 is use by the web browser for SSL.