The introduction of (High-availability Reverse Proxy) marks a paradigm shift in how Nextcloud handles external applications (ExApps). As Nextcloud evolves into a "Hub" rather than just a file-sync service, the need for a robust, decoupled execution environment for resource-heavy apps—like those requiring GPUs or high-performance compute—has become critical. 🏛️ The Architecture of HaRP
Open your terminal and run:
: You typically run HaRP as a separate Docker container alongside your Nextcloud instance or on a dedicated host. Key Configuration Environment Variables : You must set HP_SHARED_KEY (a secret for authentication) and NC_INSTANCE_URL (the address of your Nextcloud server). : It often requires a Docker Socket Proxy
You can fine-tune your installation without touching configuration files manually. Create a .harp/overrides folder: harp nextcloud install
; Recommended settings for Nextcloud performance memory_limit = 512M upload_max_filesize = 16G post_max_size = 16G max_execution_time = 3600 opcache.enable=1 opcache.memory_consumption=128
Additionally, append the allowed application server IP addresses to /etc/postgresql/16/main/pg_hba.conf : host nextcloud_db nextcloud 192.168.1.0/24 scram-sha-256 Use code with caution. Restart the service to apply changes: sudo systemctl restart postgresql Use code with caution. Step 2: Install and Configure Redis (The "R")
For , add a location block above your main Nextcloud route: Key Configuration Environment Variables : You must set
# Redirect all HTTP traffic to HTTPS RewriteEngine On RewriteRule ^(.*)$ https://%HTTP_HOST$1 [R=301,L] </VirtualHost>
tasks: - name: Wait for Nextcloud to be ready uri: url: "https:// nc_domain /status.php" validate_certs: no register: result until: result.status == 200 retries: 30 delay: 10
One of the major benefits of HaRP is the ability to run heavy ExApps on a separate server. Restart the service to apply changes: sudo systemctl
Validate your HAProxy configuration syntax and restart the daemon:
Replaces complex, manual DockerSocketProxy configurations with a single, easy-to-use container.
To ensure your instance runs smoothly, perform these steps after logging in:
sudo a2enmod ssl proxy proxy_http proxy_wstunnel rewrite headers
HaRP acts as a dedicated proxy for AppAPI, the framework used by many modern Nextcloud applications to run as separate Docker containers (ExApps).