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

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.