FileRun is a versatile open-source file-sharing application designed for Linux-based operating systems. It offers a secure and convenient way to share and sync files over the internet, similar to popular cloud storage platforms like Google Drive, iCloud, and Dropbox. With FileRun, you can host your own file sharing solution on the cloud and access your files from anywhere.
In this tutorial, we will guide you through the process of installing FileRun with Apache and Let’s Encrypt SSL on Ubuntu 22.04. By the end of this article, you will have a fully functional FileRun server setup on your Ubuntu system.
Prerequisites
Before we begin, make sure you have the following:
- A server running Ubuntu 22.04.
- A valid domain name pointed to your server’s IP address.
- Root access to the server.
Step 1: Install Apache, MariaDB, and PHP
To install FileRun, we need to set up the necessary dependencies. FileRun is written in PHP and uses MariaDB as the database backend. Apache will serve as the web server. Let’s start by installing Apache and MariaDB:
sudo apt-get update sudo apt-get install apache2 mariadb-server mariadb-client -y
Once Apache and MariaDB are installed, we need to install PHP and its required extensions. However, Ubuntu 22.04 ships with PHP 8.1 by default, and FileRun currently supports PHP 7.4. Therefore, we’ll need to add the PHP Ondrej repository to our system:
sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https -y sudo add-apt-repository ppa:ondrej/php sudo apt update sudo apt install php7.4 libapache2-mod-php7.4 imagemagick ffmpeg php7.4-imagick php7.4-mysql php7.4-fpm php7.4-common php7.4-gd php7.4-json php7.4-curl php7.4-zip php7.4-xml php7.4-mbstring php7.4-bz2 php7.4-intl unzip -y
In addition to PHP, we also need to install the IonCube loader, which is required by FileRun:
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz sudo tar -xzf ioncube_loaders_lin_x86-64.tar.gz -C /usr/lib/php
Next, create the IonCube configuration file:
sudo nano /etc/php/7.4/apache2/conf.d/00-ioncube.ini
Add the following line to the file:
zend_extension = /usr/lib/php/ioncube/ioncube_loader_lin_7.4.so
Save and close the file. Now, let’s create a PHP configuration file specifically for FileRun:
sudo nano/etc/php/7.4/apache2/conf.d/filerun.ini
Add the following settings to the file:
expose_php = Off error_reporting = E_ALL&~E_NOTICE display_errors = Off display_startup_errors = Off log_errors = On ignore_repeated_errors = Off allow_url_fopen = On allow_url_include = Off variables_order = "GPCS" allow_webdav_methods = On memory_limit = 128M max_execution_time = 300 output_buffering = Off output_handle r = "" zlib.output_compression = Off zlib.output_handle r = "" safe_mode = Off register_globals = Off magic_quotes_gpc = Off upload_max_filesize = 20M post_max_size = 20M enable_dl = Off disable_functions = "" disable_classes = "" session.save_handler = files session.use_cookies = 1 session.use_only_cookies = 1 session.auto_start = 0 session.cookie_lifetime = 0 session.cookie_httponly = 1 date.timezone = "UTC"
Save and close the file. Finally, restart the Apache service to apply the changes:
sudo systemctl reload apache2
Step 2: Create a Database for FileRun
Now that we have the necessary components installed, let’s create a database for FileRun. First, secure the MariaDB installation and set the root password:
sudo mysql_secure_installation
Follow the prompts to set your desired root password and answer the security-related questions. Once that’s done, log in to the MariaDB shell:
sudo mysql -u root -p
Enter your root password when prompted. Now, create a new database and user for FileRun:
CREATE DATABASE filerun; CREATE USER 'filerun'@'localhost'IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON filerun.*TO'filerun'@'localhost'; FLUSH PRIVILEGES; EXIT;
Make sure to replace ‘password’ with a strong password of your choice. With the database set up, we can move on to the next step.
Step 3: Download and Install FileRun
To download FileRun, use the following command:
wget -O FileRun.zip https://filerun.com/download-latest
Once the download is complete, extract the zip file:
sudo unzip FileRun.zip -d /var/www/html/filerun/
Now, let’s set the appropriate ownership and permissions:
sudo chown -R www-data:www-data /var/www/html/filerun sudo chmod -R 755 /var/www/html/filerun
FileRun is now installed on your server.
Step 4: Create an Apache Virtual Host for FileRun
We need to create an Apache virtual host configuration file for FileRun. Open a new file with the following command:
sudo nano /etc/apache2/sites-available/filerun.conf
Add the following lines to the file:
<VirtualHost *:80> ServerName filerun.example.com DocumentRoot /var/www/html/filerun <Directory "/var/www/html/filerun"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/filerun.error.log CustomLog ${APACHE_LOG_DIR}/filerun.access.log combined </VirtualHost>
Save and close the file. Next, activate the Apache virtual host and enable the rewrite module:
a2ensite filerun.conf
a2enmod rewrite
Finally, restart the Apache service:
systemctl restart apache2
You can verify the status of Apache with the following command:
systemctl status apache2
If everything is set up correctly, you should see that Apache is active and running.
Step 5: Access the FileRun Web UI
Now that FileRun is installed and the virtual host is configured, you can access the FileRun web interface through your web browser. Open your preferred browser and enter the URL http://filerun.example.com
(replace filerun.example.com
with your actual domain name). You should be redirected to the FileRun setup page.
Click on the “Next” button to proceed. On the server requirements check page, click “Next” again. You will then be prompted to configure the database settings. Enter the previously created database name, username, and password, and click “Next” to continue.
Once the installation process is complete, you will see the final setup page. Click “Next” to proceed. You will then be directed to the FileRun login page.
Enter your admin username, password, and click “Sign in” to log in. Congratulations! You have successfully installed FileRun and can now access the FileRun dashboard.
Step 6: Secure FileRun with Let’s Encrypt SSL
To secure your FileRun installation with an SSL certificate from Let’s Encrypt, follow these steps:
- Install the Certbot client:
sudo apt-get install python3-certbot-apache -y
- Obtain and install the SSL certificate:
sudo certbot --apache -d filerun.example.com
You will be prompted to enter your email address and agree to the terms of service. Follow the prompts until the installation is complete.
- Choose whether to redirect HTTP traffic to HTTPS. It is recommended to redirect all traffic to HTTPS for better security. Select option 2 and hit Enter.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for new sites or if you're confident your site works on HTTPS.
- Once the redirect is enabled, you will receive a message confirming the successful installation of the SSL certificate.
Congratulations! Your FileRun installation is now secured with Let’s Encrypt SSL.
Conclusion
In this tutorial, we have walked you through the process of installing FileRun with Apache and Let’s Encrypt SSL on Ubuntu 22.04. By following these steps, you have set up a fully functional FileRun server. You can now enjoy the benefits of hosting your own file sharing solution in the cloud, with secure access to your files from anywhere.
If you are looking for reliable and efficient cloud hosting solutions, consider Shape.host’s Linux SSD VPS services. They offer scalable and secure hosting options to meet your business needs.
Now go ahead and explore the features of FileRun and start sharing and syncing your files, music, and photos with ease. Enjoy the power and flexibility of FileRun on your Ubuntu server!