How to Install Filebrowser on OpenBSD
Filebrowser is an open-source app that provides a web-based file manager. In this tutorial, we will teach you how to install Filebrowser on OpenBSD using the command line. Here's a step-by-step guide.
Prerequisites
- A working OpenBSD operating system
- A terminal with root access
- Git
Steps
Open the terminal and log in as root.
Install Git using the command below.
pkg_add gitCreate a new user that will run Filebrowser, let's call it
filebrowser.adduserMake the
filebrowseruser the owner of/usr/local.chown -R filebrowser /usr/localSwitch to the
filebrowseruser.su - filebrowserClone the Filebrowser repository using Git.
git clone https://github.com/filebrowser/filebrowser.gitChange the current directory to the cloned Filebrowser repository.
cd filebrowserBuild Filebrowser using the make command.
GOOS=OpenBSD GOARCH=amd64 make buildYou will now have a binary in the
dist/directory. Copy the binary to the/usr/local/bin/directory.cp dist/filebrowser /usr/local/bin/Exit the
filebrowseruser.
exit
- Configure the
rc.localfile to start Filebrowser on boot.
vi /etc/rc.local
Add the following line to the file.
su filebrowser -c "/usr/local/bin/filebrowser -r /usr/local -p 8080 >/dev/null 2>&1 &"
Save and close the file.
- Reboot the system.
reboot
- After the system has rebooted, Filebrowser will be available on
http://localhost:8080.
Congratulations! You have successfully installed Filebrowser on OpenBSD.