For the complete documentation index, see llms.txt. This page is also available as Markdown.

38.8 OnlyOffice Deployment (with PostgreSQL)

This section describes the complete steps for deploying OnlyOffice on FreeBSD via pkg and working with Nginx + Nextcloud.

Installing Nextcloud and Nginx

OnlyOffice needs to work with Nextcloud; first install Nextcloud and Nginx on another machine. Only after installation is complete can you begin deploying the OnlyOffice document server.

Installing OnlyOffice

Installing OnlyOffice using the pkg package manager is the simplest method; execute the following command to complete the installation:

# pkg install onlyoffice-documentserver

Alternatively, install OnlyOffice using Ports:

# cd /usr/ports/www/onlyoffice-documentserver/
# make install clean

Viewing OnlyOffice Installation Information

Directory structure:

/
├── usr
   └── local
       ├── etc
          ├── onlyoffice
             └── documentserver
                 ├── local.json                      # OnlyOffice local configuration file
                 ├── default.json                    # OnlyOffice default configuration file
                 ├── nginx
                    └── ds.conf                     # OnlyOffice Nginx configuration
                 └── supervisor
                     └── *.conf                      # OnlyOffice supervisord configuration
          └── supervisord.conf                        # supervisord main configuration file
       ├── bin
          ├── documentserver-pluginsmanager.sh       # Plugin manager script
          └── documentserver-update-securelink.sh    # Secure link update script
       └── www
           └── onlyoffice
               └── documentserver
                   └── server
                       └── schema
                           ├── postgresql
                              ├── createdb.sql      # PostgreSQL database creation script
                              └── upgrade           # PostgreSQL upgrade scripts
                           └── mysql
                               ├── createdb.sql      # MySQL database creation script
                               └── upgrade           # MySQL upgrade scripts
└── var
    ├── log
       └── onlyoffice
           └── documentserver
               └── converter
                   └── out.log                        # OnlyOffice log file
    └── db
        └── rabbitmq
            └── .erlang.cookie                          # RabbitMQ Erlang Cookie

After installation, view the package documentation to understand the necessary configuration and precautions:

Configuring Services

After understanding the installation information, you need to configure the auto-start for OnlyOffice-related services.

Configuring the Database

OnlyOffice requires a database to store data; this section uses PostgreSQL as the database. Please refer to other chapters in this book to complete the PostgreSQL database installation, initialization, and service auto-start.

Then execute the following commands to use the database:

Configuring RabbitMQ

OnlyOffice requires RabbitMQ as the message queue service. Start the service:

Step one:

Step two:

Step three:

Allowing LAN Access

OnlyOffice's default configuration does not allow private IP address access; you need to modify the configuration to allow LAN access. Add the following snippet to the /usr/local/etc/onlyoffice/documentserver/local.json file:

That is:

Configuring Nginx

You need to configure Nginx to provide web access services for OnlyOffice. Edit the /usr/local/etc/nginx/nginx.conf file and add

to the http configuration block:

Example:

Configuring supervisord

OnlyOffice uses supervisord to manage its service processes. Edit the /usr/local/etc/supervisord.conf file, find the ;[include] at the end, and remove the semicolon at the beginning of the line:

That is:

Starting the Service

After all configuration is complete, you can start the OnlyOffice document service.

Access the IP address directly, as shown below:

Document Server is running

Configuring Nextcloud

After the OnlyOffice document service starts, you need to configure the OnlyOffice plugin in Nextcloud. Open Nextcloud:

Install the OnlyOffice plugin by accessing ip/nextcloud/index.php/settings/apps/office/onlyoffice:

onlyoffice

Click the avatar, then go to administration settings, find OnlyOffice, and configure as follows (note to confirm whether the secret key is empty):

onlyoffice

Completion

After all configuration is complete, you can test OnlyOffice functionality by previewing several files:

onlyoffice
onlyoffice
onlyoffice

Troubleshooting and Unfinished Items

If you encounter issues while using OnlyOffice, you can check the relevant log files for troubleshooting. This section also lists items that need improvement.

OnlyOffice logs are located at /var/log/onlyoffice/documentserver/converter/out.log.

References

Last updated