Completely Remove ONLYOFFICE Document Server from Linux

To remove ONLYOFFICE Document Server completely, first identify whether it was installed as a DEB/RPM package or as a Docker container. Stop active editing sessions, remove only the matching package or container, and then review remaining data, volumes, and images separately; deleting the application does not automatically remove every dependency or persistent file.

Use the checklist below before running any deletion command. The official ONLYOFFICE removal instructions warn that the process deletes Document Server data. If you may need to restore the service, preserve its configuration, database, logs, and mounted data before proceeding.

1. Identify the installation and protect active work

Check for both installation types because a host can have a package and Docker container at the same time. On Debian or Ubuntu, inspect the package list with dpkg -l | grep onlyoffice-documentserver. The Community package is named onlyoffice-documentserver; Developer and Enterprise editions use different package names. Check the installed package name before copying a purge command. On a Docker host, use sudo docker ps -a to review stopped as well as running containers, and look for the Document Server image or a container name you recognize.

A Linux terminal shows the dpkg command used to search for an ONLYOFFICE Document Server package
The package query helps distinguish a Linux package installation from a Docker-only deployment.

Tell users to save and close open documents before shutdown. ONLYOFFICE documents that its preparation script can take up to five minutes while active sessions are handled. For a package installation, run:

documentserver-prepare4shutdown.sh

For Docker, run the same script inside the identified container:

sudo docker exec <container_name> documentserver-prepare4shutdown.sh

Replace the placeholder with the actual container name or ID. If the script is unavailable, do not assume open edits have been saved; wait for users to close documents and make a backup before stopping the server.

A Linux terminal displays the ONLYOFFICE prepare4shutdown command before service removal
Run the preparation script before disconnecting users from an active Document Server.

2. Remove a native Linux package

On Ubuntu or Debian, the Community Edition removal command in ONLYOFFICE’s guide is:

sudo apt purge onlyoffice-documentserver

For Community Edition on CentOS, ONLYOFFICE documents:

sudo yum remove onlyoffice-documentserver

Edition-specific packages differ. The official Developer Edition guide uses onlyoffice-documentserver-de, while the Enterprise Edition guide uses onlyoffice-documentserver-ee. Use the package name shown by your installed package list; do not run all variants blindly. Read the package manager’s confirmation summary before accepting it, especially if it proposes removing a database or another service you still use.

A terminal shows the apt purge command for the ONLYOFFICE Document Server Community package
On Debian-based systems, purge the exact Document Server package that is installed.

ONLYOFFICE says package removal deletes the server binaries and configuration but leaves dependencies installed. If the package manager reports that ONLYOFFICE directories are not empty, inspect them first. Its removal guide lists /etc/onlyoffice and /var/www/onlyoffice as directories that may be removed manually:

sudo rm -rvf /etc/onlyoffice /var/www/onlyoffice

This command is irreversible. Run it only after checking that those paths contain no custom configuration, logs, certificates, or data you need. For a narrower cleanup, remove only the verified Document Server subdirectory rather than the parent directory.

Two Linux file manager windows show the etc/onlyoffice and var/www/onlyoffice paths for review
Inspect these paths before manually removing directories left behind by a package purge.

3. Remove a Docker deployment

Start with sudo docker ps -a and identify the specific ONLYOFFICE container. Do not use commands that remove every container or image on the host. If the container is named onlyoffice-ds, stop and remove that container with:

sudo docker stop onlyoffice-ds
sudo docker rm onlyoffice-ds

Substitute your real container name or ID. For a Compose deployment, review docker compose ps and the Compose file first. You may stop and remove the ONLYOFFICE service by its actual service name, but avoid bringing down an entire project if that project also runs Nextcloud, a database, or a reverse proxy that should remain.

A terminal lists Docker containers and an ONLYOFFICE Document Server image
Inspect all containers, including stopped ones, and select only the Document Server instance.
A terminal shows docker stop and docker rm commands targeting one ONLYOFFICE container
Stop and remove the identified Document Server container without touching unrelated containers.

Removing a container does not automatically delete host bind-mount directories or named volumes. Inspect the container’s mounts with sudo docker inspect <container_name>, or check the volumes entries in its Compose file. Back up anything needed, then remove only the verified ONLYOFFICE data path or named volume. Docker Compose’s down -v removes project volumes; use it only when the Compose project and every volume it declares belong exclusively to this installation. Docker’s documentation notes that external volumes are not removed by Compose.

After removing the container, you can remove the ONLYOFFICE image if no other container uses it:

sudo docker image ls
sudo docker image rm onlyoffice/documentserver

If you used a specific image tag, use that exact repository and tag. Docker may retain an image that is still referenced by another container, which is a reason to check before forcing removal.

A terminal displays commands to review Docker volumes and ONLYOFFICE image names
Review volume names and image tags before removing any Docker data or cached image.

4. Remove optional leftovers and verify

If you installed from the official APT repository and no other ONLYOFFICE package on the host needs it, you may remove its repository entry and signing key. The installation guide identifies /etc/apt/sources.list.d/onlyoffice.list and /usr/share/keyrings/onlyoffice.gpg. Check their contents and confirm they are dedicated to ONLYOFFICE before deleting them. On Debian or Ubuntu, sudo apt autoremove --purge can offer to remove dependencies no longer needed; review the proposed package list carefully and cancel if it includes software used by other services. Dependency cleanup is optional, not required to stop Document Server.

Verify the result with the package manager and Docker inventory:

dpkg -l | grep onlyoffice-documentserver
sudo docker ps -a

No matching installed package or Document Server container should remain. If you also deleted its image and data, check the relevant image list, volume list, and host paths you identified earlier. Do not treat an empty package query as proof that Docker data has been removed, or a missing container as proof that its image and volumes are gone.

A terminal displays package and Docker inventory commands for checking the uninstall
Check package and container inventories separately because they represent different installation methods.

The steps above target ONLYOFFICE Docs Community, Developer, and Enterprise installations where noted; package names vary by edition, and custom deployment scripts may create different paths. For exact edition-specific commands, consult the ONLYOFFICE Community Linux removal guide, the Developer Edition removal guide, or the Enterprise Edition removal guide. For Docker, use the ONLYOFFICE Docker removal guide and Docker Compose down reference.

Leave a Comment

Completely Remove ONLYOFFICE Document Server from Linux

Completely Remove ONLYOFFICE Document Server from Linux

Identify whether Document Server uses a Linux package or Docker, remove only its components, and check remaining data without deleting shared services by mistake.

Stop ONLYOFFICE Co-Editing Lag by Finding the Bottleneck

Stop ONLYOFFICE Co-Editing Lag by Finding the Bottleneck

Trace slow collaborative editing to Docker resource pressure, proxy connections, or document load, then choose the fix that matches your measurements.

Add Fonts to ONLYOFFICE Document Server: Docker vs Linux

Add Fonts to ONLYOFFICE Document Server: Docker vs Linux

Install custom fonts in ONLYOFFICE Document Server, compare persistent Docker mounts with direct copies, rebuild the font list, and verify the result.

Configure HTTPS for ONLYOFFICE Docs in Docker

Configure HTTPS for ONLYOFFICE Docs in Docker

Choose where TLS should terminate, mount a trusted certificate and private key safely, and verify HTTPS access to a Dockerized ONLYOFFICE Docs server.

Connect a PHP App to ONLYOFFICE Docs and Save Edits

Connect a PHP App to ONLYOFFICE Docs and Save Edits

Embed the ONLYOFFICE editor in your PHP app, sign its configuration with JWT, and save edited files through a secure callback.

Keep ONLYOFFICE Spell Check on the Language You Choose

Keep ONLYOFFICE Spell Check on the Language You Choose

Set the proofing language for the whole document or selected text, confirm spell checking is active, and identify when a server dictionary is missing.

Keep Track Changes On When a Document Reopens

Keep Track Changes On When a Document Reopens

Enable persistent Track Changes for everyone in one ONLYOFFICE document, verify edits are recorded, and understand the limits of this setting.

Trace the Upstream to Clear ONLYOFFICE’s Nginx 502

Trace the Upstream to Clear ONLYOFFICE’s Nginx 502

Find whether Nginx, Docker networking, or an internal ONLYOFFICE service is returning 502, then verify the corrected upstream and health check.

Trace the Save Callback When ONLYOFFICE Won’t Save to Nextcloud

Trace the Save Callback When ONLYOFFICE Won’t Save to Nextcloud

Diagnose failed ONLYOFFICE saves by checking the Nextcloud callback route, proxy redirects, and storage logs, then verify the edited file persists.

Stop ONLYOFFICE Document Server from Running Out of VPS Memory

Stop ONLYOFFICE Document Server from Running Out of VPS Memory

Find the cause of ONLYOFFICE memory crashes, check Docker limits, size VPS RAM correctly, add swap safely, and verify that documents open and save.