server status Use code with caution.
HaRP is distributed as a Docker image. You can deploy it using a simple docker run command or a Compose file. Essential Environment Variables: HP_SHARED_KEY : A secure password shared between Nextcloud and HaRP. NC_INSTANCE_URL : The URL of your Nextcloud instance (e.g.,
sudo mkdir -p /etc/haproxy/certs sudo sh -c "cat /etc/letsencrypt/live/://example.com /etc/letsencrypt/live/://example.com > /etc/haproxy/certs/://example.com.pem" sudo chmod 600 /etc/haproxy/certs/://example.com.pem Use code with caution. 3. Configure HAProxy Open the HAProxy configuration file: sudo nano /etc/haproxy/haproxy.cfg Use code with caution.
[ Client / Web Browser ] │ (HTTPS / Port 443) ▼ [ HAProxy ] (SSL Termination & Load Balancing) │ (HTTP / Port 80) ▼ [ Apache ] (Processes Nextcloud PHP-FPM code) ├───► [ Redis ] (Local/External cache & File locking) └───► [ PostgreSQL ] (Database storage) Step 1: Initialize the Environment and Install PHP
frontend http_in bind *:80 # Redirect all HTTP traffic to HTTPS redirect scheme https code 301 if ! ssl_fc frontend https_in bind *:443 ssl crt /etc/haproxy/yourdomain.pem # Pass original headers to Nextcloud for security verification http-request set-header X-Forwarded-Proto https http-request set-header X-Forwarded-Host %[req.hdr(host)] # Nextcloud service discovery redirects http-request redirect location /.well-known/carddav code 301 if path /.well-known/carddav http-request redirect location /.well-known/caldav code 301 if path /.well-known/caldav default_backend nextcloud_apache backend nextcloud_apache balance roundrobin option httpchk HEAD / # Forward traffic to the local Apache instance server apache_node1 127.0.0.1:80 check Use code with caution. Restart HAProxy to launch your load balancer: sudo systemctl restart haproxy Use code with caution. Step 7: Finalizing Nextcloud via GUI & Configuration harp nextcloud install
memory_limit = 512M upload_max_filesize = 10G post_max_size = 10G max_execution_time = 3600 date.timezone = UTC opcache.enable=1 opcache.interned_strings_buffer=16 opcache.max_accelerated_files=10000 opcache.memory_consumption=128 opcache.save_comments=1 opcache.revalidate_freq=1 Use code with caution. Restart PHP-FPM to apply changes: sudo systemctl restart php8.x-fpm Use code with caution. Step 2: Install and Configure PostgreSQL ("P")
Add the following local caching array before the closing parenthesis:
While Harp will handle most configurations, the server needs to be minimally prepared. Run the following to update the system and install basic tools:
# Download Nextcloud archive cd /tmp && wget https://nextcloud.com # Extract it to the web directory tar -xjvf latest.tar.bz2 sudo mv nextcloud /var/www/ # Set up permissions for the web server sudo chown -R www-data:www-data /var/www/nextcloud/ sudo chmod -R 755 /var/www/nextcloud/ Use code with caution. Step 6: Install and Configure HAProxy ("H") server status Use code with caution
Never map the host Docker socket ( /var/run/docker.sock ) directly to Nextcloud. Using HaRP is the secure alternative.
Harp sets safe defaults, but you should add these layers manually:
Then re-run harp deploy --force locally.
Ensure the port configured for HaRP (e.g., 8080) is accessible by the AppAPI container. Configure HAProxy Open the HAProxy configuration file: sudo
Navigate to your web browser and load your configured domain string: https://yourdomain.com . You will be welcomed by the main graphical wizard page.
Append the following line to execute the background task runner every 5 minutes:
By completing the , you ensure your Nextcloud instance is prepared for the next generation of AppAPI ExApps, offering a snappier, more reliable experience for users.