A private web document server can bring great convenience in the process of cooperating with your workgroup members. In order to do that, setting up a web server in your local network will be a good way. I have set up a server using docker-ce to host onlyoffice and nextcloud, the process list as following instructions.

1.docker-ce install

Set docker-ce mirrors:

https://mirrors.tuna.tsinghua.edu.cn/
https://mirrors.tuna.tsinghua.edu.cn/help/docker-ce/

如果你过去安装过 docker,先删掉:

To install docker-ce, you need to remove pre-installed docker first:

1
sudo apt-get remove docker docker-engine docker.io

首先安装依赖:

install library dependents first:

1
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common

信任 Docker 的 GPG 公钥:

1
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

对于 amd64 架构的计算机,添加软件仓库:

1
2
3
4
sudo add-apt-repository \
"deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"

最后安装

Finally, the installation.

1
2
sudo apt-get update
sudo apt-get install docker-ce

验证安装

Verify the installation.

1
sudo docker run hello-world

配置开机运行,

Configurate system to auto start docker services at system restart.

https://docs.docker.com/install/linux/linux-postinstall/#systemd

1
sudo systemctl enable docker

2.docker onlyoffice/documentserver

拉取onlyoffice/documentserver容器

Pull the container.

1
sudo docker pull onlyoffice/documentserver

运行容器,

Run the container.

1
2
3
sudo docker run -i -t -d --restart=always -p 81:80 \
-v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice \
-v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data \ onlyoffice/documentserver

3.docker nextcloud

拉取nextcloud容器

Pull the container.

1
sudo docker pull nextcloud

运行容器

Run the container.

1
2
3
4
5
6
7
$ docker run -i -t -d --restart=always -p 82:80 \
-v nextcloud:/var/www/html \
-v apps:/var/www/html/custom_apps \
-v config:/var/www/html/config \
-v data:/var/www/html/data \
-v theme:/var/www/html/themes/<YOUR_CUSTOM_THEME> \
nextcloud

4.Combind nextcloud and onlyoffice/documentserver

https://github.com/ONLYOFFICE/onlyoffice-nextcloud

Installing Nextcloud ONLYOFFICE integration app

The Nextcloud administrator can install the integration app from the in-built application market.
For that go to the user name and select Apps.
After that find ONLYOFFICE in the list of available applications and install it.

If the server with the Nextcloud installed does not have an Internet access, or if you need it for some other reason, the administrator can install the application manually.
To start using ONLYOFFICE Document Server with Nextcloud, the following steps must be performed:

  1. Go to the Nextcloud server apps/ directory (or some other directory used):

    1
    cd apps/
  2. Get the Nextcloud ONLYOFFICE integration app.
    There are several ways to do that:

    a. Download the latest signed version from the official store for Nextcloud.

    b. Or you can download the latest signed version from the application release page on GitHub.

    c. Or you can clone the application source code and compile it yourself:

    1
    git clone https://github.com/ONLYOFFICE/onlyoffice-nextcloud.git onlyoffice
  3. Change the owner to update the application right from Nextcloud web interface:

    1
    chown -R www-data:www-data onlyoffice
  4. In Nextcloud open the ~/index.php/settings/apps?category=disabled page with Not enabled apps by administrator and click Enable for the ONLYOFFICE application.

Configuring Nextcloud ONLYOFFICE integration app

In Nextcloud open the ~/index.php/settings/admin/onlyoffice page with administrative settings for ONLYOFFICE section.
Enter the following address to connect ONLYOFFICE Document Server:

1
http://<documentserveripaddress>:81/

Where the documentserver is the name of the server with the ONLYOFFICE Document Server installed.
The address must be accessible for the user browser and from the Nextcloud server.
The Nextcloud server address must also be accessible from ONLYOFFICE Document Server for correct work.