I have no support/technical question and have seen the support category. (Be aware that direct support questions will be deleted.)
on
Which general topic do you have
I hope this is OK to post, if not then please ignore. I simply wanted to provide some instructions that really worked for me.
I have seen many posts of issues installing nextcloud and office on a raspberry pi 4 and to be honest some of the responses have been a little difficult to understand. I have however just managed (with the help of Gemini) managed to get nextcloud and collabora working on a raspberry pi 4 with 4GB Ram. .. iâm still on a bit of a high tbh. I did this to ptimarily get rid of the âcURL error 28: Operation timed outâ, âSocket proxy error / 400 Bad Requestâ, and âTemporary failure in name resolutionâ errors.
The starting point is installing Nextcloud Office and the Built-in CODE serverâŚ
So here are a set of instructions which wroked for me and i hope for those who want to achieve the same end. then I hope it works for you..
How to Migrate Nextcloud Collabora to Docker on DietPi (Raspberry Pi)
This guide resolves âcURL error 28: Operation timed outâ, âSocket proxy error / 400 Bad Requestâ, and âTemporary failure in name resolutionâ errors by offloading document processing to Docker, properly routing WebSocket traffic through Apache, and injecting local network routing paths directly into the container.
-
Uninstall the Built-in Server
The built-in Nextcloud Office app (richdocumentscode_arm64) uses an AppImage that is too heavy for the Raspberry Pi 4âs CPU, leading to timeouts. -
Go to your Nextcloud Admin account â Apps.
-
Find âBuilt-in CODE Serverâ and click Remove.
-
Leave the âNextcloud Officeâ app installed (this is the frontend viewer).
- Install Docker
- Open the DietPi software manager:
sudo dietpi-software - Search for or scroll to â162 Dockerâ (Docker: Build, ship, and run distributed applications).
- Select it, press Enter, and proceed with the installation.
-
Find your Piâs Local IP Address
Because Docker containers operate in an isolated network environment, the Collabora container cannot use â127.0.0.1â to talk to your hostâs web server. You must use your Piâs actual local network IP. -
Run this command to print your Piâs network IP:
hostname -I -
Take note of the first IP address that appears (e.g., 192.168.1.50).
- Deploy the Collabora Docker Container
Run the official Collabora container. Replace âYOUR_PI_IPâ with the IP address from Step 3, and replace âyourdomain.comâ with your actual Nextcloud domain name.
The --add-host parameter is criticalâit injects the DNS mapping directly into the isolated container so it can fetch documents from Nextcloud without failing.
docker run -d -p 9980:9980 --name collabora --restart always
âadd-host yourdomain.com:YOUR_PI_IP
-e âserver_name=yourdomain.comâ
-e âaliasgroup1=https://yourdomain.com:443â
-e âextra_params=âo:ssl.enable=false --o:ssl.termination=trueâ
collabora/code
- Enable Apache Proxy & WebSocket Modules
Apache needs specific modules to handle the live-typing WebSocket connections. Run these commands:
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_wstunnel
sudo a2enmod rewrite
-
Configure Apache Letâs Encrypt Rules
You must configure Apache to securely tunnel traffic to the Docker container and prevent it from breaking the encoded URLs used by Collabora. -
Open your Letâs Encrypt SSL configuration file:
sudo nano /etc/apache2/sites-available/000-default-le-ssl.conf -
Locate the <VirtualHost *:443> line. Immediately below it, add this rule to stop Apache from decoding slashes (which prevents âSocket connection closed unexpectedlyâ errors):
AllowEncodedSlashes NoDecode -
Scroll down to the bottom of the block. Just above the closing tag, paste the reverse proxy rules:
Collabora Online Reverse Proxy Rules
Options -Indexes
ProxyPreserveHost OnEndpoint with information about availability of collaborative editing
ProxyPass /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0
ProxyPassReverse /hosting/discovery http://127.0.0.1:9980/hosting/discoveryEndpoint for Collabora Online capabilities
ProxyPass /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0
ProxyPassReverse /hosting/capabilities http://127.0.0.1:9980/hosting/capabilitiesMain Collabora Online websocket
ProxyPassMatch â^/cool/(.*)/ws$â ws://127.0.0.1:9980/cool/$1/ws nocanon
Admin Console websocket
ProxyPass /cool/adminws ws://127.0.0.1:9980/cool/adminws
Download, Presentation and Image upload
ProxyPass /cool http://127.0.0.1:9980/cool
ProxyPassReverse /cool http://127.0.0.1:9980/coolStatic browser files
ProxyPass /browser http://127.0.0.1:9980/browser retry=0
ProxyPassReverse /browser http://127.0.0.1:9980/browser -
Save the file and restart Apache:
sudo apache2ctl configtest
sudo systemctl restart apache2
- Connect Nextcloud to the New Server
- Go to your Nextcloud Administration Settings â Nextcloud Office.
- Select âUse your own serverâ.
- Enter your public domain URL (e.g., https://yourdomain.com).
- Click Save.
-
Fix Host Server NAT Loopback (Host DNS Override)
To prevent the host Nextcloud instance from getting blocked by your router when trying to execute server-to-server background tasks (like background document synchronization checks), add a local DNS override to the main OS. -
Open the hosts file:
sudo nano /etc/hosts -
Add your domain pointing to localhost right under the standard 127.0.0.1 entry:
127.0.0.1 yourdomain.com -
Save and exit.
-
Optimize Folder Loading (Disable Document Previews)
Generating document thumbnails on a Raspberry Pi 4 is CPU-intensive. Because Nextcloud enforces a strict 5-second deadline for thumbnails, the Pi will often hit the limit, failing and cluttering logs with âcURL error 28 (timeout)â messages. Disabling them speeds up file navigation drastically. -
Open your Nextcloud config file:
sudo nano /var/www/nextcloud/config/config.php -
Add or modify the âenabledPreviewProvidersâ array to exclude documents (leaving only images, text files, and videos):
âenabledPreviewProvidersâ =>
array (
0 => âOC\Preview\Imageâ,
1 => âOC\Preview\Movieâ,
2 => âOC\Preview\TXTâ,
), -
Save and exit.
If you ever need to clear out stuck processes or settings cache after configuration adjustments, run:
sudo systemctl restart php*-fpm
sudo systemctl restart apache2
docker restart collabora
Thatâs all there is to it