Connect Nextcloud to a Self-Hosted Collabora CODE Container

To connect Nextcloud with a self-hosted Collabora Online Development Edition (CODE) container, run CODE on a separate host name, put it behind HTTPS, and enter its public URL in Nextcloud Office. The CODE container must also allow the Nextcloud site’s origin as a WOPI host. In the example below, Nextcloud is cloud.example.com and Collabora is office.example.com; replace both with your real host names.

A Linux terminal prompt showing the docker pull collabora/code command
A terminal prompt with the command used to download the Collabora CODE image.

What should be ready before you start?

You need a working Nextcloud installation, a Docker host that can run the CODE container, DNS records for the Nextcloud and Collabora host names, and valid HTTPS certificates for both public sites. The Nextcloud host and the Collabora server must be able to reach one another over the network. A dedicated Collabora server is intended to improve capacity over the built-in CODE option; it is still the development edition, so check Collabora’s current terms and release guidance before using it for a larger or business-critical deployment.

This walkthrough assumes a reverse proxy runs on the Docker host and forwards HTTPS traffic for office.example.com to the container’s local port. If your proxy runs in a different container or on another machine, do not copy the loopback port mapping unchanged: use a private Docker network or a private host address that the proxy can reach, and firewall the backend so it is not exposed publicly.

1. Start the CODE container

First, pull the image and start a container. In the alias setting, use the public origin of Nextcloud, including the protocol and port. Do not put the Collabora URL there. Nextcloud’s Docker installation example uses this pattern:

docker pull collabora/code
docker run -t -d -p 127.0.0.1:9980:9980 \
  -e 'aliasgroup1=https://cloud.example.com:443' \
  --restart always \
  --cap-add MKNOD \
  collabora/code

The loopback binding means port 9980 is reachable only from the Docker host, such as by a reverse proxy on that same host. The proxy gives browsers and Nextcloud a public HTTPS endpoint while keeping the container port private. If Nextcloud is served on a nonstandard port or through a different public hostname, make the alias match the origin users actually use. If you have multiple Nextcloud instances, configure each allowed WOPI host using Collabora’s documented syntax rather than broadly allowing arbitrary domains.

The command above follows the Nextcloud 35 administration manual’s Docker example. Before production use, review the current CODE image documentation and choose a release/tag update policy that fits your maintenance process. The default image reference can move as releases are published; plan updates, monitor the container, and retest document editing after upgrades.

Nextcloud Administration Apps page with the Nextcloud Office app shown as enabled
The Apps administration view shows Nextcloud Office enabled before server configuration.

2. Put the container behind the HTTPS reverse proxy

Configure your existing proxy to serve https://office.example.com and forward requests to the CODE service on 127.0.0.1:9980. Use Collabora’s current reverse-proxy configuration for your proxy software. The proxy must preserve the required paths and support WebSocket upgrades; the editor’s browser session depends on them. The Nextcloud Docker example includes routes for /browser, /hosting/discovery, /hosting/capabilities, and /cool, including the WebSocket endpoint. Some integrations also use the compatibility /lool route.

Do not treat a successful homepage load as proof that the proxy is complete. A proxy that handles ordinary HTTPS requests but fails to upgrade WebSocket connections can show the editor frame and then leave it loading or disconnected. Use a valid public certificate for the Collabora hostname. Keep port 9980 closed to the public internet when the proxy is intended to be the only entry point.

3. Enable Nextcloud Office and enter the server URL

Nextcloud Office administration page with an external server selected and the URL https://office.example.com
Choose the external server option and enter the public HTTPS URL for Collabora.

In Nextcloud, open Apps and install or enable Nextcloud Office (the richdocuments integration). Then open Administration settings → Office, choose the external Collabora server option, and enter https://office.example.com. Save the setting. Use the public URL, not localhost:9980: the Nextcloud server and users’ browsers need to resolve the same external Collabora endpoint.

Nextcloud’s administration manual says the configured server URL should use the same protocol as the Collabora installation and recommends HTTPS. After saving, Nextcloud may show a connectivity or discovery status. If it reports a certificate, DNS, or WOPI issue, resolve that specific check before trying to open a file.

4. Check the WOPI path and open a test document

WOPI is the protocol Nextcloud uses to give Collabora controlled access to a document. In Nextcloud’s Office administration settings, review the Allow list for WOPI requests and restrict requests to the IP addresses from which your Collabora service reaches Nextcloud. Also configure Collabora to accept only the intended WOPI host. The exact address can differ when containers, NAT, or a reverse proxy are involved, so use the source address Nextcloud actually sees in its logs rather than guessing.

A cloud files interface with an online word processing document open and its formatting toolbar visible
An open document with an editing toolbar is the final visual check that the Office integration responds.

For a functional check, sign in as a normal Nextcloud user, create or upload a small DOCX or ODT file, and open it from Files. Confirm the editor loads, make a harmless change, wait for the save indicator, close the document, then reopen it and confirm the change remains. Test with each file type and user group that matters to your deployment; a successful DOCX test does not prove every format or permission path is configured.

What should you check if the editor will not open?

  • Discovery or connection error: Confirm that office.example.com resolves from the Nextcloud server and the browser, that its certificate is valid, and that the proxy sends /hosting/discovery to CODE.
  • Endless loading or a disconnected editor: Check the reverse proxy’s WebSocket upgrade handling and the /cool routes. Review the proxy and container logs for rejected requests.
  • WOPI host rejected: Compare the configured aliasgroup1 with the exact public Nextcloud origin, including scheme and port. Check Nextcloud’s WOPI allow list against the Collabora source IP visible to Nextcloud.
  • Works on the host but not in Nextcloud: Test connectivity from the Nextcloud server to the public Collabora URL. A container’s internal hostname or the Docker host’s localhost address is not automatically reachable from every other container.
  • Certificate warning: Fix the certificate chain or hostname mismatch. Disabling certificate verification can hide the cause and weakens the connection.

For diagnosis, compare your configuration with the official Nextcloud Docker installation example, its Office and WOPI configuration guidance, and Collabora’s CODE Docker image and reverse-proxy documentation. Those references are versioned and may change; the commands here reflect the Nextcloud 35 administration example available on October 10, 2026.

Leave a Comment

Clear Nextcloud’s File Locking Warning with Redis

Enable reliable Nextcloud file locking, choose the right Redis or Valkey backend, and verify the warning clears without risking concurrent file changes.

What It Takes to Target an A+ Nextcloud Security Rating

What It Takes to Target an A+ Nextcloud Security Rating

Fix common Nextcloud scan findings with current updates, HTTPS and HSTS, precise reverse-proxy trust, and checks against the public server.

Automate Consistent Nextcloud Backups with Restic and Cron

Automate Consistent Nextcloud Backups with Restic and Cron

Back up Nextcloud’s files and MariaDB together, schedule encrypted Restic snapshots with cron, and verify recovery without risking the live server.

Enable Nextcloud Server-Side Encryption with Measured Impact

Configure Nextcloud SSE for the storage that needs it, protect encryption keys, and measure transfer and CPU impact before encrypting existing files.

Add Elasticsearch Full-Text Search to Nextcloud

Connect Nextcloud’s file search to Elasticsearch, index document contents, and choose a setup that fits your server and security needs.

Set a Reliable Expiration Policy for Nextcloud Deleted Files

Set a Reliable Expiration Policy for Nextcloud Deleted Files

Configure Nextcloud to remove deleted files after a defined retention period, schedule background jobs reliably, and avoid commands that purge every user’s trash.

Clear Nextcloud’s Missing Database Indexes Warning

Clear Nextcloud’s Missing Database Indexes Warning

Run Nextcloud’s OCC repair safely, preview the database changes, and check why the warning might remain.

Raise Nextcloud’s Web Upload Limit Past 2 GB

Raise Nextcloud’s Web Upload Limit Past 2 GB

Allow larger Nextcloud browser uploads by aligning PHP, Nginx or Apache, temporary storage, and timeout settings—and verify which limit is blocking the file.

Clear Nextcloud’s PHP Memory Warning at the Web Server

Set the PHP memory limit Nextcloud actually uses, restart the right service, and confirm the 512 MB setting in Admin Overview.

Connect an S3-Compatible Bucket to Nextcloud External Storage

Mount a compatible object-storage bucket in Nextcloud using its S3 backend, with the right endpoint, credentials, access scope, and verification steps.