$schemamarkup = get_post_meta(get_the_ID(), 'schemamarkup', true); if(!empty($schemamarkup)) { echo $schemamarkup; }

Install Nextcloud on AlmaLinux 9: SELinux, LDAP & Clustering

October 22, 2025 | By the+gnu+linux+evangelist.

How to Install Nextcloud

  1. 6. Download and Extract Nextcloud

    Get the latest Nextcloud release from the official site and extract it under your web root:

    cd /var/www/html && sudo curl -O https://download.nextcloud.com/server/releases/latest.tar.bz2 && sudo tar -xjf latest.tar.bz2 && sudo chown -R apache:apache nextcloud
  2. 7. Configure Apache Virtual Host

    Create a new Apache configuration file for Nextcloud:

    sudo tee /etc/httpd/conf.d/nextcloud.conf <<'EOF'
    <VirtualHost *:80>
        ServerName nextcloud.example.com
        DocumentRoot /var/www/html/nextcloud
        <Directory /var/www/html/nextcloud>
            AllowOverride All
            Require all granted
        </Directory>
    </VirtualHost>
    EOF
  3. 8. Adjust SELinux Contexts

    Apply proper SELinux permissions to allow Apache to write to Nextcloud’s directories:

    sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud(/.*)?' && sudo restorecon -Rv /var/www/html/nextcloud
  4. 9. Allow HTTP/HTTPS Through Firewall

    Open the firewall ports for web access:

    sudo firewall-cmd --permanent --add-service=http && sudo firewall-cmd --permanent --add-service=https && sudo firewall-cmd --reload
  5. 10. Enable HTTPS with Certbot

    Install Certbot and automatically configure HTTPS for Apache:

    sudo dnf install certbot python3-certbot-apache -y && sudo certbot --apache
  6. 11. Configure PHP for Performance

    Tune PHP settings for better performance and clustering compatibility:

    sudo sed -i 's/memory_limit = .*/memory_limit = 512M/' /etc/php.ini && sudo systemctl restart php-fpm httpd
  7. 12. Setup LDAP Authentication

    Enable enterprise-grade LDAP integration via the Nextcloud app (GUI) or command line:

    sudo -u apache php /var/www/html/nextcloud/occ app:enable user_ldap
  8. 13. Enable Clustering Support

    For high availability, enable Redis caching and configure session locking:

    sudo dnf install redis php-redis -y && sudo systemctl enable --now redis && sudo -u apache php /var/www/html/nextcloud/occ config:system:set memcache.locking --value '\OC\Memcache\Redis'
  9. 14. Optional: Configure NGINX Instead of Apache

    To use NGINX, disable Apache and install NGINX with a compatible PHP setup:

    sudo systemctl disable --now httpd && sudo dnf install nginx php-fpm -y && sudo systemctl enable --now nginx php-fpm
  10. 15. Finalize Installation via Browser

    Open your browser at http://nextcloud.example.com and complete the web installer by entering your database credentials and admin user.

Contents


Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,