How to Install File Sharing on FreeBSD Latest

In this tutorial, we will be installing File Sharing, which is a file-sharing web application, on FreeBSD Latest. File Sharing is available for download from https://github.com/axeloz/filesharing.

Before we begin, please make sure that you have the following:

Once you have these, follow the steps below to install File Sharing:

  1. Update FreeBSD Latest. Run the following command:
pkg update && pkg upgrade
  1. Install Apache web server. Run the following command:
pkg install apache24
  1. Start the Apache service. Run the following command:
service apache24 start
  1. Install PHP 7.4. Run the following command:
pkg install php74 php74-bcmath php74-bz2 php74-ctype php74-curl php74-dom php74-exif php74-fileinfo php74-filter php74-ftp php74-gd php74-gettext php74-hash php74-iconv php74-json php74-ldap php74-mbstring php74-mysqli php74-opcache php74-pdo php74-pdo_mysql php74-pear php74-pecl-igbinary php74-pecl-imagick php74-pecl-msgpack php74-pecl-redis php74-posix php74-session php74-simplexml php74-sockets php74-tokenizer php74-xml php74-xmlreader php74-xmlwriter php74-xsl php74-zip php74-zlib
  1. Install MySQL server. Run the following command:
pkg install mysql80-server
  1. Start the MySQL service. Run the following command:
service mysql-server start
  1. Secure the MySQL installation. Run the following command:
mysql_secure_installation
  1. Clone the File Sharing repository from GitHub. Run the following command:
git clone https://github.com/axeloz/filesharing.git /usr/local/www/apache24/data/filesharing
  1. Create a MySQL database and user for File Sharing. Run the following commands:
mysql -u root -p
CREATE DATABASE filesharing;
CREATE USER 'filesharing'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON filesharing.* TO 'filesharing'@'localhost';
FLUSH PRIVILEGES;
exit
  1. Copy the configuration file and modify it with your MySQL credentials. Run the following command:
cp /usr/local/www/apache24/data/filesharing/config.inc.sample.php /usr/local/www/apache24/data/filesharing/config.inc.php
vi /usr/local/www/apache24/data/filesharing/config.inc.php
  1. In the configuration file, modify the following values:
$db_name = "filesharing";
$db_user = "filesharing";
$db_pass = "password";
  1. Allow Apache to write to the upload directory. Run the following command:
chown -R www:www /usr/local/www/apache24/data/filesharing/upload
  1. Restart Apache. Run the following command:
service apache24 restart
  1. Open your web browser and navigate to your server's IP address followed by /filesharing. For example, http://192.168.0.100/filesharing.

  2. You should now be able to login to File Sharing using the default username and password:

Congratulations! You have successfully installed File Sharing on FreeBSD Latest.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!