Install HumHub with LAMP Stack on Rocky Linux 8 by running Apache with PHP-FPM and MariaDB 10.11, then completing HumHub’s web installer. Allow about 20–30 minutes if your DNS record already points to the VPS.
Prerequisites
- Rocky Linux 8.10, updated and reachable over SSH.
- Root access or a sudo-enabled account; every command below uses
sudo. - At least 2 GB of RAM and 10 GB of free disk space for the application, database, uploads, and logs.
- A domain such as
YOUR_DOMAINwith an A record pointing to the server; ports 80 and 443 must be reachable. - A Linux VPS from VPSLake with a public IPv4 address.
- Separate long random values for
YOUR_DB_PASSWORDand the HumHub administrator password.
HumHub 1.18 requires PHP 8.2 or newer and MariaDB 10.11 or newer. This procedure follows HumHub’s system requirements and uses PHP 8.3 with PHP-FPM, which is a good fit for Rocky Linux 8.
Step 1: Install the LAMP components
Rocky Linux 8’s default PHP stream is too old for current HumHub, so enable the Remi PHP 8.3 stream before installing Apache, PHP extensions, and MariaDB.
sudo dnf update -y
sudo dnf install -y epel-release dnf-plugins-core firewalld httpd mod_ssl curl tar unzip policycoreutils-python-utils
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
sudo dnf module reset php -y
sudo dnf module enable php:remi-8.3 -y
sudo dnf module disable mariadb -y
sudo tee /etc/yum.repos.d/mariadb.repo > /dev/null <<'REPO'
[mariadb]
name=MariaDB 10.11
baseurl=https://rpm.mariadb.org/10.11/rhel/8/$basearch
gpgkey=https://rpm.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
enabled=1
module_hotfixes=1
REPO
sudo dnf install -y MariaDB-server MariaDB-client php php-cli php-fpm php-curl php-gd php-intl php-mbstring php-mysqlnd php-opcache php-process php-xml php-zip cronie
sudo tee /etc/php.d/99-humhub.ini > /dev/null <<'INI'
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 120
INI
sudo systemctl enable --now firewalld httpd mariadb php-fpm crond
Confirm that the selected PHP stream and database version are the ones HumHub expects.
php -v
mariadb --version
sudo systemctl is-active httpd php-fpm mariadb firewalld crond
PHP 8.3.x (cli) ...
mariadb Ver 15.1 Distrib 10.11.x-MariaDB ...
active
active
active
active
active
Step 2: Lock down the firewall and create the database
HumHub needs web traffic from the internet, but MariaDB is used locally and should not be exposed on port 3306.
sudo firewall-cmd --permanent --zone=public --add-service=ssh
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
sudo firewall-cmd --list-services
ssh dhcpv6-client http https
Run the database hardening wizard. Remove anonymous accounts, remote root access, and the test database when it asks.
sudo mariadb-secure-installation
Create a database and a local-only account for HumHub. Replace YOUR_DB_PASSWORD with a unique random password before executing this block.
sudo mariadb <<'SQL'
CREATE DATABASE humhub CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'humhub'@'localhost' IDENTIFIED BY 'YOUR_DB_PASSWORD';
GRANT ALL PRIVILEGES ON humhub.* TO 'humhub'@'localhost';
FLUSH PRIVILEGES;
SQL
sudo mariadb -e "SHOW DATABASES LIKE 'humhub';"
Database (humhub)
humhub
Step 3: Download HumHub and set SELinux-aware permissions
The packaged archive already contains HumHub’s production dependencies, so Composer is not needed on this VPS. The 1.18.6 package is the current stable 1.18 release; the official installation guide describes this packaged layout.
HUMHUB_VERSION=1.18.6
cd /tmp
curl -fL -o "humhub-${HUMHUB_VERSION}.tar.gz" "https://download.humhub.com/downloads/install/humhub-${HUMHUB_VERSION}.tar.gz"
sudo mkdir -p /var/www
sudo tar -xzf "humhub-${HUMHUB_VERSION}.tar.gz" -C /var/www
sudo mv "/var/www/humhub-${HUMHUB_VERSION}" /var/www/humhub
sudo cp /var/www/humhub/.htaccess.dist /var/www/humhub/.htaccess
Keep the application code read-only to the web process and grant Apache write access only to HumHub’s required runtime directories. The SELinux file contexts make those permissions survive relabeling and reboots.
sudo chown -R root:apache /var/www/humhub
sudo find /var/www/humhub -type d -exec chmod 0750 {} \;
sudo find /var/www/humhub -type f -exec chmod 0640 {} \;
sudo chown -R apache:apache /var/www/humhub/assets /var/www/humhub/protected/config /var/www/humhub/protected/modules /var/www/humhub/protected/runtime /var/www/humhub/uploads
sudo semanage fcontext -a -t httpd_sys_content_t '/var/www/humhub(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/humhub/assets(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/humhub/protected/config(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/humhub/protected/modules(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/humhub/protected/runtime(/.*)?'
sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/humhub/uploads(/.*)?'
sudo restorecon -Rv /var/www/humhub
Step 4: Create the Apache virtual host
Apache will serve /var/www/humhub, allow HumHub’s rewrite rules, send PHP files to PHP-FPM, and deny direct requests to private application paths.
Replace every YOUR_DOMAIN value in this block with the real hostname before running it.
sudo tee /etc/httpd/conf.d/YOUR_DOMAIN.conf > /dev/null <<'APACHE'
<VirtualHost *:80>
ServerName YOUR_DOMAIN
DocumentRoot /var/www/humhub
<Directory /var/www/humhub>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/humhub/protected>
Require all denied
</Directory>
<Directory /var/www/humhub/uploads/file>
Require all denied
</Directory>
<DirectoryMatch "^/var/www/humhub/themes/[^/]+/views">
Require all denied
</DirectoryMatch>
<FilesMatch "^\.">
Require all denied
</FilesMatch>
<FilesMatch "\.php$">
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
</FilesMatch>
DirectoryIndex index.php
ErrorLog /var/log/httpd/YOUR_DOMAIN-error.log
CustomLog /var/log/httpd/YOUR_DOMAIN-access.log combined
</VirtualHost>
APACHE
sudo apachectl configtest
sudo systemctl reload httpd
Syntax OK
The .htaccess file handles HumHub’s pretty URLs. AllowOverride All is therefore intentional; the other directory rules stop visitors from reading configuration, protected code, or private uploaded files.
Step 5: Add HTTPS with Let’s Encrypt
TLS protects passwords, sessions, and uploaded content. Wait until YOUR_DOMAIN resolves to this VPS, then let Certbot update Apache and add the HTTP-to-HTTPS redirect.
Replace ADMIN_EMAIL with an address that should receive certificate notices.
sudo dnf install -y certbot python3-certbot-apache
sudo certbot --apache --redirect --agree-tos --no-eff-email -m ADMIN_EMAIL -d YOUR_DOMAIN
sudo certbot renew --dry-run
Congratulations, all simulated renewals succeeded
Step 6: Complete the HumHub browser installer
The web wizard checks PHP, writes the application configuration, creates the tables, and creates the first administrator.
Open https://YOUR_DOMAIN/ in a browser. On the database screen, enter:
- Database type: MySQL or MariaDB
- Database host:
localhost - Database name:
humhub - Database user:
humhub - Database password: the value used for
YOUR_DB_PASSWORD - Database port:
3306
Use a different strong password for the HumHub administrator. When the wizard reports that the checks passed, finish the setup and sign in; the dashboard confirms that Apache, PHP, and the database can work together.
Step 7: Schedule background jobs
HumHub’s queue and scheduler handle notifications, cleanup, and delayed work outside the browser request. Run both commands each minute as apache, the same account used by PHP-FPM.
sudo tee /etc/cron.d/humhub > /dev/null <<'CRON'
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
* * * * * apache /usr/bin/php /var/www/humhub/protected/yii queue/run >/dev/null 2>&1
* * * * * apache /usr/bin/php /var/www/humhub/protected/yii cron/run >/dev/null 2>&1
CRON
sudo chmod 0644 /etc/cron.d/humhub
sudo systemctl restart crond
Verify the HumHub installation
These checks cover the service state, required PHP modules, database tables, command-line bootstrap, and public HTTPS response.
sudo systemctl is-active httpd php-fpm mariadb firewalld crond
php -m | grep -E 'curl|exif|fileinfo|gd|iconv|intl|mbstring|mysqli|pdo_mysql|zip'
sudo mariadb -e "SHOW TABLES FROM humhub;"
sudo -u apache /usr/bin/php /var/www/humhub/protected/yii help >/dev/null && echo 'HumHub CLI OK'
curl -fsSI https://YOUR_DOMAIN/
active
active
active
active
active
HumHub CLI OK
HTTP/2 200
The PHP module list can appear in a different order, and the browser may return a redirect after login. You want all five services active, a non-empty table list, a successful CLI check, and an HTTPS response without a certificate warning.
Troubleshooting
AH01071: Got error 'Primary script unknown'
PHP-FPM cannot find the script path Apache supplied, usually because the virtual host points at the wrong document root or the file was extracted into a nested directory. Confirm that index.php is directly under /var/www/humhub, then inspect the active configuration.
sudo ls -l /var/www/humhub/index.php
sudo apachectl -S
sudo systemctl restart php-fpm httpd
503 Service Unavailable after opening the domain
The PHP-FPM service may be stopped, or Apache may be using a socket that does not exist. Check the service and socket, then reload the virtual host.
sudo systemctl status php-fpm --no-pager
sudo ls -l /run/php-fpm/www.sock
sudo apachectl configtest
sudo systemctl restart php-fpm httpd
SQLSTATE[HY000] [1045] Access denied for user 'humhub'
The password in the wizard must exactly match the MariaDB account, and the host should remain localhost. Test the account and reset only its password if necessary.
mariadb -u humhub -p humhub -e 'SELECT 1;'
sudo mariadb -e "ALTER USER 'humhub'@'localhost' IDENTIFIED BY 'NEW_DB_PASSWORD'; FLUSH PRIVILEGES;"
Permission denied or an AVC denial in the audit log
Apache needs write access to HumHub’s runtime directories and the correct SELinux labels. Reapply the labels and inspect recent denials without disabling SELinux.
sudo chown -R apache:apache /var/www/humhub/assets /var/www/humhub/protected/config /var/www/humhub/protected/modules /var/www/humhub/protected/runtime /var/www/humhub/uploads
sudo restorecon -Rv /var/www/humhub
sudo ausearch -m AVC -ts recent
sudo systemctl restart php-fpm httpd
Hardening and maintenance
- Back up the
humhubdatabase and/var/www/humhub/uploadsbefore upgrades or module changes. - Keep MariaDB local and leave only SSH, HTTP, and HTTPS in the public
firewalldzone. - In HumHub, review Administration → Settings → Users and restrict public registration if the network is private.
- Check Administration → Information → Background jobs and Administration → Information → Logging after installation.
FAQ
Can HumHub run on a Rocky Linux 8 VPS without a domain?
You can test the site by opening the server’s IP address, but a domain is the sensible production choice. Let’s Encrypt issues certificates for hostnames, and users should access HumHub through the same name configured in Apache.
Why does the guide use PHP-FPM instead of mod_php?
PHP-FPM is the recommended Apache integration in HumHub’s requirements and keeps the PHP worker separate from Apache. It also makes the PHP version and service easier to inspect when troubleshooting.
Which directories must Apache be able to write?
HumHub needs write access to assets, protected/config, protected/modules, protected/runtime, and uploads. The rest of the application remains owned by root:apache, which reduces the impact of an accidental web-process write.
How do I confirm background jobs are working?
Wait a few minutes after adding the cron file, then open Administration → Information → Background jobs. The page should show recent executions and no growing queue of failed tasks; command errors can also be investigated in HumHub’s logging page.