Guides 11792 Published by

The guide walks through turning a Debian 11 server into a FileRun file‑sharing hub, starting with updating packages and installing an Apache‑PHP‑MariaDB stack before enabling those services at boot. It then hardens PHP by raising upload limits, creates a dedicated database for FileRun, downloads the application archive to the web root, and sets proper ownership so Apache can write its logs. A custom virtual host is configured in Apache, followed by running the web installer to supply the database credentials, and optional HTTPS support is added with Certbot while basic security headers are placed in an .htaccess file for production safety. Finally, it suggests testing the installation by logging in, uploading a file, and checking logs for errors, reminding users that missing PHP modules or wrong permissions usually cause the most headaches.



Installing FileRun on Debian 11: A Quick, No‑Nonsense Guide

If you’re looking to turn your Debian 11 server into a slick file‑sharing hub, this walk‑through shows you how to get FileRun up and running in under half an hour—no fluff, no fancy bells and whistles.

1. Prep the Server
sudo apt update && sudo apt upgrade -y

Debian ships with a stale snapshot of packages that can bite you later. Updating first keeps Apache, MySQL, PHP, and the rest on a sane baseline.

sudo apt install apache2 php libapache2-mod-php php-mysql php-gd \
                 php-xml php-curl php-zip php-intl php-bcmath mariadb-server \
                 unzip -y

FileRun needs a LAMP stack. MariaDB is the drop‑in replacement for MySQL that ships with Debian 11 and behaves better under heavy load.

sudo systemctl enable --now apache2 mariadb

Enable services at boot—no more “I forgot to start it” headaches.

2. Harden PHP

Open /etc/php/$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')/apache2/conf.d/00-filerun.ini and add:

file_uploads = On
upload_max_filesize = 512M
post_max_size = 520M
max_execution_time = 300
memory_limit = 256M

FileRun will be dealing with big uploads. Without these tweaks, the server would just abort halfway through a file transfer.

3. Create the Database
sudo mysql -u root

Then inside MySQL:

CREATE DATABASE filerun CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
GRANT ALL PRIVILEGES ON filerun.* TO 'filerun'@'localhost' IDENTIFIED BY 'StrongPassword!';
FLUSH PRIVILEGES;
EXIT;

FileRun’s installer will read the DB name, user and password. If you skip this step, the web UI will complain that it can’t connect.

4. Pull Down FileRun
cd /tmp
wget https://github.com/filerun/filerun/releases/download/v3.7.1/FileRun-3.7.1.zip
unzip FileRun-3.7.1.zip -d /var/www/html/

Installing under /var/www/html/ keeps everything in the web root, and wget + unzip are lighter than pulling from GitHub with git clone.

sudo chown -R www-data:www-data /var/www/html/FileRun

Apache runs as www-data. Without correct ownership, FileRun can’t write logs or create its own config.

5. Configure Apache Virtual Host

Create /etc/apache2/sites-available/filerun.conf:

<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>
sudo a2ensite filerun
sudo systemctl reload apache2

A dedicated vhost keeps logs tidy and makes it easier to enable HTTPS later.

6. Run the Web Installer

Open your browser, hit http://filerun.example.com (or the IP if you’re still playing locally). The FileRun wizard will ask for:

  • DB name: filerun
  • Username: filerun
  • Password: StrongPassword!

The installer does a few sanity checks—like verifying PHP extensions—and creates config.php. Skipping it results in a 500 error that looks like the server is broken.

> I’ve seen this happen after a bad update of Apache that removed the mod_rewrite module. FileRun’s installer will immediately warn you, so keep an eye on those messages.

7. Secure with HTTPS (Optional but Highly Recommended)
sudo apt install certbot python3-certbot-apache -y
sudo certbot --apache -d filerun.example.com

FileRun stores passwords and tokens in the database, so encrypting traffic protects those secrets. Certbot is the easiest way to get Let’s Encrypt certificates on Debian 11.

8. Tweaks for Production
sudo nano /var/www/html/FileRun/.htaccess

Add:

<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header always set X-XSS-Protection "1; mode=block"
</IfModule>

Basic security headers reduce the risk of cross‑site scripting attacks that FileRun’s UI might be tricked into.

9. Test It Out

Log in with the admin account you created during installation. Upload a file, try sharing it via link, and check that the log files show activity—no mysterious 404s.

If anything looks off, look at error.log first; FileRun will complain about missing PHP extensions or incorrect folder permissions right there.

That’s all there is to it: an Apache + MariaDB stack, a quick DB setup, a single download of the archive, and a few lines in Apache. If you hit a snag after any step, double‑check file ownerships and that every required PHP module is enabled—those are the most common culprits.