Install FileRun with LAMP on Debian 11 to turn a VPS into a private file manager with sharing, WebDAV, and browser access in about 25 minutes. This guide uses Apache, PHP 8.4, MariaDB 10.11, HTTPS, and a data directory outside the public web root.
Prerequisites
- A 64-bit Debian GNU/Linux 11 (Bullseye) VPS with at least 2 GB of RAM and enough disk space for both the application and your files.
- SSH access as
root, or a normal account with workingsudoprivileges. - A domain such as
YOUR_DOMAINwith an A record pointing to the VPS. A domain is required for a trusted Let’s Encrypt certificate. - A FileRun installation ZIP downloaded from the FileRun client area, plus a strong superuser password and a separate MariaDB password.
- A VPSLake Linux VPS with a public IPv4 address is suitable for this LAMP deployment.
Debian 11 is no longer a current supported release, so use this procedure for an existing Bullseye server and plan an operating-system upgrade. The current FileRun requirements call for PHP 8.3–8.5, ionCube Loader, and MariaDB 10.11 or newer; Debian 11’s default packages are older, so the guide adds the vendor repositories where needed.
The commands use sudo. If you are logged in as root, remove sudo from each command. Replace every uppercase placeholder before running its block.
Step 1: Confirm Bullseye and install Apache
Confirming the release avoids mixing Debian 11 packages with repositories for another Debian version.
grep -E '^(PRETTY_NAME|VERSION_CODENAME)=' /etc/os-release
dpkg --print-architecture
sudo sed -i -E 's#https?://(deb|security)\.debian\.org/debian(-security)?#http://archive.debian.org/debian#g; /bullseye-security/d' /etc/apt/sources.list
sudo apt -o Acquire::Check-Valid-Until=false update
sudo apt install -y apache2 ca-certificates curl gnupg unzip ufw certbot python3-certbot-apache
sudo systemctl enable --now apache2
sudo systemctl is-active apache2
Expected output includes VERSION_CODENAME=bullseye, a 64-bit architecture such as amd64, and an active Apache service:
VERSION_CODENAME=bullseye
amd64
active
Step 2: Install MariaDB 10.11 and PHP 8.4
FileRun needs a current database and PHP runtime, while Bullseye’s standard repository supplies MariaDB 10.5 and PHP 7.4.
Configure the official MariaDB 10.11 repository, then add the signed PHP repository for Bullseye:
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash -s -- --mariadb-server-version="mariadb-10.11"
sudo curl -fsSL https://packages.sury.org/debsuryorg-archive-keyring.deb -o /tmp/debsuryorg-archive-keyring.deb
sudo dpkg -i /tmp/debsuryorg-archive-keyring.deb
sudo tee /etc/apt/sources.list.d/php.sources >/dev/null <<'EOF'
Types: deb
URIs: https://packages.sury.org/php/
Suites: bullseye
Components: main
Architectures: amd64 arm64 armhf
Signed-By: /usr/share/keyrings/deb.sury.org-php.gpg
EOF
sudo apt -o Acquire::Check-Valid-Until=false update
sudo apt install -y mariadb-server mariadb-client php8.4 libapache2-mod-php8.4 php8.4-cli php8.4-mysql php8.4-curl php8.4-zip php8.4-xml php8.4-mbstring php8.4-imagick php8.4-gd
sudo systemctl enable --now mariadb
The PHP extensions cover database access, encrypted requests, archive handling, XML, multibyte text, and previews. FileRun’s requirements documentation lists ionCube as required and ImageMagick as useful for thumbnails.
Set production-friendly PHP limits for the Apache SAPI and reload Apache:
sudo tee /etc/php/8.4/apache2/conf.d/99-filerun.ini >/dev/null <<'EOF'
memory_limit = 256M
max_execution_time = 300
upload_max_filesize = 1G
post_max_size = 1G
display_errors = Off
session.cookie_httponly = On
session.cookie_secure = On
EOF
sudo systemctl restart apache2
php8.4 -v
mariadb --version
The version checks should show PHP 8.4 and MariaDB 10.11 or a later compatible release.
Step 3: Install ionCube Loader
FileRun’s PHP files require the ionCube extension, which is distributed separately from Debian and PHP.
The command below downloads the official 64-bit Linux loader archive, enables the PHP 8.4 loader for both CLI and Apache, and confirms that PHP can see it:
cd /tmp
curl -fL https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -o ioncube_loaders.tar.gz
tar -xzf ioncube_loaders.tar.gz
sudo install -d -m 0755 /usr/local/ioncube
sudo install -m 0644 ioncube/ioncube_loader_lin_8.4.so /usr/local/ioncube/
echo 'zend_extension=/usr/local/ioncube/ioncube_loader_lin_8.4.so' | sudo tee /etc/php/8.4/apache2/conf.d/00-ioncube.ini >/dev/null
echo 'zend_extension=/usr/local/ioncube/ioncube_loader_lin_8.4.so' | sudo tee /etc/php/8.4/cli/conf.d/00-ioncube.ini >/dev/null
sudo systemctl restart apache2
php8.4 -i | grep -i -m 1 ionCube
You should see a line identifying the ionCube Loader. Use the official ionCube loader page if your VPS is ARM64 or another architecture; download the matching archive and loader file instead of using the x86-64 filename above.
Step 4: Create the FileRun database
A separate database account limits the damage if the web application is compromised and keeps the MariaDB administrator login out of FileRun.
Run the hardening wizard and answer its prompts to remove anonymous users, remote root access, and the test database:
sudo mariadb-secure-installation
Create the database and account. Replace YOUR_DB_PASSWORD with a long, unique password before running the block:
sudo mariadb <<'SQL'
CREATE DATABASE filerun CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'filerun'@'localhost' IDENTIFIED BY 'YOUR_DB_PASSWORD';
GRANT ALL PRIVILEGES ON filerun.* TO 'filerun'@'localhost';
FLUSH PRIVILEGES;
SQL
The installer needs the temporary ALTER and DROP privileges included above. After the browser setup completes, remove those two privileges as shown in Step 7.
Step 5: Download FileRun and configure Apache
Keeping user files outside Apache’s document root prevents someone from bypassing FileRun’s access checks with a direct URL.
Create the application and private storage directories. Download FileRun.zip from the client area, then upload it with SFTP to /var/www/filerun/ before running the extraction commands:
sudo install -d -o www-data -g www-data -m 0755 /var/www/filerun
sudo install -d -o www-data -g www-data -m 0770 /srv/filerun-data
sudo unzip -q /var/www/filerun/FileRun.zip -d /var/www/filerun
sudo rm -f /var/www/filerun/FileRun.zip
test -f /var/www/filerun/index.php && echo "FileRun files extracted"
Let Apache write during the first-run wizard, while keeping the private data directory inaccessible to other local users:
sudo chown -R www-data:www-data /var/www/filerun
sudo find /var/www/filerun -type d -exec chmod 0755 {} +
sudo find /var/www/filerun -type f -exec chmod 0644 {} +
sudo install -d -o www-data -g www-data -m 0770 /var/www/filerun/system/data
Create a virtual host for the domain. This also denies direct web access to FileRun’s internal system directory and PHP files beneath apps:
sudo tee /etc/apache2/sites-available/YOUR_DOMAIN.conf >/dev/null <<'APACHE'
<VirtualHost *:80>
ServerName YOUR_DOMAIN
ServerAdmin YOUR_EMAIL
DocumentRoot /var/www/filerun
<Directory /var/www/filerun>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/filerun/system>
Require all denied
</Directory>
<Directory /var/www/filerun/apps>
<FilesMatch "\.php$">
Require all denied
</FilesMatch>
</Directory>
ErrorLog ${APACHE_LOG_DIR}/filerun_error.log
CustomLog ${APACHE_LOG_DIR}/filerun_access.log combined
</VirtualHost>
APACHE
sudo a2dissite 000-default.conf
sudo a2ensite YOUR_DOMAIN.conf
sudo a2enmod rewrite headers
sudo apache2ctl configtest
sudo systemctl reload apache2
Replace YOUR_DOMAIN and YOUR_EMAIL. Syntax OK means Apache accepted the configuration.
Step 6: Open the firewall and enable HTTPS
Allow SSH before enabling UFW, then expose only the ports needed for administration and web traffic.
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw --force enable
sudo ufw status verbose
The status should show active rules for SSH, 80, and 443. If SSH uses a custom port, allow that port instead of OpenSSH; the VPSLake UFW firewall generator can help build a matching ruleset.
Wait until YOUR_DOMAIN resolves to the VPS, then request a certificate and redirect HTTP to HTTPS:
sudo certbot --apache --redirect --agree-tos --no-eff-email -m YOUR_EMAIL -d YOUR_DOMAIN
sudo certbot renew --dry-run
Certbot should report a successful renewal simulation. It will also create the HTTPS Apache configuration.
Step 7: Complete the browser installer and schedule jobs
The browser wizard writes FileRun’s database settings and creates its first administrator account.
Open https://YOUR_DOMAIN and enter these values when prompted:
- Database host:
localhost - Database name:
filerun - Database user:
filerun - Database password: the value used for
YOUR_DB_PASSWORD
Create a unique administrator password. After signing in, open Control panel → Users, edit superuser, and set its home folder to /srv/filerun-data; the initial superuser does not have a home folder automatically. The official manual installation guide explains why this folder must remain outside the public web root.
Now remove the database privileges and lock application files so PHP can change only runtime data:
sudo mariadb <<'SQL'
REVOKE ALTER, DROP ON filerun.* FROM 'filerun'@'localhost';
FLUSH PRIVILEGES;
SQL
sudo chown -R root:www-data /var/www/filerun
sudo find /var/www/filerun -type d -exec chmod 0755 {} +
sudo find /var/www/filerun -type f -exec chmod 0644 {} +
sudo chown -R www-data:www-data /var/www/filerun/system/data
sudo chmod -R u+rwX,g+rwX,o-rwx /var/www/filerun/system/data
FileRun’s maintenance scripts clear sessions, classify new files, and clean old accounts. Run them from /etc/cron.d as the web account:
sudo tee /etc/cron.d/filerun >/dev/null <<'CRON'
* * * * * www-data cd /var/www/filerun && /usr/bin/php8.4 cron/everyMinute.php >/dev/null 2>&1
*/5 * * * * www-data cd /var/www/filerun && /usr/bin/php8.4 cron/every5minutes.php >/dev/null 2>&1
5 0 * * * www-data cd /var/www/filerun && /usr/bin/php8.4 cron/daily.php >/dev/null 2>&1
CRON
sudo chmod 0644 /etc/cron.d/filerun
Verify the FileRun installation
Run these checks to confirm the PHP extension, database, services, Apache syntax, and public HTTPS endpoint:
php8.4 -m | grep -E 'curl|imagick|mbstring|pdo_mysql|xml|zip'
php8.4 -i | grep -i -m 1 ionCube
mariadb -e "SELECT VERSION();"
sudo apache2ctl configtest
sudo systemctl is-active apache2 mariadb
curl -fsSI https://YOUR_DOMAIN | sed -n '1,5p'
sudo -u www-data test -w /srv/filerun-data && echo "Data directory writable"
Expected output includes the requested PHP modules, an ionCube line, a MariaDB 10.11-or-newer version, Syntax OK, two active lines, an HTTPS 200 or redirect response, and Data directory writable. Sign in, upload a small test file, refresh the page, and confirm it remains available.
Troubleshooting
apt update returns a Bullseye 404 or expired Release error
Debian 11’s regular mirrors may no longer carry its old metadata. For an existing Bullseye server, change the main Debian entries to the archive and ignore the old validity date temporarily; schedule an upgrade to a supported release afterward.
sudo sed -i -E 's#https?://(deb|security)\.debian\.org/debian#http://archive.debian.org/debian#g' /etc/apt/sources.list
sudo sed -i '/bullseye-security/d' /etc/apt/sources.list
sudo apt -o Acquire::Check-Valid-Until=false update
If the failing entry is under /etc/apt/sources.list.d/, update or disable that specific Bullseye security entry too. Do not treat the archive as a permanent security feed.
FileRun says “ionCube Loader is not installed”
Apache and the CLI can load different PHP configuration directories. Check both files, confirm the loader path exists, then restart Apache:
test -f /usr/local/ioncube/ioncube_loader_lin_8.4.so && echo "Loader file exists"
grep -R ioncube /etc/php/8.4/apache2/conf.d /etc/php/8.4/cli/conf.d
sudo systemctl restart apache2
On ARM64, the x86-64 archive is the wrong binary. Download the Linux ARM64 package from ionCube and install its PHP 8.4 loader instead.
The installer cannot connect to MariaDB
The database name, user, password, or host does not match. Test the same account without exposing its password in the command line:
mariadb -u filerun -p -h localhost filerun -e 'SELECT 1;'
sudo mariadb -e "SELECT User,Host FROM mysql.user WHERE User='filerun';"
Enter the password when prompted. A successful connection prints 1; use localhost, not a remote database hostname, in the FileRun wizard.
403 Forbidden, blank pages, or “system/data is not writable”
Apache must be able to read the application and write only the runtime data directory. Reapply the ownership commands from Step 7, then inspect the error log:
sudo chown -R root:www-data /var/www/filerun
sudo chown -R www-data:www-data /var/www/filerun/system/data
sudo chmod -R u+rwX,g+rwX,o-rwx /var/www/filerun/system/data
sudo tail -n 30 /var/log/apache2/filerun_error.log
Do not use chmod 777; it grants every local account write access to the installation.
Hardening
- Back up
/var/www/filerun,/srv/filerun-data, and thefilerundatabase before updates or server changes. - Keep the
systemdirectory blocked and test thathttps://YOUR_DOMAIN/system/data/does not expose files. - In Control panel → System → Update, review updates and temporarily grant the database account
ALTERandDROPonly when an update requires them, then revoke them again. - Enable FileRun’s API only after HTTPS is working, and use a long, unique superuser password.
FAQ
Can I install FileRun on Debian 11’s default PHP 7.4?
Not with the current FileRun release. Current requirements use PHP 8.3, 8.4, or 8.5, so this guide installs PHP 8.4 from the signed PHP repository instead of using Bullseye’s PHP 7.4 packages.
Where should FileRun store uploaded files?
Use a directory outside Apache’s document root, such as /srv/filerun-data. This prevents direct URL access from bypassing FileRun’s sharing and permission checks.
Why does FileRun need ionCube Loader?
FileRun includes encoded PHP components that require ionCube to execute. The loader must match the installed PHP version and CPU architecture; a loader for PHP 8.3 or x86-64 cannot be substituted blindly.
Does FileRun store files in MariaDB?
No. MariaDB stores accounts, settings, metadata, and sharing information. The actual documents remain in the filesystem directory assigned as each user’s home folder.