Install HumHub with LAMP Stack on AlmaLinux 8 by placing the current packaged release behind Apache, PHP-FPM, and MariaDB. With DNS ready, the server setup and browser wizard take about 20–30 minutes on a fresh VPS.
Prerequisites
- AlmaLinux 8.10, fully updated and reachable over SSH.
- Root access or a sudo-enabled user; the commands below use
sudo. - At least 2 GB of RAM and 10 GB of free disk space for HumHub, the database, uploads, and logs.
- A domain such as
YOUR_DOMAINwith an A record pointing to the VPS; ports 80 and 443 must be reachable. - A Linux server from VPSLake with a public IPv4 address.
- A unique database password, HumHub administrator password, and email address for certificate notices.
HumHub’s current requirements call for Apache 2.4, PHP 8.2 or newer, and MariaDB 10.11 or newer. This guide uses PHP 8.3 and MariaDB 10.11, then follows HumHub’s official system requirements for the required PHP extensions and writable directories.
Step 1: Install Apache, PHP-FPM, MariaDB, and system tools
The Remi repository provides PHP 8.3 for AlmaLinux 8, while MariaDB 10.11 is installed from MariaDB’s own repository because HumHub needs that database generation.
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-mysqlnd php-curl php-gd php-intl php-mbstring 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
Check the versions and service state before you configure the application.
php -v
mariadb --version
sudo systemctl is-active httpd mariadb php-fpm firewalld
PHP 8.3.x (cli) ...
mariadb Ver 15.1 Distrib 10.11.x-MariaDB ...
active
active
active
active
Step 2: Open the firewall and prepare MariaDB
Only SSH and web traffic need to enter the VPS; HumHub connects to MariaDB locally, so port 3306 stays closed.
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 MariaDB’s hardening wizard and remove anonymous accounts, remote root access, and the test database when prompted.
sudo mariadb-secure-installation
Create a database dedicated to HumHub. Replace YOUR_DB_PASSWORD with a long random value before running the block; do not use your SSH or HumHub administrator password here.
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 apply SELinux-safe permissions
The packaged archive includes HumHub’s production dependencies, so you do not need Composer on the server. This guide pins the current stable 1.18.6 package rather than an obsolete older release. HumHub’s official setup documentation explains the same packaged-release 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 owned by root, while giving PHP-FPM write access only to the directories HumHub needs for configuration, cache, modules, assets, and uploads.
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
The persistent SELinux rules let Apache write to HumHub’s runtime paths without disabling enforcement or making the entire web root writable.
Step 4: Configure the Apache virtual host
Apache serves HumHub’s document root, allows its supplied rewrite file, and passes PHP requests to the PHP-FPM socket.
Replace YOUR_DOMAIN in this block 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 <Directory> restrictions prevent direct access to HumHub’s protected code, uploaded private files, and theme views. AllowOverride All is needed for the packaged .htaccess rewrite rules.
Step 5: Enable HTTPS with Let’s Encrypt
TLS protects logins, posts, file uploads, and session cookies. Run Certbot only after YOUR_DOMAIN resolves to this VPS and port 80 is reachable from the internet.
Replace ADMIN_EMAIL with an address that receives renewal 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
Certbot adds the HTTPS virtual host and redirects HTTP requests. It also installs the renewal timer used by certbot renew.
Step 6: Finish the HumHub browser installation
The web installer checks PHP, writes the dynamic configuration, creates HumHub’s tables, and sets the first administrator account.
Open https://YOUR_DOMAIN/ and complete the wizard. Use these database values when the database page appears:
- 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
Set a separate long password for the first administrator. The installer should report that the system checks passed and finish at the sign-in page.
Step 7: Schedule HumHub background jobs
HumHub uses its queue and cron commands for notifications, cleanup, and other delayed work. Running both commands every minute keeps those jobs independent of a user’s browser request.
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
The apache user matches PHP-FPM, so scheduled commands create files with the same ownership as web requests. In HumHub, open Administration → Information → Background jobs after a few minutes to confirm the jobs are being processed.
Verify the HumHub installation
Run these checks from SSH, then sign in and load the dashboard. They confirm the services, PHP modules, database, rewrite configuration, cron commands, 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 module order may differ, and the browser may return a redirect after login. The important results are active services, a non-empty HumHub database, a successful CLI check, and an HTTPS response without a certificate warning.
Troubleshooting
The installer reports a missing PHP extension
The PHP CLI and PHP-FPM must use the same enabled stream, and the extension package must be installed. Check the loaded modules, install the missing package, and restart PHP-FPM.
php -v
php -m
sudo dnf install -y php-curl php-gd php-intl php-mbstring php-mysqlnd php-xml php-zip
sudo systemctl restart php-fpm httpd
Apache returns 503 Service Unavailable or 502 Bad Gateway
Apache cannot reach the PHP-FPM socket when the service is stopped or the socket path differs from the virtual host. Confirm the socket and restart both services.
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
The database password in the installer does not match the local MariaDB account, or the host was entered as 127.0.0.1 instead of localhost. Test the exact account interactively, then reset its password if needed.
mariadb -u humhub -p humhub -e 'SELECT 1;'
sudo mariadb -e "ALTER USER 'humhub'@'localhost' IDENTIFIED BY 'NEW_DB_PASSWORD'; FLUSH PRIVILEGES;"
Enter the new value in the installer. Keep the host as localhost so MariaDB uses the account created in Step 2.
403 Forbidden or Permission denied after the installer starts
The Unix owner or SELinux context of a writable directory was changed. Reapply the labels and confirm that the Apache user owns HumHub’s runtime paths.
sudo restorecon -Rv /var/www/humhub
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 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 bound to localhost and expose only SSH, HTTP, and HTTPS through
firewalld. - In HumHub, review Administration → Settings → Users and disable anonymous registration or require approval if the network is private.
- Check Administration → Information → Logging and Administration → Information → Background jobs during maintenance.
FAQ
Can I install HumHub without a domain?
You can test Apache over the VPS IP address, but a domain is the practical production setup. Let’s Encrypt validates a DNS name, and the application URL should match the hostname that users visit.
Why does this guide install MariaDB 10.11 instead of AlmaLinux’s default?
The current HumHub requirements list MariaDB 10.11 or newer as the minimum supported MariaDB version. AlmaLinux 8’s default stream may be older, so the guide uses MariaDB’s official 10.11 repository.
Which HumHub directories must be writable?
The web process needs write access to assets, protected/config, protected/modules, protected/runtime, and uploads. This guide grants access only to those paths and keeps the rest of the application owned by root.
Why are there two cron entries?
The queue command processes queued tasks, while the cron command handles scheduled maintenance and application events. HumHub documents both jobs, and each runs as the same apache user used by PHP-FPM here.