How to install Nextcloud integrated with ONLYOFFICE using Docker

Nextcloud is a free, open source file hosting solution, a fork of the ownCloud project that offers you the ability to run a cloud storage service that you administer and control yourself. Nextcloud integrated with ONLYOFFICE Document Server permits you not only to store and share your documents, but also to view, create, edit and collaborate on your text documents, spreadsheets and presentations.

If you are a Nextcloud user already, you can integrate ONLYOFFICE editors with Nextcloud following the instructions in this tutorial. If you are new to Nextcloud, you can install it integrated with ONLYOFFICE all at once using the provided Docker script.


To install the preconfigured version of ONLYOFFICE Document Server connected to Nextcloud using Docker containers, you will need:

Step 1. Installation

Before you start the installation process, make sure your machine meets the following requirements:

  • CPU: dual core 2 GHz or better
  • RAM: 2 GB or more
  • HDD: at least 40 GB of free space
  • At least 2 GB of swap

Step 1. Get the latest version of docker-onlyoffice-owncloud repository.

Use the following commands:

Download the repository:

git clone --recursive

Go to the required folder:

cd docker-onlyoffice-owncloud

Set it for updates:

git submodule update --remote

Step 2. Edit the docker-compose.yml file.

Edit the docker-compose.yml file, as docker-onlyoffice-owncloud repository combines both Nextcloud and ownCloud configurations, and ownCloud is chosen by default.

Open the specified file with nano text editor or any other:

nano docker-compose.yml

Find the image: owncloud:fpm line and type nextcloud instead of owncloud. The line has to be altered this way:

image: nextcloud:fpm.

Step 3. Run Docker Compose.

docker-compose up -d

The installation process will go automatically. Wait for a short while, until all the containers are installed.

Step 4. Configure Nextcloud web application.

Launch the browser and enter your web server address. The Nextcloud Wizard web page will be opened. Enter the username and password to create your admin account.


Step 5. Complete the configuration and start editing.

There is still no option to edit your documents in Nextcloud with ONLYOFFICE Document Server. To complete the configuration, go back to the downloaded folder and run the script:


Refresh the web page. The new Open in ONLYOFFICE option will be available in the file menu. Now you can edit and collaborate on your documents right in Nextcloud using ONLYOFFICE.

ONLYOFFICE with NextCloud

Share this page:

7 Comment(s)

Add comment

Please register in our forum first to comment.


By: terry

Excellent instructions. Easy to follow and it all just worked, a great introduction to containers. However, more instruction should be given to ensure the containers are started at boot time. I'm still trying to figure that one out.

By: Nicola


I'm having few problems moving everything to https. I modified the nginx.conf on both nginx-server and onlyoffice-document-server containers, but I can't get that working.


Can you help?


By: tokenterprises

Thank you so much for these instructions. These worked when many other instructions led to late nights of debugging. There is one issue my installation is having, and I know many others are as well. When I go to edit a document, I am presented with the error message "The document could not be saved. Please check connection settings or contact your Administrator."Have you encountered this, or the path or file that needs to be edited to help the dockers communicate together?

By: kissson

the easiest method on the web! I have been fiddle around for days, look around CODE 3.0, docker, reverse proxy and can't make it to work, but onlyoffice not working with HKSCS charset :(

By: Quentin

EXCELLENT !It just works ! Thank you !!

I followed several tutorial and it didn't work, but yours was easy quick and works :)

By: nacef

Think you for your tuto it work great i just needed to install docker-compose, at least we don't need any https certificate

but please is the a mysql datbase running or just sqlite


By: torno

Hola, hago la instalacion en una VM, pero ingreso la ip de la maquina y me arroja bad gateway... ¿cual es la url a la que se debe entrar en la maquina ?


lo otro es que no esta por ningun lado el script ""