• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question How to set up Onlyoffice(Docker)

Zoo3

Regular Pleskian
I have a Docker version of Onlyoffice installed.

Code:
sudo docker run -i -t -d -p 380:80 -p 4443:443 --restart=always \
 -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \
 -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \
 -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice \
 -v /app/onlyoffice/DocumentServer/fonts:/usr/share/fonts \
 -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql onlyoffice/documentserver /bin/bash

Then I created a subdomain and specified that container from the "Docker proxy rule" for that subdomain. It specifies port 80->380. If I select 443->4443 for the port there, I cannot connect to Onlycloud.
And I can use Onlyoffice using Nextcloud. However, when I look at the browser log, I always get an error that I can't establish a wss connection.

Firefox:
> Could not establish a connection to the server at wss://ONLYOFFICE.MYDOMAIN/5.4.1-39//doc/---/websocket.

Vivaldi:
> WebSocket connection to 'wss://ONLYOFFICE.MYDOMAIN/5.4.1-39//doc/---/websocket' failed: Error during WebSocket handshake: Unexpected response code: 400

I'm worried that when I try to access Onlyoffice via https(Port 4443), the connection is refused. I suspect that this is causing wss connection errors.
When I look at the installation guide using Docker, there is only one port specification in the docker run command. To use manual ports with Plesk Docker, I must set two port ranges.

I'm using SSL with a wildcard specification for the domain by Let's encrypt. It's complicated, but SSL is essential to use Onlyoffice with Nextcloud. Nextcloud is in a separate subdomain. In Nextcloud, I can use Onlyoffice by specifying https://onlyoffice.MYDOMAIN.

How can I resolve this error?

---
CentOS 7.7, Docker 19.03.4, PHP 7.3.11, Plesk Onyx 17.8.11
 
Last edited:
EXTDOCKER-81.
I searched for EXTDOCKER-81 and found the following PLESK information.
Docker proxy rules: cannot use different ports for the same URL: Mapping for these path and port already defined

In the example there, it is set to "9800" where I set "380". Does the “9800” port have a special meaning?
In addition, the following outline is written there.
Docker proxy rules: cannot use different ports for the same URL. When trying add a second rule, an error appears:
The user gets an error when entering the second. Currently, in my Plesk UI, I have to enter two proxy rules. When I specify only one port with SSH Docker run command from SSH, when I see the rule from Plesk, the port I specified, port 80 and the empty value are set. Since the target value of port 80 is empty, the setting cannot be completed.

Maybe you can switch to using 443 instead of 80 in all required cases because it also more secure?
I won't let you access on 80 ports. I want to restrict access to port 443. But the Docker proxy will only accept 80 ports. Is there a way to use only 443 ports?

I created an environment file (--env-file) and made no settings in Plesk and ran the Docker run command on only port 443(9443). This still doesn't work. If I look at Plesk's Docker proxy rule item as it is, 80 or 443 port selection is born.
 
Last edited:
I installed the certificate according to the "Running ONLYOFFICE Document Server using HTTPS" item on the following site.
Docker Hub

I then made https://onlyoffice.MYDOMAIN accessible via a web browser. "Document Server is running" is displayed. When I was searching on Google, some sites touched the firewall. I opened port 380 and 9443 in the firewall. But wss error continues.

I forcibly create a container with 443(9443) command with the Docker run command and specify 443 port in the Docker proxy rule, but connection is refused. Next, if I don't set a Docker proxy rule and try to connect with IP address:9443, it will be rejected.

When I access https://localhost:9443 with curl command, I can't connect. *curl: (35) Encountered end of file
 
Last edited:
- Is the port (9443/tcp) is opened in the system?
- Do you see any errors related to the certificate?
- Did you check firewall settings? Can it block network traffic for the port?
- If the VM is deployed in Cloud Provider infrastructure, did you check the provider's firewall (e.g.: Security Group in AWS, a firewall in Lightsail, etc)?

I noticed something strange. I blocked 380 and 9443 with Firewall.
Next, I clear the browser cache.
Next, access by URL.
1. http://onlyoffice.myserver:380 -> block
2. http://onlyoffice.myserver:80 -> pass *Display "Document Server is running"
3. https://onlyoffice.myserver:9443 -> block
4. https://onlyoffice.myserver:443 -> pass *Display "Document Server is running"

I started OnlyOffice using Nextcloud without changing the settings of Plesk's Docker proxy rules. Docker proxy rule is 80 -> 380.
I have access to OnlyOffice and am still getting wss errors.

OnlyOffice is accessible by 443, which was denied by Plesk.
When I created the container, 443 was rejected by Plesk because it was already used elsewhere.
 
Last edited:
Back
Top